From e88c45561a71ae018a999ed522317d6efb3875f0 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 5 Jul 2025 00:37:45 +0200 Subject: [PATCH 001/147] Fixed the QComboBox issues for light and dark style --- retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss | 1 + retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss | 1 + 2 files changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss index ffea0a4d8..e050115a8 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss @@ -1243,6 +1243,7 @@ QComboBox { /* changed to 4px to fix #239 */ /* Fixes #103, #111 */ min-height: 1.5em; + min-width: 35px; /* padding-top: 2px; removed to fix #132 */ /* padding-bottom: 2px; removed to fix #132 */ /* min-width: 75px; removed to fix #109 */ diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss index 40fe0b78c..d6a925428 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss @@ -1243,6 +1243,7 @@ QComboBox { /* changed to 4px to fix #239 */ /* Fixes #103, #111 */ min-height: 1.5em; + min-width: 35px; /* padding-top: 2px; removed to fix #132 */ /* padding-bottom: 2px; removed to fix #132 */ /* min-width: 75px; removed to fix #109 */ From 557e24a5dc0f7a7770e31173e6466322c7d55682 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 7 Jul 2025 21:45:00 +0200 Subject: [PATCH 002/147] Fix for Standard Dark --- retroshare-gui/src/gui/elastic/arrow.cpp | 8 ++++++-- retroshare-gui/src/gui/elastic/edge.cpp | 13 +++++++++++-- retroshare-gui/src/gui/elastic/elnode.cpp | 7 ++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/elastic/arrow.cpp b/retroshare-gui/src/gui/elastic/arrow.cpp index 6a95f2041..42520c9fd 100644 --- a/retroshare-gui/src/gui/elastic/arrow.cpp +++ b/retroshare-gui/src/gui/elastic/arrow.cpp @@ -21,6 +21,7 @@ // This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-arrow-cpp.html #include +#include "gui/settings/rsharesettings.h" #include "arrow.h" #include "elnode.h" @@ -121,8 +122,11 @@ void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * cos(angle - Pi / 3) * arrowSize); QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize, cos(angle - Pi + Pi / 3) * arrowSize); - - painter->setBrush(Qt::black); + if (Settings->getSheetName() == ":Standard_Dark"){ + painter->setBrush(Qt::white); + } else { + painter->setBrush(Qt::black); + } painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2); painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); } diff --git a/retroshare-gui/src/gui/elastic/edge.cpp b/retroshare-gui/src/gui/elastic/edge.cpp index 0fd8707d2..8b99c8181 100644 --- a/retroshare-gui/src/gui/elastic/edge.cpp +++ b/retroshare-gui/src/gui/elastic/edge.cpp @@ -21,6 +21,7 @@ // This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-edge-cpp.html #include +#include "gui/settings/rsharesettings.h" #include "edge.h" #include "elnode.h" @@ -103,7 +104,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) // Draw the line itself QLineF line(sourcePoint, destPoint); - painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + if (Settings->getSheetName() == ":Standard_Dark"){ + painter->setPen(QPen(Qt::white, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + } else { + painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); + } painter->drawLine(line); return ; @@ -146,7 +151,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) QPointF destArrowP1 = destPoint + QPointF( sin_theta_mins_pi_over_3 * arrowSize, cos_theta_mins_pi_over_3 * arrowSize); QPointF destArrowP2 = destPoint + QPointF(sin_theta_mins_2_pi_over_3 * arrowSize, cos_theta_mins_2_pi_over_3 * arrowSize); - painter->setBrush(Qt::black); + if (Settings->getSheetName() == ":Standard_Dark"){ + painter->setBrush(Qt::white); + }else { + painter->setBrush(Qt::black); + } painter->drawConvexPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2); painter->drawConvexPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2); } diff --git a/retroshare-gui/src/gui/elastic/elnode.cpp b/retroshare-gui/src/gui/elastic/elnode.cpp index 86bb4e31e..6c25860ad 100644 --- a/retroshare-gui/src/gui/elastic/elnode.cpp +++ b/retroshare-gui/src/gui/elastic/elnode.cpp @@ -21,6 +21,7 @@ // This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-cpp.html #include "gui/common/FilesDefs.h" +#include "gui/settings/rsharesettings.h" #include #include @@ -302,7 +303,11 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid #endif } painter->setBrush(gradient); - painter->setPen(QPen(Qt::black, 0)); + if (Settings->getSheetName() == ":Standard_Dark"){ + painter->setPen(QPen(Qt::white, 0)); + } else { + painter->setPen(QPen(Qt::black, 0)); + } painter->drawEllipse(-mNodeDrawSize2, -mNodeDrawSize2, mNodeDrawSize, mNodeDrawSize); QString txt = QString::fromUtf8(_desc_string.c_str()); From e78367f12ff26761295bd6279813df7c91a37689 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 14 Jul 2025 19:39:24 +0200 Subject: [PATCH 003/147] Fixed hardcoded pen color --- .../FileTransfer/FileTransferInfoWidget.cpp | 20 +++++++++++++------ .../gui/FileTransfer/FileTransferInfoWidget.h | 2 ++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp index 6adb61a68..651cbf819 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp @@ -29,6 +29,7 @@ #include "FileTransferInfoWidget.h" #include "gui/RetroShareLink.h" #include "gui/common/FilesDefs.h" +#include "gui/settings/rsharesettings.h" // Variables to decide of display behaviour. All variables are expressed as a factor of font height // @@ -132,7 +133,13 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info int ch_num_size = ch_num_size_factor*S ; int tab_size = tab_size_factor*S ; - painter->setPen(QColor::fromRgb(0,0,0)) ; + if (Settings->getSheetName() == ":Standard_Dark"){ + penColor = Qt::gray ; + } else { + penColor = Qt::black ; + } + + painter->setPen(penColor) ; y += text_height ; painter->drawText(0,y,tr("Chunk map") + ":") ; y += block_sep ; @@ -176,13 +183,13 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info uint32_t sizeY = 1*S ; y += block_sep ; y += text_height ; - painter->setPen(QColor::fromRgb(0,0,0)) ; + painter->setPen(penColor) ; painter->drawText(0,y,tr("Active chunks") + ":") ; y += block_sep ; for(uint i=0;isetPen(QColor::fromRgb(0,0,0)) ; + painter->setPen(penColor) ; painter->drawText(0.5*S,y+text_height*0.9,QString::number(info.active_chunks[i].first)) ; int size_of_this_chunk = ( info.active_chunks[i].first == info.chunks.size()-1 && ((info.file_size % blockSize)>0) )?(info.file_size % blockSize):blockSize ; @@ -212,7 +219,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info } - painter->setPen(QColor::fromRgb(0,0,0)) ; + painter->setPen(penColor) ; float percent = (size_of_this_chunk - info.active_chunks[i].second)*100.0/size_of_this_chunk ; painter->drawText(sizeX+5.5*S,y+text_height*0.9,QString::number(percent,'f',2) + " %") ; @@ -227,7 +234,7 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info y += block_sep ; y += text_height ; - painter->setPen(QColor::fromRgb(0,0,0)) ; + painter->setPen(penColor) ; painter->drawText(0,y,(info.compressed_peer_availability_maps.size() == 1 ? tr("Availability map (%1 active source)") : tr("Availability map (%1 active sources)")).arg(info.compressed_peer_availability_maps.size())) ; y += block_sep ; @@ -254,7 +261,8 @@ void FileTransferInfoWidget::draw(const FileInfo& nfo,const FileChunksInfo& info // various info: // - painter->setPen(QColor::fromRgb(0,0,0)) ; + painter->setPen(penColor) ; + y += text_height ; painter->drawText(0,y,tr("File info") + ":") ; y += block_sep ; y += text_height ; painter->drawText(2*S,y,tr("File name") + ":") ; painter->drawText(tab_size,y,QString::fromUtf8(nfo.fname.c_str())) ; diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h index fdf45f2ff..1a8a4f922 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -58,6 +59,7 @@ private: QPixmap downloadingPixmap; QPixmap notDownloadPixmap; QPixmap checkingPixmap; + QColor penColor; RsFileHash _file_hash ; }; From 995e3fee8562a968cc4c233a7e429d2121b1203f Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 14 Jul 2025 21:29:53 +0200 Subject: [PATCH 004/147] Fixed hardcoded background color --- .../src/gui/settings/RSPermissionMatrixWidget.cpp | 15 +++++++++++---- .../src/gui/settings/RSPermissionMatrixWidget.h | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp index 76622625b..671fed49f 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp @@ -32,6 +32,7 @@ #include "RSPermissionMatrixWidget.h" #include "gui/settings/ServicePermissionsPage.h" +#include "gui/settings/rsharesettings.h" #include #include #include @@ -246,8 +247,14 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) _painter->setRenderHint(QPainter::TextAntialiasing); /* Fill in the background */ - _painter->fillRect(_rec, QBrush(BACK_COLOR)); + //_painter->fillRect(_rec, QBrush(BACK_COLOR)); _painter->drawRect(_rec); + + if (Settings->getSheetName() == ":Standard_Dark"){ + brushColor = Qt::gray ; + } else { + brushColor = Qt::black ; + } // draw one line per friend. std::list ssllist ; @@ -306,7 +313,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) QPen pen ; pen.setWidth(2) ; - pen.setBrush(FOREGROUND_COLOR) ; + pen.setBrush(brushColor) ; _painter->setPen(pen) ; int i=0; @@ -371,7 +378,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) _painter->drawLine(QPointF(X,Y+3),QPointF(X+text_width,Y+3)) ; _painter->drawLine(QPointF(X+text_width/2, Y+3), QPointF(X+text_width/2,S*fMATRIX_START_Y+peer_ids.size()*S*fROW_SIZE - S*fROW_SIZE+5)) ; - pen.setBrush(FOREGROUND_COLOR) ; + pen.setBrush(brushColor) ; _painter->setPen(pen) ; _painter->drawText(QPointF(X,Y),name); @@ -553,7 +560,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) brush.setStyle(Qt::SolidPattern) ; QPen pen ; pen.setWidth(1) ; - pen.setBrush(FOREGROUND_COLOR) ; + pen.setBrush(brushColor) ; _painter->setPen(pen) ; QRect position = computeNodePosition(0,i,false) ; int popup_x = position.x() + (50 * S / 14.0); diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h index ffc9a32b0..33aee43f8 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -103,6 +104,7 @@ private: /** The current dimensions of the graph. */ QRect _rec; + QColor brushColor; bool mHideOffline; From f53a30a0e47ab194f92318172c1b672e25fed363 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 17 Jul 2025 20:20:46 +0200 Subject: [PATCH 005/147] Updated external libraries for Windows native build - curl-8.9.1 - ffmpeg-4.4.6 - libxml2-2.14.5 - libxslt-1.1.43 - speex-1.2.1 - speexdsp-1.2.1 - xapian-core-1.4.29 --- build_scripts/Windows/build-libs/Makefile | 96 ++++++++++++----------- plugins/FeedReader/FeedReader.pro | 2 +- 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index f1649d91f..b0c9ce137 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -2,17 +2,19 @@ ZLIB_VERSION=1.2.11 BZIP2_VERSION=1.0.8 MINIUPNPC_VERSION=2.2.3 OPENSSL_VERSION=1.1.1w -SPEEX_VERSION=1.2.0 -SPEEXDSP_VERSION=1.2.0 -LIBXML2_VERSION=2.9.12 -LIBXSLT_VERSION=1.1.34 -CURL_VERSION=7.81.0 +SPEEX_VERSION=1.2.1 +SPEEXDSP_VERSION=1.2.1 +LIBXML2_MAIN_VERSION=2.14 +LIBXML2_VERSION=$(LIBXML2_MAIN_VERSION).5 +LIBXSLT_MAIN_VERSION=1.1 +LIBXSLT_VERSION=$(LIBXSLT_MAIN_VERSION).43 +CURL_VERSION=8.9.1 TCL_VERSION=8.6.10 SQLCIPHER_VERSION=4.5.0 LIBMICROHTTPD_VERSION=0.9.75 -FFMPEG_VERSION=4.4 +FFMPEG_VERSION=4.4.6 RAPIDJSON_VERSION=1.1.0 -XAPIAN_VERSION=1.4.19 +XAPIAN_VERSION=1.4.29 ASIO_VERSION=1-34-2 #RNP_VERSION=0.17.1 @@ -24,7 +26,7 @@ DOWNLOAD_PATH?=download BUILD_PATH=build LIBS_PATH?=libs -all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan asio copylibs +all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan asio copylibs #rnp download: \ @@ -34,13 +36,13 @@ download: \ $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VERSION).tar.gz \ $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).tar.gz \ $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz \ - $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz \ - $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz \ + $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz \ + $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz \ $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz \ $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz \ $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz \ $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz \ - $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz \ + $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz \ $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz \ $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz @@ -191,50 +193,52 @@ $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP rm -r -f speexdsp-$(SPEEXDSP_VERSION) mv $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION) -libxml2: $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) +libxml: \ + $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) \ + $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION) -$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz: - wget ftp://xmlsoft.org/libxml2/libxml2-$(LIBXML2_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz +$(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz: + wget --no-check-certificate https://download.gnome.org/sources/libxml2/$(LIBXML2_MAIN_VERSION)/libxml2-$(LIBXML2_VERSION).tar.xz -O $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz -$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz - # prepare +$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz: + wget --no-check-certificate https://download.gnome.org/sources/libxslt/$(LIBXSLT_MAIN_VERSION)/libxslt-$(LIBXSLT_VERSION).tar.xz -O $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz + +$(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION): \ + $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz \ + $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz + # libxml2: prepare + pacman --needed --noconfirm -S python3 pkg-config rm -r -f $(BUILD_PATH)/libxml2-* - tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz - # build + tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz + # libxslt: prepare + rm -r -f $(BUILD_PATH)/libxslt-* + tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.xz + tar xvf $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.xz + # libxml2: build cd libxml2-$(LIBXML2_VERSION) && ./configure --without-iconv -enable-shared=no #cd libxml2-$(LIBXML2_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" - cd libxml2-$(LIBXML2_VERSION) && make - # copy files + cd libxml2-$(LIBXML2_VERSION) && make libxml2.la + # libxslt: build + cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC + cd libxslt-$(LIBXSLT_VERSION)/libxslt && make + cd libxslt-$(LIBXSLT_VERSION)/libexslt && make + # libxml2: copy files mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml cp libxml2-$(LIBXML2_VERSION)/include/libxml/*.h $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml/ mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib cp libxml2-$(LIBXML2_VERSION)/.libs/libxml2.a $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/lib/ - # cleanup - #rm -r -f libxml2-$(LIBXML2_VERSION) # see libxslt - mv $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) - -libxslt: $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION) - -$(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz: - wget ftp://xmlsoft.org/libxml2/libxslt-$(LIBXSLT_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz - -$(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION): $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz - # prepare - rm -r -f $(BUILD_PATH)/libxslt-* - tar xvf $(DOWNLOAD_PATH)/libxml2-$(LIBXML2_VERSION).tar.gz - tar xvf $(DOWNLOAD_PATH)/libxslt-$(LIBXSLT_VERSION).tar.gz - # build - cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC - cd libxslt-$(LIBXSLT_VERSION) && make - # copy files + # libxslt: copy files mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt cp libxslt-$(LIBXSLT_VERSION)/libxslt/*.h $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/include/libxslt/ mkdir -p $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib cp libxslt-$(LIBXSLT_VERSION)/libxslt/.libs/libxslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/ cp libxslt-$(LIBXSLT_VERSION)/libexslt/.libs/libexslt.a $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp/lib/ - # cleanup + # libxml2: cleanup rm -r -f libxml2-$(LIBXML2_VERSION) + # libxslt: cleanup rm -r -f libxslt-$(LIBXSLT_VERSION) + # finish + mv $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) mv $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION).tmp $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION) curl: $(BUILD_PATH)/curl-$(CURL_VERSION) @@ -249,7 +253,7 @@ $(BUILD_PATH)/curl-$(CURL_VERSION): $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz # build cd curl-$(CURL_VERSION) && ./configure --disable-shared --with-ssl="`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)" #cd curl-$(CURL_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" - cd curl-$(CURL_VERSION) && make + cd curl-$(CURL_VERSION)/lib && make # copy files mkdir -p $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl cp curl-$(CURL_VERSION)/include/curl/*.h $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl/ @@ -312,13 +316,13 @@ $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION): $(DOWNLOAD_PATH)/libmicroh ffmpeg: $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION) -$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz: - wget --no-check-certificate https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.gz -O $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz +$(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz: + wget --no-check-certificate https://ffmpeg.org/releases/ffmpeg-$(FFMPEG_VERSION).tar.xz -O $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz -$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz +$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz # prepare rm -r -f $(BUILD_PATH)/ffmpeg-* - tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.gz + tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz # build cd ffmpeg-$(FFMPEG_VERSION) && ./configure --disable-shared --enable-static --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-yasm --disable-everything --enable-encoder=mpeg4 --enable-decoder=mpeg4 --prefix="`pwd`/../$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp" cd ffmpeg-$(FFMPEG_VERSION) && make install @@ -438,5 +442,5 @@ $(BUILD_PATH)/rnp-$(RNP_VERSION): copylibs: rm -r -f $(LIBS_PATH) ; \ mkdir -p $(LIBS_PATH) ; \ - cp $(BUILD_PATH)/gcc-version $(LIBS_PATH) ; \ - find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r {}/. $(LIBS_PATH) \; ; \ + cp -p $(BUILD_PATH)/gcc-version $(LIBS_PATH) ; \ + find $(BUILD_PATH) -mindepth 1 -maxdepth 1 -type d -not -name "*.tmp" -print -exec cp -r -p {}/. $(LIBS_PATH) \; ; \ diff --git a/plugins/FeedReader/FeedReader.pro b/plugins/FeedReader/FeedReader.pro index e9a352b33..97137c2b2 100644 --- a/plugins/FeedReader/FeedReader.pro +++ b/plugins/FeedReader/FeedReader.pro @@ -128,7 +128,7 @@ win32 { isEmpty(QMAKE_SH) { # MinGW - LIBS += -lcrypt32 + LIBS += -lcrypt32 -lbcrypt } # Check for msys2 From e5c42e63b7c283b5e647927895736d69644c17e0 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 10:47:19 +0200 Subject: [PATCH 006/147] Added missing includes --- retroshare-gui/src/gui/MainWindow.cpp | 1 + retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 1 + retroshare-gui/src/gui/common/AvatarDialog.cpp | 1 + retroshare-gui/src/gui/common/LineEditClear.cpp | 1 + retroshare-gui/src/gui/common/RSTreeWidget.cpp | 1 + retroshare-gui/src/gui/msgs/MessageComposer.cpp | 1 + retroshare-gui/src/gui/statistics/StatisticsWindow.cpp | 1 + 7 files changed, 7 insertions(+) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index da25bc2c6..5ba8f1ddd 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index dd4a128a4..fbc35d2cf 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "ChatLobbyDialog.h" diff --git a/retroshare-gui/src/gui/common/AvatarDialog.cpp b/retroshare-gui/src/gui/common/AvatarDialog.cpp index dd302b570..2cb595847 100644 --- a/retroshare-gui/src/gui/common/AvatarDialog.cpp +++ b/retroshare-gui/src/gui/common/AvatarDialog.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index a6ba67bfa..cf45bc75b 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -24,6 +24,7 @@ #include #include #include +#include //#if QT_VERSION < 0x040700 #if QT_VERSION < 0x050000//PlaceHolder text only shown when not have focus in Qt4 #include diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.cpp b/retroshare-gui/src/gui/common/RSTreeWidget.cpp index 7e3a8b216..8ecdfde3f 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidget.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "gui/settings/rsharesettings.h" #include "gui/common/FilesDefs.h" diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index 0ee408685..47da8e913 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index 48b1462cc..684fdc69d 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -22,6 +22,7 @@ #include "ui_StatisticsWindow.h" #include #include +#include #include #include From c4d1de06d0d80a9a383df03a11ab0bd566b4e315 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 11:25:21 +0200 Subject: [PATCH 007/147] Fixed converting number to QString --- retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index 4236b6f04..3224b428f 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -449,7 +449,7 @@ void CreateGxsForumMsg::createMsg() default: std::cerr << "CreateGxsForumMsg::createMsg() ERROR GETTING AuthorId!"; std::cerr << std::endl; - QMessageBox::warning(this, tr("RetroShare"),tr("Congrats, you found a bug!")+" "+QString(__FILE__)+":"+QString(__LINE__), QMessageBox::Ok, QMessageBox::Ok); + QMessageBox::warning(this, tr("RetroShare"),tr("Congrats, you found a bug!")+" "+QString(__FILE__)+":"+QString::number(__LINE__), QMessageBox::Ok, QMessageBox::Ok); return; }//switch (ui->idChooser->getChosenId(authorId)) From 23f925f81ea48706eeeeebb9a0657aa198478796 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 03:05:15 +0200 Subject: [PATCH 008/147] Fixed constructor of RsAction --- retroshare-gui/src/util/RsAction.cpp | 2 +- retroshare-gui/src/util/RsAction.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/util/RsAction.cpp b/retroshare-gui/src/util/RsAction.cpp index f80fd0293..a0c38d492 100644 --- a/retroshare-gui/src/util/RsAction.cpp +++ b/retroshare-gui/src/util/RsAction.cpp @@ -20,7 +20,7 @@ #include "util/RsAction.h" -RsAction::RsAction(QWidget * parent, std::string rsid) +RsAction::RsAction(QObject * parent, std::string rsid) : QAction(parent), RsId(rsid) { connect(this, SIGNAL( triggered( bool ) ), this, SLOT( triggerEvent( bool ) ) ); diff --git a/retroshare-gui/src/util/RsAction.h b/retroshare-gui/src/util/RsAction.h index d61efc08b..b2110428a 100644 --- a/retroshare-gui/src/util/RsAction.h +++ b/retroshare-gui/src/util/RsAction.h @@ -28,7 +28,7 @@ class RsAction : public QAction { Q_OBJECT public: - RsAction(QWidget * parent, std::string rsid); + RsAction(QObject *parent, std::string rsid); RsAction(const QString & text, QObject * parent, std::string rsid); RsAction(const QIcon & icon, const QString & text, QObject * parent , std::string rsid); From 23289c49911df185b291cca8ae469fccc078b965 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 11:04:07 +0200 Subject: [PATCH 009/147] Use Qt::MouseButton::NoButton instead of 0 in arrow.cpp --- retroshare-gui/src/gui/elastic/arrow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/elastic/arrow.cpp b/retroshare-gui/src/gui/elastic/arrow.cpp index 6a95f2041..5698a3da6 100644 --- a/retroshare-gui/src/gui/elastic/arrow.cpp +++ b/retroshare-gui/src/gui/elastic/arrow.cpp @@ -33,7 +33,7 @@ static double TwoPi = 2.0 * Pi; Arrow::Arrow(Node *sourceNode, Node *destNode) : arrowSize(10) { - setAcceptedMouseButtons(0); + setAcceptedMouseButtons(Qt::MouseButton::NoButton); source = sourceNode; dest = destNode; #ifdef SUSP From eaf2861cd0ab8deb258a0c8135b118d83945bb12 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 03:17:08 +0200 Subject: [PATCH 010/147] Fixed usage of QFileInfo in RsCollectionDialog.cpp --- retroshare-gui/src/gui/common/RsCollectionDialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp index b71616678..5eb56506d 100644 --- a/retroshare-gui/src/gui/common/RsCollectionDialog.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionDialog.cpp @@ -362,7 +362,7 @@ void RsCollectionDialog::directoryLoaded(QString dirLoaded) if(!_dirLoaded) { - QFileInfo lastDir = Settings->getLastDir(RshareSettings::LASTDIR_EXTRAFILE); + QFileInfo lastDir = QFileInfo(Settings->getLastDir(RshareSettings::LASTDIR_EXTRAFILE)); if (lastDir.absoluteFilePath() == "") return; if (lastDir.absoluteFilePath() == dirLoaded) _dirLoaded = true; @@ -513,7 +513,7 @@ void RsCollectionDialog::addSelectionRecursive() static void recursBuildFileTree(const QString& path,RsFileTree& tree,RsFileTree::DirIndex dir_index,bool recursive,std::map& paths_to_hash) { - QFileInfo fileInfo = path; + QFileInfo fileInfo = QFileInfo(path); if (fileInfo.isDir()) { From 9f607765bccdb6f304dddb6868aac8f488b4763f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 14:51:33 +0200 Subject: [PATCH 011/147] Fixed crash in VOIP by initializing member _image_capture in constructor of QVideoInputDevice --- plugins/VOIP/gui/QVideoDevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/VOIP/gui/QVideoDevice.cpp b/plugins/VOIP/gui/QVideoDevice.cpp index 51e3a83bf..fb81b84e2 100644 --- a/plugins/VOIP/gui/QVideoDevice.cpp +++ b/plugins/VOIP/gui/QVideoDevice.cpp @@ -37,6 +37,7 @@ QVideoInputDevice::QVideoInputDevice(QWidget *parent) _capture_device = NULL ; _video_processor = NULL ; _echo_output_device = NULL ; + _image_capture = NULL; } QVideoInputDevice::~QVideoInputDevice() From 8265c5ebec72d0737a2ed7ed415b8a7108769da6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 03:15:10 +0200 Subject: [PATCH 012/147] Use Qt::KeyboardModifier::NoModifier instead of 0 in RsButtonOnText.cpp --- retroshare-gui/src/gui/common/RsButtonOnText.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/RsButtonOnText.cpp b/retroshare-gui/src/gui/common/RsButtonOnText.cpp index 95466c9d4..8774f84bd 100644 --- a/retroshare-gui/src/gui/common/RsButtonOnText.cpp +++ b/retroshare-gui/src/gui/common/RsButtonOnText.cpp @@ -107,7 +107,7 @@ bool RSButtonOnText::eventFilter(QObject *obj, QEvent *event) } if (event->type() == QEvent::MouseButtonPress) { QMouseEvent* mouseEvent = new QMouseEvent(QEvent::MouseButtonPress - ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,0); + ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,Qt::KeyboardModifier::NoModifier); QPushButton::mousePressEvent(mouseEvent); delete mouseEvent; if (guard) _pressed = true; @@ -116,7 +116,7 @@ bool RSButtonOnText::eventFilter(QObject *obj, QEvent *event) } if (event->type() == QEvent::MouseButtonRelease) { QMouseEvent* mouseEvent = new QMouseEvent(QEvent::MouseButtonPress - ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,0); + ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,Qt::KeyboardModifier::NoModifier); QPushButton::mouseReleaseEvent(mouseEvent); delete mouseEvent; if (guard) _pressed = false; @@ -152,7 +152,7 @@ bool RSButtonOnText::eventFilter(QObject *obj, QEvent *event) } if (_pressed){ QMouseEvent* mouseEvent = new QMouseEvent(QEvent::MouseButtonPress - ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,0); + ,QPoint(1,1),Qt::LeftButton,Qt::LeftButton,Qt::KeyboardModifier::NoModifier); QPushButton::mouseReleaseEvent(mouseEvent); delete mouseEvent; //if (guard) emit released(); From 29443c4b781906f93c02883c02958fbe0f3f5781 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 02:37:46 +0200 Subject: [PATCH 013/147] Use QTextDocument::FindFlags() to initialize flags instead of 0 in helpbrowser.cpp --- retroshare-gui/src/gui/help/browser/helpbrowser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp index f062b908c..0da10e9d9 100644 --- a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp +++ b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp @@ -348,7 +348,7 @@ HelpBrowser::find(bool forward) return; } - QTextDocument::FindFlags flags = 0; + QTextDocument::FindFlags flags = QTextDocument::FindFlags(); QTextCursor cursor = ui.txtBrowser->textCursor(); QString searchPhrase = ui.lineFind->text(); From fcd7a213e6ed0453746bfc3f91a6b5bd8fcf5154 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 11:35:00 +0200 Subject: [PATCH 014/147] Use UIStates() instead of 0 in GxsMessageFrameWidget.cpp --- retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp index 1f55f514f..8a42911ac 100644 --- a/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsMessageFrameWidget.cpp @@ -35,7 +35,7 @@ GxsMessageFrameWidget::GxsMessageFrameWidget(RsGxsIfaceHelper *ifaceImpl, QWidge mAcknowledgeReadStatusToken = 0; /* Add dummy entry to store waiting status */ - mStateHelper->addWidget(mTokenTypeAcknowledgeReadStatus, NULL, 0); + mStateHelper->addWidget(mTokenTypeAcknowledgeReadStatus, NULL, UIStates()); } GxsMessageFrameWidget::~GxsMessageFrameWidget() From b2bec12a43d6bde72a74f94e4479f911e28c9a30 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 03:20:44 +0200 Subject: [PATCH 015/147] Fixed usage of deprecated method "const QPixmap *QLabel::pixmap() const;" --- retroshare-gui/src/gui/Identity/IdEditDialog.cpp | 4 ++-- retroshare-gui/src/gui/common/AvatarDialog.cpp | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp index 7e5544413..add0de131 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp @@ -700,8 +700,8 @@ void IdEditDialog::removeAvatar() void IdEditDialog::updateInterface() { - const QPixmap *pixmap = ui->avatarLabel->pixmap(); - if (pixmap && !pixmap->isNull()) { + QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue); + if (!pixmap.isNull()) { ui->removeButton->setEnabled(true); } else if (mEditGroup.mImage.mSize > 0) { ui->removeButton->setEnabled(true); diff --git a/retroshare-gui/src/gui/common/AvatarDialog.cpp b/retroshare-gui/src/gui/common/AvatarDialog.cpp index 2cb595847..a5e8d15d4 100644 --- a/retroshare-gui/src/gui/common/AvatarDialog.cpp +++ b/retroshare-gui/src/gui/common/AvatarDialog.cpp @@ -107,8 +107,8 @@ void AvatarDialog::removeAvatar() void AvatarDialog::updateInterface() { - const QPixmap *pixmap = ui->avatarLabel->pixmap(); - if (pixmap && !pixmap->isNull()) { + QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue); + if (!pixmap.isNull()) { ui->removeButton->setEnabled(true); } else { ui->removeButton->setEnabled(false); @@ -123,13 +123,7 @@ void AvatarDialog::setAvatar(const QPixmap &avatar) void AvatarDialog::getAvatar(QPixmap &avatar) { - const QPixmap *pixmap = ui->avatarLabel->pixmap(); - if (!pixmap) { - avatar = QPixmap(); - return; - } - - avatar = *pixmap; + avatar = ui->avatarLabel->pixmap(Qt::ReturnByValue); } void AvatarDialog::getAvatar(QByteArray &avatar) From f38b72e7a3fcdcece6caf8120e4ec4240867fa63 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 19:45:04 +0200 Subject: [PATCH 016/147] Changed parameter of method enterEvent on ClickableLabel and ZoomableLabel for Qt 6 to QEnterEvent --- .../gxschannels/GxsChannelPostThumbnail.cpp | 18 ++++++++++++++++++ .../gui/gxschannels/GxsChannelPostThumbnail.h | 8 ++++++-- retroshare-gui/src/util/ClickableLabel.cpp | 18 ++++++++++++++++++ retroshare-gui/src/util/ClickableLabel.h | 8 ++++++-- 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp index 16cf96195..560c37577 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp @@ -309,6 +309,24 @@ void ZoomableLabel::wheelEvent(QWheelEvent *me) updateView(); } +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +void ZoomableLabel::enterEvent(QEnterEvent* /*event*/) +#else +void ZoomableLabel::enterEvent(QEvent* /*event*/) +#endif +{ + if (mUseStyleSheet) { + setStyleSheet("QLabel { border: 2px solid #039bd5; }"); + } +} + +void ZoomableLabel::ZoomableLabel::leaveEvent(QEvent* /*event*/) +{ + if (mUseStyleSheet) { + setStyleSheet("QLabel { border: 2px solid #CCCCCC; border-radius: 3px; }"); + } +} + QPixmap ZoomableLabel::extractCroppedScaledPicture() const { QRect rect(mCenterX - 0.5 * width()*mZoomFactor, mCenterY - 0.5 * height()*mZoomFactor, width()*mZoomFactor, height()*mZoomFactor); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.h index 7ee928f9e..da30f2083 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.h @@ -64,8 +64,12 @@ protected: void resizeEvent(QResizeEvent *ev) override; void wheelEvent(QWheelEvent *me) override; - void enterEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #039bd5; }");} - void leaveEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #CCCCCC; border-radius: 3px; }");} +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + void enterEvent(QEnterEvent *event) override; +#else + void enterEvent(QEvent *event) override; +#endif + void leaveEvent(QEvent *event) override; bool mUseStyleSheet; diff --git a/retroshare-gui/src/util/ClickableLabel.cpp b/retroshare-gui/src/util/ClickableLabel.cpp index 6bbd5ca4a..ee16abdc8 100644 --- a/retroshare-gui/src/util/ClickableLabel.cpp +++ b/retroshare-gui/src/util/ClickableLabel.cpp @@ -33,3 +33,21 @@ ClickableLabel::~ClickableLabel() { void ClickableLabel::mousePressEvent(QMouseEvent* /*event*/) { emit clicked(); } + +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +void ClickableLabel::enterEvent(QEnterEvent* /*event*/) +#else +void ClickableLabel::enterEvent(QEvent* /*event*/) +#endif +{ + if (mUseStyleSheet) { + setStyleSheet("QLabel { border: 2px solid #039bd5; }"); + } +} + +void ClickableLabel::leaveEvent(QEvent* /*event*/) +{ + if (mUseStyleSheet) { + setStyleSheet(""); + } +} diff --git a/retroshare-gui/src/util/ClickableLabel.h b/retroshare-gui/src/util/ClickableLabel.h index 54b3499d8..610a1eabd 100644 --- a/retroshare-gui/src/util/ClickableLabel.h +++ b/retroshare-gui/src/util/ClickableLabel.h @@ -39,8 +39,12 @@ signals: protected: void mousePressEvent(QMouseEvent* event) override; - void enterEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("QLabel { border: 2px solid #039bd5; }");} - void leaveEvent(QEvent * /* ev */ ) override { if(mUseStyleSheet) setStyleSheet("");} +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + void enterEvent(QEnterEvent* event) override; +#else + void enterEvent(QEvent* event) override; +#endif + void leaveEvent(QEvent* event) override; bool mUseStyleSheet; }; From e2e1a431ffafcb3a4ec1aef10d56537af63074ba Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 19 Jul 2025 23:17:29 +0200 Subject: [PATCH 017/147] Added Qt dependent macro for QString::SkipEmptyParts/Qt::SkipEmptyParts --- retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp | 4 ++-- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 2 +- .../src/gui/Posted/PostedListWidgetWithModel.cpp | 3 ++- retroshare-gui/src/gui/advsearch/expressionwidget.cpp | 7 ++----- retroshare-gui/src/gui/common/NewFriendList.cpp | 2 +- .../gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 3 ++- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 2 +- retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 4 ++-- retroshare-gui/src/util/HandleRichText.cpp | 3 ++- retroshare-gui/src/util/QtVersion.h | 8 +++++++- 11 files changed, 23 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index c5b7ba04d..0af441dd5 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -898,7 +898,7 @@ void SearchDialog::searchKeywords(const QString& keywords) if (keywords.length() < 3) return ; - QStringList qWords = keywords.split(" ", QString::SkipEmptyParts); + QStringList qWords = keywords.split(" ", QtSkipEmptyParts); std::list words; QStringListIterator qWordsIter(qWords); while (qWordsIter.hasNext()) @@ -1236,7 +1236,7 @@ void SearchDialog::insertFile(qulonglong searchId, const FileDetail& file, int s int friendSource = 0; int anonymousSource = 0; QString resultCount = it->text(SR_SOURCES_COL); - QStringList modifiedResultCount = resultCount.split("/", QString::SkipEmptyParts); + QStringList modifiedResultCount = resultCount.split("/", QtSkipEmptyParts); if(searchType == FRIEND_SEARCH) { friendSource = modifiedResultCount.at(0).toInt() + 1; diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 8978ccf71..2a8a6b58f 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -1619,7 +1619,7 @@ void SharedFilesDialog::FilterItems() return ; //FileSearchFlags flags = isRemote()?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL; - QStringList lst = text.split(" ",QString::SkipEmptyParts) ; + QStringList lst = text.split(" ",QtSkipEmptyParts) ; std::list keywords ; for(auto it(lst.begin());it!=lst.end();++it) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 9245706d1..ebc0aca2b 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -45,6 +45,7 @@ #include "util/DateTime.h" #include "util/qtthreadsutils.h" #include "gui/common/FilesDefs.h" +#include "util/QtVersion.h" #include "gui/MainWindow.h" @@ -417,7 +418,7 @@ void PostedListWidgetWithModel::updateShowLabel() void PostedListWidgetWithModel::filterItems(QString text) { - QStringList lst = text.split(" ",QString::SkipEmptyParts) ; + QStringList lst = text.split(" ",QtSkipEmptyParts) ; uint32_t count; mPostedPostsModel->setFilter(lst,count) ; diff --git a/retroshare-gui/src/gui/advsearch/expressionwidget.cpp b/retroshare-gui/src/gui/advsearch/expressionwidget.cpp index f6b150065..9387f951e 100644 --- a/retroshare-gui/src/gui/advsearch/expressionwidget.cpp +++ b/retroshare-gui/src/gui/advsearch/expressionwidget.cpp @@ -20,6 +20,7 @@ * * *******************************************************************************/ #include "expressionwidget.h" +#include "util/QtVersion.h" ExpressionWidget::ExpressionWidget(QWidget * parent, bool initial) : QWidget(parent) @@ -109,11 +110,7 @@ RsRegularExpression::Expression* ExpressionWidget::getRsExpression() if (isStringSearchExpression()) { QString txt = exprParamElem->getStrSearchValue(); -#if QT_VERSION < QT_VERSION_CHECK(5,15,0) - QStringList words = txt.split(" ", QString::SkipEmptyParts); -#else - QStringList words = txt.split(" ", Qt::SkipEmptyParts); -#endif + QStringList words = txt.split(" ", QtSkipEmptyParts); for (int i = 0; i < words.size(); ++i) wordList.push_back(words.at(i).toUtf8().constData()); } else if (inRangedConfig){ diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 38e141e86..4ed25d951 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -1673,7 +1673,7 @@ void NewFriendList::setShowGroups(bool show) */ void NewFriendList::filterItems(const QString &text) { - QStringList lst = text.split(' ',QString::SkipEmptyParts); + QStringList lst = text.split(' ',QtSkipEmptyParts); int filterColumn = ui->filterLineEdit->currentFilter(); if(filterColumn == 0) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 18aa2ad17..c041e4369 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -41,6 +41,7 @@ #include "util/DateTime.h" #include "util/qtthreadsutils.h" #include "gui/common/FilesDefs.h" +#include "util/QtVersion.h" #include "GxsChannelPostsWidgetWithModel.h" #include "GxsChannelPostsModel.h" @@ -1454,7 +1455,7 @@ void GxsChannelPostsWidgetWithModel::switchOnlyUnread(bool) } void GxsChannelPostsWidgetWithModel::filterChanged(QString s) { - QStringList ql = s.split(' ',QString::SkipEmptyParts); + QStringList ql = s.split(' ',QtSkipEmptyParts); uint32_t count; mChannelPostsModel->setFilter(ql,ui->showUnread_TB->isChecked(),count); mChannelFilesModel->setFilter(ql,count); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index fd293560f..6c87e8a04 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -1846,7 +1846,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column) void GxsForumThreadWidget::filterItems(const QString& text) { - QStringList lst = text.split(" ",QString::SkipEmptyParts) ; + QStringList lst = text.split(" ",QtSkipEmptyParts) ; int filterColumn = ui->filterLineEdit->currentFilter(); diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 0d2e934f2..f4be23597 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -640,7 +640,7 @@ void MessageWidget::fill(const std::string &msgId) ui.trans_ToText->setText(to_text); - int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QString::SkipEmptyParts).count(); + int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count(); ui.expandButton->setText( QString::number(recipientsCount)+ " " + tr("more")); if (recipientsCount >=20) { diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 7cddc1b7d..78493e5a7 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -1246,7 +1246,7 @@ void MessagesDialog::undeletemessage() void MessagesDialog::filterChanged(const QString& text) { - QStringList items = text.split(' ',QString::SkipEmptyParts); + QStringList items = text.split(' ',QtSkipEmptyParts); RsMessageModel::FilterType f = RsMessageModel::FILTER_TYPE_NONE; @@ -1287,7 +1287,7 @@ void MessagesDialog::filterColumnChanged(int column) default:break; } - QStringList items = ui.filterLineEdit->text().split(' ',QString::SkipEmptyParts); + QStringList items = ui.filterLineEdit->text().split(' ',QtSkipEmptyParts); mMessageModel->setFilter(f,items); mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 6f6eec750..7ad0c15e8 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -31,6 +31,7 @@ #include "gui/RetroShareLink.h" #include "util/ObjectPainter.h" #include "util/imageutil.h" +#include "util/QtVersion.h" #include "util/rsdebug.h" #include "util/rstime.h" @@ -1252,7 +1253,7 @@ QString RsHtml::makeQuotedText(RSTextBrowser *browser) { text = browser->toPlainText(); } - QStringList sl = text.split(QRegExp("[\r\n]"),QString::SkipEmptyParts); + QStringList sl = text.split(QRegExp("[\r\n]"),QtSkipEmptyParts); text = sl.join("\n> "); text.replace("\n> >","\n>>"); // Don't add space for already quotted lines. text.replace(QChar(-4)," ");//Char used when image on text. diff --git a/retroshare-gui/src/util/QtVersion.h b/retroshare-gui/src/util/QtVersion.h index d04d226ae..f5e8e9784 100644 --- a/retroshare-gui/src/util/QtVersion.h +++ b/retroshare-gui/src/util/QtVersion.h @@ -21,7 +21,7 @@ #ifndef QTVERSION_H #define QTVERSION_H -// Macros to compile with Qt 4 and Qt 5 +// Macros to compile with Qt 4, Qt 5 and Qt 6 // Renamed QHeaderView::setResizeMode to QHeaderView::setSectionResizeMode #if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) @@ -43,4 +43,10 @@ #define QHeaderView_setSectionsMovable(header, movable) header->setMovable(movable); #endif +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#define QtSkipEmptyParts Qt::SkipEmptyParts +#else +#define QtSkipEmptyParts QString::SkipEmptyParts +#endif + #endif From a2eb40740f2d4aa61f426c700efeaacafde62871 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 20 Jul 2025 13:11:23 +0200 Subject: [PATCH 018/147] Added Install Guide for qtcreator native build --- .../Windows/Windows-QtCreator-InstallGuide.md | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 build_scripts/Windows/Windows-QtCreator-InstallGuide.md diff --git a/build_scripts/Windows/Windows-QtCreator-InstallGuide.md b/build_scripts/Windows/Windows-QtCreator-InstallGuide.md new file mode 100644 index 000000000..5d2ca1aa9 --- /dev/null +++ b/build_scripts/Windows/Windows-QtCreator-InstallGuide.md @@ -0,0 +1,35 @@ +## Build Retroshare with QtCreator & Qt 6.9 on Windows + +### Qt 6.9 Installation + +Download Qt 6.9 from: https://www.qt.io/download-dev + +Run the installer and install Qt 6.9 + +Add GCC.exe to Path + + C:\Qt\Tools\mingw1310_64\bin + +Compile the external libs start build-libs.bat: + +Open Qt Command Prompt: + + cd C:\Users\User\Documents\GitHub\RetroShare\build_scripts\Windows\build-libs + +Type (this will take some time to build all libs): + + build-libs.bat + +Open Qt Creator + + Open project -> RetroShare.pro + +After Project loaded, go to: + + Projects->Build->Build Steps->Additional arguments: + +Add EXTERNAL_LIB_DIR: + + "EXTERNAL_LIB_DIR=%{sourceDir}\..\RetroShare-env\build-libs\gcc-13.1.0\x64\libs" + +After done, Build Project \ No newline at end of file From 3a8f7d5a2d3f77e2e348f5363eb12b985cf75852 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 17:20:03 +0200 Subject: [PATCH 019/147] Use "Qt::WindowFlags flags = Qt::WindowFlags()" instead of "Qt::WindowFlags flags = 0" --- plugins/FeedReader/gui/FeedReaderConfig.h | 2 +- retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h | 2 +- retroshare-gui/src/gui/MessengerWindow.h | 2 +- retroshare-gui/src/gui/chat/ChatDialog.h | 2 +- retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 2 +- retroshare-gui/src/gui/chat/PopupChatDialog.h | 2 +- retroshare-gui/src/gui/chat/PopupChatWindow.h | 2 +- retroshare-gui/src/gui/chat/PopupDistantChatDialog.h | 2 +- retroshare-gui/src/gui/common/rwindow.h | 2 +- retroshare-gui/src/gui/connect/ConnectProgressDialog.h | 2 +- retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h | 2 +- retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h | 2 +- retroshare-gui/src/gui/msgs/MessageComposer.h | 2 +- retroshare-gui/src/gui/msgs/MessageWidget.h | 2 +- retroshare-gui/src/gui/msgs/MessageWindow.h | 2 +- retroshare-gui/src/gui/profile/ProfileWidget.h | 2 +- retroshare-gui/src/gui/settings/AboutPage.h | 2 +- retroshare-gui/src/gui/settings/AppearancePage.h | 2 +- retroshare-gui/src/gui/settings/ChannelPage.h | 2 +- retroshare-gui/src/gui/settings/CryptoPage.h | 2 +- retroshare-gui/src/gui/settings/FileAssociationsPage.h | 2 +- retroshare-gui/src/gui/settings/ForumPage.h | 2 +- retroshare-gui/src/gui/settings/GeneralPage.h | 2 +- retroshare-gui/src/gui/settings/JsonApiPage.h | 2 +- retroshare-gui/src/gui/settings/MessagePage.h | 2 +- retroshare-gui/src/gui/settings/NewTag.h | 2 +- retroshare-gui/src/gui/settings/NotifyPage.h | 2 +- retroshare-gui/src/gui/settings/PeoplePage.h | 2 +- retroshare-gui/src/gui/settings/PluginsPage.h | 2 +- retroshare-gui/src/gui/settings/PostedPage.h | 2 +- retroshare-gui/src/gui/settings/ServerPage.h | 2 +- retroshare-gui/src/gui/settings/ServicePermissionsPage.h | 2 +- retroshare-gui/src/gui/settings/SoundPage.h | 2 +- retroshare-gui/src/gui/settings/TransferPage.h | 2 +- retroshare-gui/src/gui/settings/WebuiPage.h | 2 +- retroshare-gui/src/gui/statistics/BandwidthGraphWindow.h | 2 +- retroshare-gui/src/gui/unfinished/ApplicationWindow.h | 2 +- retroshare-gui/src/retroshare-gui/RsAutoUpdatePage.h | 2 +- retroshare-gui/src/retroshare-gui/configpage.h | 2 +- 39 files changed, 39 insertions(+), 39 deletions(-) diff --git a/plugins/FeedReader/gui/FeedReaderConfig.h b/plugins/FeedReader/gui/FeedReaderConfig.h index af31fe33f..6339b6ce6 100644 --- a/plugins/FeedReader/gui/FeedReaderConfig.h +++ b/plugins/FeedReader/gui/FeedReaderConfig.h @@ -36,7 +36,7 @@ class FeedReaderConfig : public ConfigPage public: /** Default Constructor */ - FeedReaderConfig(QWidget *parent = 0, Qt::WindowFlags flags = 0); + FeedReaderConfig(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ virtual ~FeedReaderConfig(); diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h index fdf45f2ff..f8fa739a8 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.h @@ -36,7 +36,7 @@ class FileTransferInfoWidget : public RsAutoUpdatePage Q_OBJECT public: - FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = 0 ); + FileTransferInfoWidget(QWidget * parent = 0, Qt::WindowFlags f = Qt::WindowFlags() ); void setFileHash(const RsFileHash& hash) { _file_hash = hash ; } diff --git a/retroshare-gui/src/gui/MessengerWindow.h b/retroshare-gui/src/gui/MessengerWindow.h index d683ec744..ecfc43b20 100644 --- a/retroshare-gui/src/gui/MessengerWindow.h +++ b/retroshare-gui/src/gui/MessengerWindow.h @@ -39,7 +39,7 @@ public slots: protected: /** Default Constructor */ - MessengerWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0); + MessengerWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~MessengerWindow(); diff --git a/retroshare-gui/src/gui/chat/ChatDialog.h b/retroshare-gui/src/gui/chat/ChatDialog.h index 7bfbc16ec..e4656ab33 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.h +++ b/retroshare-gui/src/gui/chat/ChatDialog.h @@ -75,7 +75,7 @@ private slots: void chatNewMessage(ChatWidget*); protected: - explicit ChatDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0); + explicit ChatDialog(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~ChatDialog(); void closeEvent(QCloseEvent *event); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index c3572cc4b..7039f6c13 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -74,7 +74,7 @@ signals: protected: /** Default constructor */ - ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent = 0, Qt::WindowFlags flags = 0); + ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ virtual ~ChatLobbyDialog(); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.h b/retroshare-gui/src/gui/chat/PopupChatDialog.h index 91fa17091..a88df7a2f 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.h @@ -42,7 +42,7 @@ private slots: protected: /** Default constructor */ - PopupChatDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0); + PopupChatDialog(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ virtual ~PopupChatDialog(); diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.h b/retroshare-gui/src/gui/chat/PopupChatWindow.h index 968531ea1..4deb77bfb 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.h +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.h @@ -49,7 +49,7 @@ public: protected: /** Default constructor */ - PopupChatWindow(bool tabbed, QWidget *parent = 0, Qt::WindowFlags flags = 0); + PopupChatWindow(bool tabbed, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ ~PopupChatWindow(); diff --git a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h index 15a83232f..b9f57ab25 100644 --- a/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h +++ b/retroshare-gui/src/gui/chat/PopupDistantChatDialog.h @@ -34,7 +34,7 @@ class PopupDistantChatDialog: public PopupChatDialog protected: /** Default constructor */ - PopupDistantChatDialog(const DistantChatPeerId &tunnel_id, QWidget *parent = 0, Qt::WindowFlags flags = 0); + PopupDistantChatDialog(const DistantChatPeerId &tunnel_id, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default destructor */ virtual ~PopupDistantChatDialog(); diff --git a/retroshare-gui/src/gui/common/rwindow.h b/retroshare-gui/src/gui/common/rwindow.h index 55441e45f..31ff68c21 100644 --- a/retroshare-gui/src/gui/common/rwindow.h +++ b/retroshare-gui/src/gui/common/rwindow.h @@ -35,7 +35,7 @@ class RWindow : public QMainWindow public: /** Default constructor. */ - RWindow(QString name, QWidget *parent = 0, Qt::WindowFlags flags = 0); + RWindow(QString name, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Destructor. */ ~RWindow(); diff --git a/retroshare-gui/src/gui/connect/ConnectProgressDialog.h b/retroshare-gui/src/gui/connect/ConnectProgressDialog.h index 61951474c..cd05b0135 100644 --- a/retroshare-gui/src/gui/connect/ConnectProgressDialog.h +++ b/retroshare-gui/src/gui/connect/ConnectProgressDialog.h @@ -36,7 +36,7 @@ public: static void showProgress(const RsPeerId& id); private: - ConnectProgressDialog(const RsPeerId& id, QWidget *parent = 0, Qt::WindowFlags flags = 0); + ConnectProgressDialog(const RsPeerId& id, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~ConnectProgressDialog(); static ConnectProgressDialog *instance(const RsPeerId& peer_id); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h index 2a983bf8d..4a97167ed 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastPage.h @@ -40,7 +40,7 @@ class RsGxsUpdateBroadcastPage : public MainPage Q_OBJECT public: - RsGxsUpdateBroadcastPage(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = 0); + RsGxsUpdateBroadcastPage(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~RsGxsUpdateBroadcastPage(); void fillComplete(); diff --git a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h index 016c58214..71ac4b75b 100644 --- a/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h +++ b/retroshare-gui/src/gui/gxs/RsGxsUpdateBroadcastWidget.h @@ -40,7 +40,7 @@ class RsGxsUpdateBroadcastWidget : public QWidget Q_OBJECT public: - RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = 0); + RsGxsUpdateBroadcastWidget(RsGxsIfaceHelper* ifaceImpl, QWidget *parent = NULL, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~RsGxsUpdateBroadcastWidget(); void fillComplete(); diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.h b/retroshare-gui/src/gui/msgs/MessageComposer.h index 27bf28458..c36b08642 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.h +++ b/retroshare-gui/src/gui/msgs/MessageComposer.h @@ -52,7 +52,7 @@ public: public: /** Default Constructor */ - MessageComposer(QWidget *parent = 0, Qt::WindowFlags flags = 0); + MessageComposer(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~MessageComposer(); static void msgFriend(const RsPeerId &id); diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.h b/retroshare-gui/src/gui/msgs/MessageWidget.h index 53b043720..566cee2c7 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.h +++ b/retroshare-gui/src/gui/msgs/MessageWidget.h @@ -45,7 +45,7 @@ public: }; public: - MessageWidget(bool controlled, QWidget *parent = 0, Qt::WindowFlags flags = 0); + MessageWidget(bool controlled, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~MessageWidget(); static MessageWidget *openMsg(const std::string &msgId, bool window); diff --git a/retroshare-gui/src/gui/msgs/MessageWindow.h b/retroshare-gui/src/gui/msgs/MessageWindow.h index c12b8ca3d..9f744ea8b 100644 --- a/retroshare-gui/src/gui/msgs/MessageWindow.h +++ b/retroshare-gui/src/gui/msgs/MessageWindow.h @@ -33,7 +33,7 @@ class MessageWindow : public RWindow public: /** Default Constructor */ - MessageWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0); + MessageWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~MessageWindow(); void addWidget(MessageWidget *widget); diff --git a/retroshare-gui/src/gui/profile/ProfileWidget.h b/retroshare-gui/src/gui/profile/ProfileWidget.h index 9c97fdbec..3b6eee327 100644 --- a/retroshare-gui/src/gui/profile/ProfileWidget.h +++ b/retroshare-gui/src/gui/profile/ProfileWidget.h @@ -32,7 +32,7 @@ class ProfileWidget : public QWidget public: /** Default constructor */ - ProfileWidget(QWidget *parent = 0, Qt::WindowFlags flags = 0); + ProfileWidget(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); private slots: void showEvent ( QShowEvent * event ); diff --git a/retroshare-gui/src/gui/settings/AboutPage.h b/retroshare-gui/src/gui/settings/AboutPage.h index 4881ca730..39b2da6ed 100644 --- a/retroshare-gui/src/gui/settings/AboutPage.h +++ b/retroshare-gui/src/gui/settings/AboutPage.h @@ -32,7 +32,7 @@ class AboutPage : public ConfigPage public: /** Default Constructor */ - AboutPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + AboutPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~AboutPage(); diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h index 741bd752e..7a458139d 100755 --- a/retroshare-gui/src/gui/settings/AppearancePage.h +++ b/retroshare-gui/src/gui/settings/AppearancePage.h @@ -32,7 +32,7 @@ class AppearancePage : public ConfigPage public: /** Default Constructor */ - AppearancePage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + AppearancePage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Loads the settings for this page */ virtual void load(); diff --git a/retroshare-gui/src/gui/settings/ChannelPage.h b/retroshare-gui/src/gui/settings/ChannelPage.h index adb573711..c89120a40 100644 --- a/retroshare-gui/src/gui/settings/ChannelPage.h +++ b/retroshare-gui/src/gui/settings/ChannelPage.h @@ -32,7 +32,7 @@ class ChannelPage : public ConfigPage Q_OBJECT public: - ChannelPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + ChannelPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~ChannelPage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/CryptoPage.h b/retroshare-gui/src/gui/settings/CryptoPage.h index e10cbb97a..f45e4b29a 100755 --- a/retroshare-gui/src/gui/settings/CryptoPage.h +++ b/retroshare-gui/src/gui/settings/CryptoPage.h @@ -31,7 +31,7 @@ class CryptoPage : public ConfigPage public: /** Default Constructor */ - CryptoPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + CryptoPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~CryptoPage(); diff --git a/retroshare-gui/src/gui/settings/FileAssociationsPage.h b/retroshare-gui/src/gui/settings/FileAssociationsPage.h index 721c29969..0bf79d705 100755 --- a/retroshare-gui/src/gui/settings/FileAssociationsPage.h +++ b/retroshare-gui/src/gui/settings/FileAssociationsPage.h @@ -49,7 +49,7 @@ class FileAssociationsPage : public ConfigPage Q_OBJECT public: - FileAssociationsPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + FileAssociationsPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~FileAssociationsPage(); virtual void load(); diff --git a/retroshare-gui/src/gui/settings/ForumPage.h b/retroshare-gui/src/gui/settings/ForumPage.h index 3827df0e4..0c8ed402f 100644 --- a/retroshare-gui/src/gui/settings/ForumPage.h +++ b/retroshare-gui/src/gui/settings/ForumPage.h @@ -30,7 +30,7 @@ class ForumPage : public ConfigPage Q_OBJECT public: - ForumPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + ForumPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~ForumPage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/GeneralPage.h b/retroshare-gui/src/gui/settings/GeneralPage.h index b36471cbe..a2413e748 100755 --- a/retroshare-gui/src/gui/settings/GeneralPage.h +++ b/retroshare-gui/src/gui/settings/GeneralPage.h @@ -32,7 +32,7 @@ class GeneralPage : public ConfigPage public: /** Default Constructor */ - GeneralPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + GeneralPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~GeneralPage(); diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.h b/retroshare-gui/src/gui/settings/JsonApiPage.h index ef28a4294..9d5755213 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.h +++ b/retroshare-gui/src/gui/settings/JsonApiPage.h @@ -32,7 +32,7 @@ class JsonApiPage : public ConfigPage public: - JsonApiPage(QWidget * parent = nullptr, Qt::WindowFlags flags = 0); + JsonApiPage(QWidget * parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags()); ~JsonApiPage() override ; virtual QPixmap iconPixmap() const override diff --git a/retroshare-gui/src/gui/settings/MessagePage.h b/retroshare-gui/src/gui/settings/MessagePage.h index c5b9f7544..e226a4387 100644 --- a/retroshare-gui/src/gui/settings/MessagePage.h +++ b/retroshare-gui/src/gui/settings/MessagePage.h @@ -34,7 +34,7 @@ class MessagePage : public ConfigPage Q_OBJECT public: - MessagePage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + MessagePage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~MessagePage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/NewTag.h b/retroshare-gui/src/gui/settings/NewTag.h index 00266d2ae..f4ebe5479 100644 --- a/retroshare-gui/src/gui/settings/NewTag.h +++ b/retroshare-gui/src/gui/settings/NewTag.h @@ -35,7 +35,7 @@ class NewTag : public QDialog public: /** Default constructor */ - NewTag(MsgTagType &Tags, uint32_t nId = 0, QWidget *parent = 0, Qt::WindowFlags flags = 0); + NewTag(MsgTagType &Tags, uint32_t nId = 0, QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); uint32_t m_nId; diff --git a/retroshare-gui/src/gui/settings/NotifyPage.h b/retroshare-gui/src/gui/settings/NotifyPage.h index 66bf99e1d..e1090c6c5 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.h +++ b/retroshare-gui/src/gui/settings/NotifyPage.h @@ -72,7 +72,7 @@ class NotifyPage : public ConfigPage public: /** Default Constructor */ - NotifyPage(QWidget *parent = 0, Qt::WindowFlags flags = 0); + NotifyPage(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~NotifyPage(); diff --git a/retroshare-gui/src/gui/settings/PeoplePage.h b/retroshare-gui/src/gui/settings/PeoplePage.h index ec0af7927..dc88568c2 100644 --- a/retroshare-gui/src/gui/settings/PeoplePage.h +++ b/retroshare-gui/src/gui/settings/PeoplePage.h @@ -30,7 +30,7 @@ class PeoplePage : public ConfigPage Q_OBJECT public: - PeoplePage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + PeoplePage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~PeoplePage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/PluginsPage.h b/retroshare-gui/src/gui/settings/PluginsPage.h index 00a63070a..1e46eb01a 100644 --- a/retroshare-gui/src/gui/settings/PluginsPage.h +++ b/retroshare-gui/src/gui/settings/PluginsPage.h @@ -31,7 +31,7 @@ class PluginsPage : public ConfigPage Q_OBJECT public: - PluginsPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + PluginsPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~PluginsPage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/PostedPage.h b/retroshare-gui/src/gui/settings/PostedPage.h index b3c31c6ba..800588b9b 100644 --- a/retroshare-gui/src/gui/settings/PostedPage.h +++ b/retroshare-gui/src/gui/settings/PostedPage.h @@ -33,7 +33,7 @@ class PostedPage : public ConfigPage Q_OBJECT public: - PostedPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + PostedPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~PostedPage(); /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/ServerPage.h b/retroshare-gui/src/gui/settings/ServerPage.h index 7d82f2190..a0028e1cb 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.h +++ b/retroshare-gui/src/gui/settings/ServerPage.h @@ -52,7 +52,7 @@ class ServerPage: public ConfigPage, public autoProxyCallback Q_OBJECT public: - ServerPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + ServerPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~ServerPage() {} /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/ServicePermissionsPage.h b/retroshare-gui/src/gui/settings/ServicePermissionsPage.h index 94c22f9b0..493090e7e 100644 --- a/retroshare-gui/src/gui/settings/ServicePermissionsPage.h +++ b/retroshare-gui/src/gui/settings/ServicePermissionsPage.h @@ -32,7 +32,7 @@ class ServicePermissionsPage: public ConfigPage Q_OBJECT public: - ServicePermissionsPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + ServicePermissionsPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~ServicePermissionsPage() {} /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/SoundPage.h b/retroshare-gui/src/gui/settings/SoundPage.h index d20426d83..66a6abab5 100644 --- a/retroshare-gui/src/gui/settings/SoundPage.h +++ b/retroshare-gui/src/gui/settings/SoundPage.h @@ -33,7 +33,7 @@ class SoundPage : public ConfigPage public: /** Default Constructor */ - SoundPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + SoundPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~SoundPage(); diff --git a/retroshare-gui/src/gui/settings/TransferPage.h b/retroshare-gui/src/gui/settings/TransferPage.h index 077d5a6ec..6e9413366 100644 --- a/retroshare-gui/src/gui/settings/TransferPage.h +++ b/retroshare-gui/src/gui/settings/TransferPage.h @@ -32,7 +32,7 @@ class TransferPage: public ConfigPage Q_OBJECT public: - TransferPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + TransferPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); ~TransferPage() {} /** Loads the settings for this page */ diff --git a/retroshare-gui/src/gui/settings/WebuiPage.h b/retroshare-gui/src/gui/settings/WebuiPage.h index 391612cf8..760b695b1 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.h +++ b/retroshare-gui/src/gui/settings/WebuiPage.h @@ -39,7 +39,7 @@ class WebuiPage : public ConfigPage public: /** Default Constructor */ - WebuiPage(QWidget * parent = 0, Qt::WindowFlags flags = 0); + WebuiPage(QWidget * parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Default Destructor */ ~WebuiPage(); diff --git a/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.h b/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.h index 276f7fa6a..5ec993f50 100644 --- a/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.h +++ b/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.h @@ -44,7 +44,7 @@ public: enum { DefaultDirection=0,Download=1 } ; /** Default constructor */ - BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = 0); + BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); virtual ~BandwidthGraph(); public slots: diff --git a/retroshare-gui/src/gui/unfinished/ApplicationWindow.h b/retroshare-gui/src/gui/unfinished/ApplicationWindow.h index 89631f1b3..58f03907b 100644 --- a/retroshare-gui/src/gui/unfinished/ApplicationWindow.h +++ b/retroshare-gui/src/gui/unfinished/ApplicationWindow.h @@ -32,7 +32,7 @@ class ApplicationWindow : public QMainWindow public: /** Default Constructor */ - ApplicationWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0); + ApplicationWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); /** Destructor. */ ~ApplicationWindow(); diff --git a/retroshare-gui/src/retroshare-gui/RsAutoUpdatePage.h b/retroshare-gui/src/retroshare-gui/RsAutoUpdatePage.h index a21e6c595..31e975696 100644 --- a/retroshare-gui/src/retroshare-gui/RsAutoUpdatePage.h +++ b/retroshare-gui/src/retroshare-gui/RsAutoUpdatePage.h @@ -37,7 +37,7 @@ class RsAutoUpdatePage: public MainPage Q_OBJECT public: - RsAutoUpdatePage(int ms_update_period = 1000, QWidget *parent = NULL, Qt::WindowFlags flags = 0) ; + RsAutoUpdatePage(int ms_update_period = 1000, QWidget *parent = NULL, Qt::WindowFlags flags = Qt::WindowFlags()) ; virtual ~RsAutoUpdatePage() ; static void lockAllEvents() ; diff --git a/retroshare-gui/src/retroshare-gui/configpage.h b/retroshare-gui/src/retroshare-gui/configpage.h index 6aa081055..d0d0625dc 100644 --- a/retroshare-gui/src/retroshare-gui/configpage.h +++ b/retroshare-gui/src/retroshare-gui/configpage.h @@ -29,7 +29,7 @@ class ConfigPage : public QWidget { public: /** Default Constructor */ - ConfigPage(QWidget *parent = 0, Qt::WindowFlags flags = 0) : QWidget(parent, flags), loaded(false) {} + ConfigPage(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()) : QWidget(parent, flags), loaded(false) {} /** Pure virtual method. Subclassed pages load their config settings here. */ virtual void load() = 0; From b93a31a33bdf1ccfa2b89753dce47debed53e1ad Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 03:23:54 +0200 Subject: [PATCH 020/147] Removed deprecated QDesktopWidget for Qt 6 --- retroshare-gui/src/gui/StartDialog.cpp | 3 +-- retroshare-gui/src/gui/common/Emoticons.cpp | 6 ++--- .../src/gui/common/GroupTreeWidget.cpp | 9 +++++--- .../src/gui/common/RSGraphWidget.cpp | 4 ++-- retroshare-gui/src/gui/common/RSGraphWidget.h | 1 - retroshare-gui/src/gui/common/rwindow.cpp | 1 - .../src/gui/gxsforums/CreateGxsForumMsg.cpp | 1 - retroshare-gui/src/gui/notifyqt.cpp | 5 ++-- .../gui/settings/RSPermissionMatrixWidget.h | 1 - retroshare-gui/src/idle/idle_platform.cpp | 2 ++ retroshare-gui/src/rshare.cpp | 23 +++++++++++++++++++ retroshare-gui/src/rshare.h | 5 ++++ 12 files changed, 44 insertions(+), 17 deletions(-) diff --git a/retroshare-gui/src/gui/StartDialog.cpp b/retroshare-gui/src/gui/StartDialog.cpp index 237d1bb83..e53af6455 100644 --- a/retroshare-gui/src/gui/StartDialog.cpp +++ b/retroshare-gui/src/gui/StartDialog.cpp @@ -29,7 +29,6 @@ #include #include -#include #include @@ -49,7 +48,7 @@ StartDialog::StartDialog(QWidget *parent) Settings->loadWidgetInformation(this); /* Put the Login dialog in the screen center */ - const QRect screen = QApplication::desktop()->screenGeometry(); + const QRect screen = RsApplication::primaryScreenGeometry(); this->move( screen.center() - this->rect().center() ); /* get all available pgp private certificates.... diff --git a/retroshare-gui/src/gui/common/Emoticons.cpp b/retroshare-gui/src/gui/common/Emoticons.cpp index 2341039cd..423149164 100644 --- a/retroshare-gui/src/gui/common/Emoticons.cpp +++ b/retroshare-gui/src/gui/common/Emoticons.cpp @@ -19,7 +19,6 @@ *******************************************************************************/ #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include +#include "rshare.h" #include "Emoticons.h" #include "util/HandleRichText.h" #include "retroshare/rsinit.h" @@ -261,7 +261,7 @@ void Emoticons::showSmileyWidget(QWidget *parent, QWidget *button, const char *s //Get widget's size QSize sizeWidget = smWidget->sizeHint(); //Get screen's size - QSize sizeScreen = QApplication::desktop()->size(); + QSize sizeScreen = RsApplication::primaryScreenGeometry().size(); //Calculate left distance to screen start int distToScreenLeft = butTopLeft.x(); @@ -437,7 +437,7 @@ void Emoticons::showStickerWidget(QWidget *parent, QWidget *button, const char * //Get widget's size QSize sizeWidget = smWidget->sizeHint(); //Get screen's size - QSize sizeScreen = QApplication::desktop()->size(); + QSize sizeScreen = RsApplication::primaryScreenGeometry().size(); //Calculate left distance to screen start int distToScreenLeft = butTopLeft.x(); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 43861c4c6..fc42150c7 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -31,9 +31,9 @@ #include "util/QtVersion.h" #include "util/DateTime.h" -#include #include #include +#include #include @@ -192,8 +192,11 @@ void GroupTreeWidget::addToolButton(QToolButton *toolButton) /* Initialize button */ int i = qt_defaultDpi(); - auto desktopWidget = QApplication::desktop(); - auto y = desktopWidget->logicalDpiY(); + QScreen *primaryScreen = QGuiApplication::primaryScreen(); + int y = i; + if (primaryScreen) { + y = primaryScreen->logicalDotsPerInchY(); + } toolButton->setAutoRaise(true); toolButton->setIconSize(QSize(24*y/i,24*y/i)); diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index dab0645c4..c2a4a4581 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -33,6 +33,7 @@ #include #include +#include "rshare.h" #include "RSGraphWidget.h" #if QT_VERSION < 0x040700 @@ -314,8 +315,7 @@ void RSGraphWidget::setFiltering(bool b) int RSGraphWidget::getNumPoints() { - QDesktopWidget *desktop = QApplication::desktop(); - int width = desktop->width(); + int width = RsApplication::primaryScreenGeometry().width(); return width; } diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.h b/retroshare-gui/src/gui/common/RSGraphWidget.h index e08a45eb9..6a5c35901 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.h +++ b/retroshare-gui/src/gui/common/RSGraphWidget.h @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/retroshare-gui/src/gui/common/rwindow.cpp b/retroshare-gui/src/gui/common/rwindow.cpp index 31fe12d9e..5d819c9cc 100644 --- a/retroshare-gui/src/gui/common/rwindow.cpp +++ b/retroshare-gui/src/gui/common/rwindow.cpp @@ -24,7 +24,6 @@ #include #include #include -#include #include #include "rwindow.h" diff --git a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp index 3224b428f..e7a3a3146 100644 --- a/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp +++ b/retroshare-gui/src/gui/gxsforums/CreateGxsForumMsg.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include diff --git a/retroshare-gui/src/gui/notifyqt.cpp b/retroshare-gui/src/gui/notifyqt.cpp index d2dee5ac4..fb19e8e24 100644 --- a/retroshare-gui/src/gui/notifyqt.cpp +++ b/retroshare-gui/src/gui/notifyqt.cpp @@ -29,6 +29,7 @@ #include +#include "rshare.h" #include "MainWindow.h" #include "toaster/OnlineToaster.h" #include "toaster/MessageToaster.h" @@ -49,7 +50,6 @@ #include "retroshare/rsplugin.h" -#include #include #include //#include @@ -1040,8 +1040,7 @@ void NotifyQt::startWaitingToasters() /* Calculate positions */ QSize size = toaster->widget->size(); - QDesktopWidget *desktop = QApplication::desktop(); - QRect desktopGeometry = desktop->availableGeometry(desktop->primaryScreen()); + QRect desktopGeometry = RsApplication::primaryScreenGeometry(); switch (toaster->position) { case RshareSettings::TOASTERPOS_TOPLEFT: diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h index ffc9a32b0..12701cfc3 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.h @@ -24,7 +24,6 @@ #include #include -#include #include #include diff --git a/retroshare-gui/src/idle/idle_platform.cpp b/retroshare-gui/src/idle/idle_platform.cpp index ddae72f17..71928dc59 100644 --- a/retroshare-gui/src/idle/idle_platform.cpp +++ b/retroshare-gui/src/idle/idle_platform.cpp @@ -24,7 +24,9 @@ #ifdef HAVE_XSS #include +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) #include +#endif #include #include diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index d867f1545..1cb0b5766 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef __APPLE__ #include #endif @@ -676,3 +677,25 @@ bool RsApplication::updateLocalServer() } return false; } + +/** Get available geometry of primary screen */ +QRect RsApplication::availablePrimaryScreenGeometry() +{ + QScreen *primaryScreen = QGuiApplication::primaryScreen(); + if (!primaryScreen) { + return QRect(0, 0, 0, 0); + } + + return primaryScreen->availableGeometry(); +} + +/** Get geometry of primary screen */ +QRect RsApplication::primaryScreenGeometry() +{ + QScreen *primaryScreen = QGuiApplication::primaryScreen(); + if (!primaryScreen) { + return QRect(0, 0, 0, 0); + } + + return primaryScreen->geometry(); +} diff --git a/retroshare-gui/src/rshare.h b/retroshare-gui/src/rshare.h index be6af336c..ff079b1e8 100644 --- a/retroshare-gui/src/rshare.h +++ b/retroshare-gui/src/rshare.h @@ -154,6 +154,11 @@ public: static void createShortcut(const QKeySequence &key, QWidget *sender, QWidget *receiver, const char *slot); + /** Get available geometry of primary screen */ + static QRect availablePrimaryScreenGeometry(); + /** Get geometry of primary screen */ + static QRect primaryScreenGeometry(); + #ifdef __APPLE__ /**To process event from Mac system */ bool event(QEvent *); From a00c1375e5b5a6d04cf5cf5d7ae3bfdf11ce33f6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 18:04:23 +0200 Subject: [PATCH 021/147] Renamed QtVersion.h to RsQtVersion.h because of the same filename in Qt 6 --- plugins/FeedReader/gui/FeedReaderMessageWidget.cpp | 2 +- retroshare-gui/src/CMakeLists.txt | 2 +- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp | 2 +- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- retroshare-gui/src/gui/NetworkDialog.cpp | 2 +- retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp | 2 +- retroshare-gui/src/gui/QuickStartWizard.cpp | 2 +- retroshare-gui/src/gui/ShareManager.cpp | 2 +- retroshare-gui/src/gui/advsearch/expressionwidget.cpp | 2 +- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 2 +- retroshare-gui/src/gui/common/FriendList.cpp | 2 +- retroshare-gui/src/gui/common/GroupTreeWidget.cpp | 2 +- retroshare-gui/src/gui/common/NewFriendList.cpp | 2 +- .../src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 2 +- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageComposer.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 2 +- retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 2 +- retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp | 2 +- retroshare-gui/src/gui/statistics/DhtWindow.cpp | 2 +- retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp | 2 +- retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp | 2 +- retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp | 2 +- retroshare-gui/src/gui/unfinished/ExampleDialog.cpp | 2 +- retroshare-gui/src/retroshare-gui.pro | 2 +- retroshare-gui/src/util/HandleRichText.cpp | 2 +- retroshare-gui/src/util/{QtVersion.h => RsQtVersion.h} | 4 ++-- 30 files changed, 31 insertions(+), 31 deletions(-) rename retroshare-gui/src/util/{QtVersion.h => RsQtVersion.h} (96%) diff --git a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp index ec0e3d0e2..9eed772b3 100644 --- a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp +++ b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp @@ -36,7 +36,7 @@ #include "gui/common/RSTreeWidgetItem.h" #include "gui/settings/rsharesettings.h" #include "util/HandleRichText.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "gui/Posted/PostedCreatePostDialog.h" #include "gui/gxsforums/CreateGxsForumMsg.h" #include "gui/common/FilesDefs.h" diff --git a/retroshare-gui/src/CMakeLists.txt b/retroshare-gui/src/CMakeLists.txt index b936552ed..dc70d7c09 100644 --- a/retroshare-gui/src/CMakeLists.txt +++ b/retroshare-gui/src/CMakeLists.txt @@ -512,7 +512,7 @@ list( src/util/misc.h src/util/HandleRichText.h src/util/ObjectPainter.h - src/util/QtVersion.h + src/util/RsQtVersion.h src/util/RsFile.h src/util/qtthreadsutils.h src/util/ClickableLabel.h diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 60ed255a8..250d81065 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -35,7 +35,7 @@ #include "settings/rsharesettings.h" #include "util/HandleRichText.h" #include "util/misc.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "retroshare/rsmsgs.h" #include "retroshare/rspeers.h" diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index 0af441dd5..aa7125764 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -36,7 +36,7 @@ #include "gui/settings/rsharesettings.h" #include "gui/advsearch/advancedsearchdialog.h" #include "gui/common/RSTreeWidgetItem.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/qtthreadsutils.h" #include "util/misc.h" diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 2a8a6b58f..49b65cc64 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -33,7 +33,7 @@ #include "gui/gxsforums/GxsForumsDialog.h" #include "gui/settings/AddFileAssociationDialog.h" #include "gui/settings/rsharesettings.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/RsAction.h" #include "util/misc.h" #include "util/rstime.h" diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index 3ee120162..c7a8310e1 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -37,7 +37,7 @@ #include "gui/FileTransfer/xprogressbar.h" #include "gui/settings/rsharesettings.h" #include "util/misc.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/RsFile.h" #include "util/qtthreadsutils.h" diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index a2d588d3e..c9c2cdf18 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -47,7 +47,7 @@ #include "util/qtthreadsutils.h" #include "retroshare-gui/RsAutoUpdatePage.h" #include "util/misc.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/rstime.h" #include "util/rsdebug.h" diff --git a/retroshare-gui/src/gui/NetworkDialog.cpp b/retroshare-gui/src/gui/NetworkDialog.cpp index 7c2b3fd14..e0e7f2494 100644 --- a/retroshare-gui/src/gui/NetworkDialog.cpp +++ b/retroshare-gui/src/gui/NetworkDialog.cpp @@ -42,7 +42,7 @@ #include "connect/PGPKeyDialog.h" #include "settings/rsharesettings.h" #include "RetroShareLink.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index ebc0aca2b..37142f38e 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -45,7 +45,7 @@ #include "util/DateTime.h" #include "util/qtthreadsutils.h" #include "gui/common/FilesDefs.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "gui/MainWindow.h" diff --git a/retroshare-gui/src/gui/QuickStartWizard.cpp b/retroshare-gui/src/gui/QuickStartWizard.cpp index ce953a32e..1b74bbb34 100644 --- a/retroshare-gui/src/gui/QuickStartWizard.cpp +++ b/retroshare-gui/src/gui/QuickStartWizard.cpp @@ -25,7 +25,7 @@ #include "gui/common/RSComboBox.h" #endif #include "settings/rsharesettings.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "retroshare/rsfiles.h" #include "retroshare/rsconfig.h" diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 6681e30c5..1e00d043e 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -36,7 +36,7 @@ #include "gui/common/GroupSelectionBox.h" #include "gui/common/GroupDefs.h" #include "gui/notifyqt.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/misc.h" #include "gui/common/FilesDefs.h" diff --git a/retroshare-gui/src/gui/advsearch/expressionwidget.cpp b/retroshare-gui/src/gui/advsearch/expressionwidget.cpp index 9387f951e..8127ff93d 100644 --- a/retroshare-gui/src/gui/advsearch/expressionwidget.cpp +++ b/retroshare-gui/src/gui/advsearch/expressionwidget.cpp @@ -20,7 +20,7 @@ * * *******************************************************************************/ #include "expressionwidget.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" ExpressionWidget::ExpressionWidget(QWidget * parent, bool initial) : QWidget(parent) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index fbc35d2cf..3ce3fe684 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -43,7 +43,7 @@ #include "gui/settings/RsharePeerSettings.h" #include "gui/settings/rsharesettings.h" #include "util/HandleRichText.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "retroshare/rsnotify.h" #include "util/rstime.h" diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index dd2d17875..68c21aaed 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -51,7 +51,7 @@ #include "StatusDefs.h" #include "util/misc.h" #include "vmessagebox.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "gui/chat/ChatUserNotify.h" #include "gui/connect/ConnectProgressDialog.h" #include "gui/common/ElidedLabel.h" diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index fc42150c7..d0ff883a7 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -28,7 +28,7 @@ #include "RSElidedItemDelegate.h" #include "RSTreeWidgetItem.h" #include "gui/settings/rsharesettings.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/DateTime.h" #include diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 4ed25d951..66e692375 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -50,7 +50,7 @@ #include "util/misc.h" #include "util/qtthreadsutils.h" #include "vmessagebox.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "gui/chat/ChatUserNotify.h" #include "gui/connect/ConnectProgressDialog.h" #include "gui/common/ElidedLabel.h" diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index c041e4369..56f7568a5 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -41,7 +41,7 @@ #include "util/DateTime.h" #include "util/qtthreadsutils.h" #include "gui/common/FilesDefs.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "GxsChannelPostsWidgetWithModel.h" #include "GxsChannelPostsModel.h" diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 6c87e8a04..9a8a927d9 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -44,7 +44,7 @@ #include "gui/msgs/MessageComposer.h" #include "util/DateTime.h" #include "gui/common/UIStateHelper.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/imageutil.h" #include diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index 47da8e913..f30ced70a 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -66,7 +66,7 @@ #include "util/misc.h" #include "util/DateTime.h" #include "util/HandleRichText.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "textformat.h" #include "TagsMenu.h" diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index f4be23597..6e1a3d39b 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -45,7 +45,7 @@ #include "util/printpreview.h" #include "util/HandleRichText.h" #include "util/DateTime.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/qtthreadsutils.h" #include diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 78493e5a7..d6f82417a 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -45,7 +45,7 @@ #include "util/DateTime.h" #include "util/misc.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/qtthreadsutils.h" #include "util/RsProtectedTimer.h" diff --git a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp index 44f606318..7d030a9f1 100644 --- a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp @@ -21,7 +21,7 @@ #include "BwCtrlWindow.h" #include "gui/common/RSGraphWidget.h" #include "ui_BwCtrlWindow.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include #include diff --git a/retroshare-gui/src/gui/statistics/DhtWindow.cpp b/retroshare-gui/src/gui/statistics/DhtWindow.cpp index a2661955e..52d6b928f 100644 --- a/retroshare-gui/src/gui/statistics/DhtWindow.cpp +++ b/retroshare-gui/src/gui/statistics/DhtWindow.cpp @@ -20,7 +20,7 @@ #include "DhtWindow.h" #include "ui_DhtWindow.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include #include diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index e70044d9a..ec3b121f2 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -43,7 +43,7 @@ #include "gui/gxs/GxsIdDetails.h" #include "gui/gxs/GxsIdTreeWidgetItem.h" #include "util/DateTime.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/misc.h" #define COL_ID 0 diff --git a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp index 3037839c2..c5dd39f7a 100644 --- a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp @@ -40,7 +40,7 @@ #include "GxsIdStatistics.h" #include "util/DateTime.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/misc.h" #include "util/qtthreadsutils.h" diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp index 5b8fb8e5d..fde2cccfb 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp @@ -43,7 +43,7 @@ #include "gui/Identity/IdDetailsDialog.h" #include "gui/settings/rsharesettings.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "gui/common/UIStateHelper.h" #include "util/misc.h" #include "util/qtthreadsutils.h" diff --git a/retroshare-gui/src/gui/unfinished/ExampleDialog.cpp b/retroshare-gui/src/gui/unfinished/ExampleDialog.cpp index e263f75e9..e1d5c7809 100644 --- a/retroshare-gui/src/gui/unfinished/ExampleDialog.cpp +++ b/retroshare-gui/src/gui/unfinished/ExampleDialog.cpp @@ -37,7 +37,7 @@ #include #include -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" /* Images for context menu icons */ #define IMAGE_REMOVEFRIEND ":/images/removefriend16.png" diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 6f217db9c..28b8d5ee5 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -446,7 +446,7 @@ HEADERS += rshare.h \ util/misc.h \ util/HandleRichText.h \ util/ObjectPainter.h \ - util/QtVersion.h \ + util/RsQtVersion.h \ util/RsFile.h \ util/qtthreadsutils.h \ util/ClickableLabel.h \ diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index 7ad0c15e8..fcfe6d2b9 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -31,7 +31,7 @@ #include "gui/RetroShareLink.h" #include "util/ObjectPainter.h" #include "util/imageutil.h" -#include "util/QtVersion.h" +#include "util/RsQtVersion.h" #include "util/rsdebug.h" #include "util/rstime.h" diff --git a/retroshare-gui/src/util/QtVersion.h b/retroshare-gui/src/util/RsQtVersion.h similarity index 96% rename from retroshare-gui/src/util/QtVersion.h rename to retroshare-gui/src/util/RsQtVersion.h index f5e8e9784..dc3000969 100644 --- a/retroshare-gui/src/util/QtVersion.h +++ b/retroshare-gui/src/util/RsQtVersion.h @@ -18,8 +18,8 @@ * * *******************************************************************************/ -#ifndef QTVERSION_H -#define QTVERSION_H +#ifndef RS_QTVERSION_H +#define RS_QTVERSION_H // Macros to compile with Qt 4, Qt 5 and Qt 6 From 42b3b95fd8b38444f4c415486fbcef2df608f850 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 18:58:45 +0200 Subject: [PATCH 022/147] Use QDateTime::fromSecsSinceEpoch in Qt 6 instead of QDateTime::fromTime_t --- plugins/FeedReader/gui/AddFeedDialog.cpp | 4 ++-- .../gui/FeedReaderMessageWidget.cpp | 4 ++-- .../gui/FileTransfer/BannedFilesDialog.cpp | 3 ++- .../src/gui/FileTransfer/DLListDelegate.cpp | 3 ++- retroshare-gui/src/gui/FriendsDialog.cpp | 4 ++-- .../gui/Posted/PostedListWidgetWithModel.cpp | 12 ++++++------ .../src/gui/WikiPoos/WikiDialog.cpp | 3 ++- .../src/gui/chat/ChatLobbyDialog.cpp | 5 +++-- retroshare-gui/src/gui/chat/ChatWidget.cpp | 2 +- .../src/gui/chat/PopupChatDialog.cpp | 5 +++-- retroshare-gui/src/gui/common/FriendList.cpp | 2 +- .../src/gui/common/FriendListModel.cpp | 6 +++--- .../src/gui/common/GroupTreeWidget.cpp | 4 ++-- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 5 +++-- .../src/gui/im_history/ImHistoryBrowser.cpp | 7 ++++--- retroshare-gui/src/gui/settings/ChatPage.cpp | 5 +++-- .../gui/statistics/GxsTransportStatistics.cpp | 7 ++++--- retroshare-gui/src/util/DateTime.cpp | 19 ++++++++++++++----- retroshare-gui/src/util/DateTime.h | 3 +++ 19 files changed, 62 insertions(+), 41 deletions(-) diff --git a/plugins/FeedReader/gui/AddFeedDialog.cpp b/plugins/FeedReader/gui/AddFeedDialog.cpp index b6e781c4b..0951de7f5 100644 --- a/plugins/FeedReader/gui/AddFeedDialog.cpp +++ b/plugins/FeedReader/gui/AddFeedDialog.cpp @@ -28,6 +28,7 @@ #include "FeedReaderStringDefs.h" #include "gui/settings/rsharesettings.h" #include "gui/common/UIStateHelper.h" +#include "util/DateTime.h" #include #include @@ -339,8 +340,7 @@ bool AddFeedDialog::fillFeed(uint32_t feedId) ui->useStandardUpdateInterval->setChecked(feedInfo.flag.standardUpdateInterval); ui->updateIntervalSpinBox->setValue(feedInfo.updateInterval / 60); - QDateTime dateTime; - dateTime.setTime_t(feedInfo.lastUpdate); + QDateTime dateTime = DateTime::DateTimeFromTime_t(feedInfo.lastUpdate); ui->lastUpdate->setText(dateTime.toString()); ui->useStandardStorageTimeCheckBox->setChecked(feedInfo.flag.standardStorageTime); diff --git a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp index 9eed772b3..db2b73709 100644 --- a/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp +++ b/plugins/FeedReader/gui/FeedReaderMessageWidget.cpp @@ -41,6 +41,7 @@ #include "gui/gxsforums/CreateGxsForumMsg.h" #include "gui/common/FilesDefs.h" #include "util/imageutil.h" +#include "util/DateTime.h" #include "retroshare/rsiface.h" #include "retroshare/rsgxsforums.h" @@ -476,8 +477,7 @@ void FeedReaderMessageWidget::calculateMsgIconsAndFonts(QTreeWidgetItem *item) void FeedReaderMessageWidget::updateMsgItem(QTreeWidgetItem *item, FeedMsgInfo &info) { QString title = QString::fromUtf8(info.title.c_str()); - QDateTime qdatetime; - qdatetime.setTime_t(info.pubDate); + QDateTime qdatetime = DateTime::DateTimeFromTime_t(info.pubDate); /* add string to all data */ QString sort = QString("%1_%2_%3").arg(title, qdatetime.toString("yyyyMMdd_hhmmss")).arg(info.feedId); diff --git a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp index baa75c667..38591ed0d 100644 --- a/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/BannedFilesDialog.cpp @@ -24,6 +24,7 @@ #include "retroshare/rsfiles.h" #include "BannedFilesDialog.h" +#include "util/DateTime.h" #define COLUMN_FILE_NAME 0 #define COLUMN_FILE_HASH 1 @@ -80,7 +81,7 @@ void BannedFilesDialog::fillFilesList() ui.bannedFiles_TW->setItem(row, COLUMN_FILE_NAME, new QTableWidgetItem(QIcon(),QString::fromUtf8(it->second.mFilename.c_str()),0)); ui.bannedFiles_TW->setItem(row, COLUMN_FILE_HASH, new QTableWidgetItem(QIcon(),QString::fromStdString(it->first.toStdString()),0)); ui.bannedFiles_TW->setItem(row, COLUMN_FILE_SIZE, new QTableWidgetItem(QIcon(),QString::number(it->second.mSize),0)); - ui.bannedFiles_TW->setItem(row, COLUMN_FILE_TIME, new QTableWidgetItem(QIcon(),QDateTime::fromTime_t(it->second.mBanTimeStamp).toString(),0)); + ui.bannedFiles_TW->setItem(row, COLUMN_FILE_TIME, new QTableWidgetItem(QIcon(),DateTime::DateTimeFromTime_t(it->second.mBanTimeStamp).toString(),0)); ui.bannedFiles_TW->item(row, COLUMN_FILE_HASH)->setData(Qt::UserRole, QString::fromStdString(it->first.toStdString())); diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 319c284d5..0a0c2b4c5 100755 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -29,6 +29,7 @@ #include #include "DLListDelegate.h" +#include "util/DateTime.h" Q_DECLARE_METATYPE(FileProgressInfo) @@ -261,7 +262,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti break; qi64Value = index.data().value(); if (qi64Value < std::numeric_limits::max()){ - QDateTime qdtLastDL = QDateTime::fromTime_t(qi64Value); + QDateTime qdtLastDL = DateTime::DateTimeFromTime_t(qi64Value); painter->drawText(option.rect, Qt::AlignCenter, qdtLastDL.toString("yyyy-MM-dd_hh:mm:ss")); } else { painter->drawText(option.rect, Qt::AlignCenter, tr("File Never Seen")); diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index 532a87f4a..71b97ea61 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -202,8 +202,8 @@ void FriendsDialog::chatMessageReceived(const ChatMessage &msg) { if(msg.chat_id.isBroadcast()) { - QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime); - QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime); + QDateTime sendTime = DateTime::DateTimeFromTime_t(msg.sendTime); + QDateTime recvTime = DateTime::DateTimeFromTime_t(msg.recvTime); QString message = QString::fromUtf8(msg.msg.c_str()); QString name = QString::fromUtf8(rsPeers->getPeerName(msg.broadcast_peer_id).c_str()); diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 37142f38e..2284e66ed 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -1023,7 +1023,7 @@ void PostedListWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,b post.mOlderVersions.insert(post.mMeta.mMsgId); GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, post, true, false,post.mOlderVersions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs)); + ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs)); return ; } @@ -1037,12 +1037,12 @@ void PostedListWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,b if (item) { item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); + ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); } else { GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, meta.mGroupId,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(post.mMeta.mPublishTs)); + ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs)); } #ifdef TODO ui->fileWidget->addFiles(post, related); @@ -1068,7 +1068,7 @@ void PostedListWidget::createPostItem(const RsGxsChannelPost& post, bool related older_versions.insert(meta.mMsgId); GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, false,older_versions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); + ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); return ; } @@ -1082,12 +1082,12 @@ void PostedListWidget::createPostItem(const RsGxsChannelPost& post, bool related if (item) { item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); + ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); } else { GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, QDateTime::fromTime_t(meta.mPublishTs)); + ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); } ui->fileWidget->addFiles(post, related); diff --git a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp index 876130c94..7f411a25e 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp @@ -30,6 +30,7 @@ #include "gui/WikiPoos/WikiEditDialog.h" #include "gui/settings/rsharesettings.h" #include "gui/gxs/WikiGroupDialog.h" +#include "util/DateTime.h" #include @@ -715,7 +716,7 @@ void WikiDialog::GroupMetaDataToGroupItemInfo(const RsGroupMetaData &groupInfo, groupItemInfo.name = QString::fromUtf8(groupInfo.mGroupName.c_str()); //groupItemInfo.description = QString::fromUtf8(groupInfo.forumDesc); groupItemInfo.popularity = groupInfo.mPop; - groupItemInfo.lastpost = QDateTime::fromTime_t(groupInfo.mLastPost); + groupItemInfo.lastpost = DateTime::DateTimeFromTime_t(groupInfo.mLastPost); groupItemInfo.subscribeFlags = groupInfo.mSubscribeFlags; groupItemInfo.icon = QIcon(IMAGE_WIKI); diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 3ce3fe684..4d5f0b2ac 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -47,6 +47,7 @@ #include "retroshare/rsnotify.h" #include "util/rstime.h" +#include "util/DateTime.h" #include #include @@ -530,8 +531,8 @@ void ChatLobbyDialog::changeNickname() */ void ChatLobbyDialog::addChatMsg(const ChatMessage& msg) { - QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime); - QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime); + QDateTime sendTime = DateTime::DateTimeFromTime_t(msg.sendTime); + QDateTime recvTime = DateTime::DateTimeFromTime_t(msg.recvTime); QString message = QString::fromUtf8(msg.msg.c_str()); RsGxsId gxs_id = msg.lobby_peer_gxs_id ; diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index abab8336a..3c995f147 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -416,7 +416,7 @@ void ChatWidget::init(const ChatId &chat_id, const QString &title) name = QString::fromUtf8(historyIt->peerId.toStdString().c_str()); } - addChatMsg(historyIt->incoming, name, RsGxsId(historyIt->peerId.toStdString().c_str()), QDateTime::fromTime_t(historyIt->sendTime), QDateTime::fromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY); + addChatMsg(historyIt->incoming, name, RsGxsId(historyIt->peerId.toStdString().c_str()), DateTime::DateTimeFromTime_t(historyIt->sendTime), DateTime::DateTimeFromTime_t(historyIt->recvTime), QString::fromUtf8(historyIt->message.c_str()), MSGTYPE_HISTORY); } } } diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 9cb422a8f..7bcf515df 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -27,6 +27,7 @@ #include "gui/settings/rsharesettings.h" #include "gui/settings/RsharePeerSettings.h" #include "gui/notifyqt.h" +#include "util/DateTime.h" #include #include @@ -130,8 +131,8 @@ void PopupChatDialog::addChatMsg(const ChatMessage &msg) { ChatWidget *cw = getChatWidget(); if (cw) { - QDateTime sendTime = QDateTime::fromTime_t(msg.sendTime); - QDateTime recvTime = QDateTime::fromTime_t(msg.recvTime); + QDateTime sendTime = DateTime::DateTimeFromTime_t(msg.sendTime); + QDateTime recvTime = DateTime::DateTimeFromTime_t(msg.recvTime); QString additional_info ; QString message = QString::fromUtf8(msg.msg.c_str()); QString name = msg.incoming? getPeerName(msg.chat_id,additional_info): getOwnName(); diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 68c21aaed..00de7866a 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -936,7 +936,7 @@ void FriendList::insertPeers() AvatarDefs::getAvatarFromSslId(RsPeerId(sslDetail.id.toStdString()), sslAvatar); /* last contact */ - QDateTime sslLastContact = QDateTime::fromTime_t(sslDetail.lastConnect); + QDateTime sslLastContact = DateTime::DateTimeFromTime_t(sslDetail.lastConnect); sslItem->setData(COLUMN_LAST_CONTACT, Qt::DisplayRole, QVariant(sslLastContact)); sslItem->setData(COLUMN_LAST_CONTACT, ROLE_SORT_NAME, QVariant(sslLastContact)); if (sslLastContact > bestLastContact) { diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 45c054698..eebf384c5 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -730,13 +730,13 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const { const HierarchicalProfileInformation *hn = getProfileInfo(e); - QDateTime most_recent_time = QDateTime::fromTime_t(0); + QDateTime most_recent_time = DateTime::DateTimeFromTime_t(0); QString most_recent_ip("---"); for(uint32_t i=0;ichild_node_indices.size();++i) { const HierarchicalNodeInformation& node = mLocations[hn->child_node_indices[i]]; - auto node_time = QDateTime::fromTime_t(node.node_info.lastConnect); + auto node_time = DateTime::DateTimeFromTime_t(node.node_info.lastConnect); if(most_recent_time < node_time) { @@ -787,7 +787,7 @@ QVariant RsFriendListModel::displayRole(const EntryIndex& e, int col) const return QVariant(QString::fromUtf8(node->node_info.location.c_str())); } - case COLUMN_THREAD_LAST_CONTACT: return QVariant(QDateTime::fromTime_t(node->node_info.lastConnect).toString()); + case COLUMN_THREAD_LAST_CONTACT: return QVariant(DateTime::DateTimeFromTime_t(node->node_info.lastConnect).toString()); case COLUMN_THREAD_IP: return QVariant( (node->node_info.state & RS_PEER_STATE_CONNECTED) ? StatusDefs::connectStateIpString(node->node_info) : QString("---")); case COLUMN_THREAD_ID: return QVariant( QString::fromStdString(node->node_info.id.toStdString()) ); diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index d0ff883a7..3f2092f32 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -427,7 +427,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList< } /* Set last post */ - if(itemInfo.lastpost == QDateTime::fromTime_t(0)) + if(itemInfo.lastpost == DateTime::DateTimeFromTime_t(0)) { item->setText(GTW_COLUMN_LAST_POST, tr("Never")); item->setData(GTW_COLUMN_LAST_POST, ROLE_SORT, QVariant());// To allow them not be sorted with ->setNoDataAsLast(true) @@ -461,7 +461,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList< if(!IS_GROUP_SUBSCRIBED(itemInfo.subscribeFlags)) tooltip += "\n" + QString::number(itemInfo.max_visible_posts) + " messages available" ; // if(itemInfo.max_visible_posts) // wtf? this=0 when there are some posts definitely exist - lastpost is recent - if(itemInfo.lastpost == QDateTime::fromTime_t(0)) + if(itemInfo.lastpost == DateTime::DateTimeFromTime_t(0)) tooltip += "\n" + tr("Last Post") + ": " + tr("Never") ; else tooltip += "\n" + tr("Last Post") + ": " + DateTime::formatLongDateTime(itemInfo.lastpost) ; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 069c51b79..622725140 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -37,6 +37,7 @@ #include "util/qtthreadsutils.h" #include "retroshare/rsgxsifacetypes.h" #include "GxsCommentDialog.h" +#include "util/DateTime.h" //#define DEBUG_GROUPFRAMEDIALOG @@ -331,7 +332,7 @@ void GxsGroupFrameDialog::updateSearchResults(const TurtleRequestId& sid) i.id = QString(it3->second.mGroupId.toStdString().c_str()); i.name = QString::fromUtf8(it3->second.mGroupName.c_str()); i.popularity = 0; // could be set to the number of hits - i.lastpost = QDateTime::fromTime_t(it3->second.mLastMessageTs); + i.lastpost = DateTime::DateTimeFromTime_t(it3->second.mLastMessageTs); i.subscribeFlags = 0; // irrelevant here i.publishKey = false ; // IS_GROUP_PUBLISHER(groupInfo.mSubscribeFlags); i.adminKey = false ; // IS_GROUP_ADMIN(groupInfo.mSubscribeFlags); @@ -950,7 +951,7 @@ void GxsGroupFrameDialog::groupInfoToGroupItemInfo(const RsGxsGenericGroupData * groupItemInfo.id = QString::fromStdString(groupInfo->mMeta.mGroupId.toStdString()); groupItemInfo.name = QString::fromUtf8(groupInfo->mMeta.mGroupName.c_str()); groupItemInfo.popularity = groupInfo->mMeta.mPop; - groupItemInfo.lastpost = QDateTime::fromTime_t(groupInfo->mMeta.mLastPost); + groupItemInfo.lastpost = DateTime::DateTimeFromTime_t(groupInfo->mMeta.mLastPost); groupItemInfo.subscribeFlags = groupInfo->mMeta.mSubscribeFlags; groupItemInfo.publishKey = IS_GROUP_PUBLISHER(groupInfo->mMeta.mSubscribeFlags) ; groupItemInfo.adminKey = IS_GROUP_ADMIN(groupInfo->mMeta.mSubscribeFlags) ; diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index 9f5f88e74..f4c01ddf1 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -39,6 +39,7 @@ #include #include "gui/settings/rsharesettings.h" #include "gui/notifyqt.h" +#include "util/DateTime.h" #define ROLE_MSGID Qt::UserRole #define ROLE_PLAINTEXT Qt::UserRole + 1 @@ -292,7 +293,7 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg) } QColor backgroundColor = ui.listWidget->palette().base().color(); - QString formatMsg = style.formatMessage(type, name, QDateTime::fromTime_t(msg.sendTime), messageText, 0, backgroundColor); + QString formatMsg = style.formatMessage(type, name, DateTime::DateTimeFromTime_t(msg.sendTime), messageText, 0, backgroundColor); itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg))); itemWidget->setData(ROLE_MSGID, msg.msgId); @@ -467,8 +468,8 @@ QString ImHistoryBrowser::getCurrentItemsQuotedText() ? QString::fromUtf8(details.mNickname.c_str()) : QString::fromUtf8(msg.peerName.c_str()); QDateTime date = msg.incoming - ? QDateTime::fromTime_t(msg.sendTime) - : QDateTime::fromTime_t(msg.recvTime); + ? DateTime::DateTimeFromTime_t(msg.sendTime) + : DateTime::DateTimeFromTime_t(msg.recvTime); QTextDocument doc; doc.setHtml(QString::fromUtf8(msg.message.c_str())); diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 1f35fe62c..44afbf996 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -26,6 +26,7 @@ #include "gui/RetroShareLink.h" #include "gui/chat/ChatDialog.h" #include "util/misc.h" +#include "util/DateTime.h" #include "retroshare/rsconfig.h" #include "retroshare/rshistory.h" @@ -494,7 +495,7 @@ ChatPage::load() QString tt ; tt += tr("Name :")+" " + QString::fromUtf8(detail.name.c_str()) ; tt += "\n" + tr("PGP id :")+" " + QString::fromStdString(invites[i].destination_pgp_id.toStdString()) ; - tt += "\n" + tr("Valid until :")+" " + QDateTime::fromTime_t(invites[i].time_of_validity).toString() ; + tt += "\n" + tr("Valid until :")+" " + DateTime::DateTimeFromTime_t(invites[i].time_of_validity).toString() ; item->setData(Qt::UserRole,QString::fromStdString(invites[i].pid.toStdString())) ; item->setToolTip(tt) ; @@ -538,7 +539,7 @@ void ChatPage::setPreviewMessages(QString &stylePath, QString styleVariant, QTex QString nameIncoming = tr("Incoming"); QString nameOutgoing = tr("Outgoing"); - QDateTime timestmp = QDateTime::fromTime_t(time(NULL)); + QDateTime timestmp = DateTime::DateTimeFromTime_t(time(NULL)); QColor backgroundColor = textBrowser->palette().base().color(); textBrowser->append(style.formatMessage(ChatStyle::FORMATMSG_HINCOMING, nameIncoming, timestmp, tr("Incoming message in history"), 0, backgroundColor)); diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp index fde2cccfb..72b986330 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp @@ -53,6 +53,7 @@ #include "gui/Identity/IdDialog.h" #include "gui/MainWindow.h" #include "gui/common/FilesDefs.h" +#include "util/DateTime.h" #define COL_PENDING_ID 0 #define COL_PENDING_DESTINATION 1 @@ -255,7 +256,7 @@ void GxsTransportStatistics::updateContent() item -> setData(COL_PENDING_DATASTATUS, Qt::DisplayRole, getStatusString(rec.status)); item -> setData(COL_PENDING_DATASIZE, Qt::DisplayRole, misc::friendlyUnit(rec.data_size)); item -> setData(COL_PENDING_DATAHASH, Qt::DisplayRole, QString::fromStdString(rec.data_hash.toStdString())); - item -> setData(COL_PENDING_SEND, Qt::DisplayRole, QDateTime::fromTime_t(rec.send_TS).toString()); + item -> setData(COL_PENDING_SEND, Qt::DisplayRole, DateTime::DateTimeFromTime_t(rec.send_TS).toString()); item -> setData(COL_PENDING_GROUP_ID, Qt::DisplayRole, QString::fromStdString(rec.group_id.toStdString())); item -> setData(COL_PENDING_DESTINATION_ID, Qt::DisplayRole, QString::fromStdString(rec.recipient.toStdString())); item -> setData(COL_PENDING_SENDTIME, Qt::DisplayRole, QString::number(now - rec.send_TS)); @@ -296,7 +297,7 @@ void GxsTransportStatistics::updateContent() groupTreeWidget->addTopLevelItem(item); groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end()); - QString msg_time_string = (stat.last_publish_TS>0)?QString("(Last msg: %1)").arg(QDateTime::fromTime_t((uint)stat.last_publish_TS).toString()):"" ; + QString msg_time_string = (stat.last_publish_TS>0)?QString("(Last msg: %1)").arg(DateTime::DateTimeFromTime_t((uint)stat.last_publish_TS).toString()):"" ; item->setData(COL_GROUP_PUBLISHTS, Qt::DisplayRole, msg_time_string) ; item->setData(COL_GROUP_NUM_MSGS, Qt::DisplayRole, QString::number(stat.mNumMsgs) ) ; @@ -340,7 +341,7 @@ void GxsTransportStatistics::updateContent() sitem->setData(COL_GROUP_UNIQUE_ID, Qt::DisplayRole,QString::fromStdString(meta.mMsgId.toStdString())); sitem->setData(COL_GROUP_AUTHOR_ID, Qt::DisplayRole, QString::fromStdString(meta.mAuthorId.toStdString())) ; - sitem->setText(COL_GROUP_PUBLISHTS, QDateTime::fromTime_t(meta.mPublishTs).toString()); + sitem->setText(COL_GROUP_PUBLISHTS, DateTime::DateTimeFromTime_t(meta.mPublishTs).toString()); sitem->setData(COL_GROUP_PUBLISHTS, Qt::UserRole, qdatetime); } } diff --git a/retroshare-gui/src/util/DateTime.cpp b/retroshare-gui/src/util/DateTime.cpp index 658772c5a..f96be5052 100644 --- a/retroshare-gui/src/util/DateTime.cpp +++ b/retroshare-gui/src/util/DateTime.cpp @@ -25,7 +25,7 @@ QString DateTime::formatLongDate(time_t dateValue) { - return formatLongDate(QDateTime::fromTime_t(dateValue).date()); + return formatLongDate(DateTimeFromTime_t(dateValue).date()); } QString DateTime::formatLongDate(const QDate &dateValue) @@ -41,7 +41,7 @@ QString DateTime::formatLongDate(const QDate &dateValue) QString DateTime::formatLongDateTime(time_t datetimeValue) { - return formatLongDateTime(QDateTime::fromTime_t(datetimeValue)); + return formatLongDateTime(DateTimeFromTime_t(datetimeValue)); } QString DateTime::formatLongDateTime(const QDateTime &datetimeValue) @@ -51,7 +51,7 @@ QString DateTime::formatLongDateTime(const QDateTime &datetimeValue) QString DateTime::formatDateTime(time_t datetimeValue) { - return formatDateTime(QDateTime::fromTime_t(datetimeValue)); + return formatDateTime(DateTimeFromTime_t(datetimeValue)); } QString DateTime::formatDateTime(const QDateTime &datetimeValue) @@ -61,7 +61,7 @@ QString DateTime::formatDateTime(const QDateTime &datetimeValue) QString DateTime::formatDate(time_t dateValue) { - return formatDate(QDateTime::fromTime_t(dateValue).date()); + return formatDate(DateTimeFromTime_t(dateValue).date()); } QString DateTime::formatDate(const QDate &dateValue) @@ -71,10 +71,19 @@ QString DateTime::formatDate(const QDate &dateValue) QString DateTime::formatTime(time_t timeValue) { - return formatTime(QDateTime::fromTime_t(timeValue).time()); + return formatTime(DateTimeFromTime_t(timeValue).time()); } QString DateTime::formatTime(const QTime &timeValue) { return timeValue.toString(Qt::SystemLocaleShortDate); } + +QDateTime DateTime::DateTimeFromTime_t(time_t timeValue) +{ +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + return QDateTime::fromSecsSinceEpoch(timeValue); +#else + return QDateTime::fromTime_t(timeValue); +#endif +} diff --git a/retroshare-gui/src/util/DateTime.h b/retroshare-gui/src/util/DateTime.h index c614ab3bd..e26965b6e 100644 --- a/retroshare-gui/src/util/DateTime.h +++ b/retroshare-gui/src/util/DateTime.h @@ -49,6 +49,9 @@ public: /* format date and time (see formatDate & formatTime) */ static QString formatDateTime(time_t datetimeValue); static QString formatDateTime(const QDateTime &datetimeValue); + + /* Convert time_t to QDateTime */ + static QDateTime DateTimeFromTime_t(time_t timeValue); }; #endif From 04b741e70d046b968d4833431f1723073f0180d6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 02:21:34 +0200 Subject: [PATCH 023/147] Fixed linking on Windows with enabled wikipoos --- retroshare-gui/src/retroshare-gui.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 28b8d5ee5..34744ca11 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -357,7 +357,10 @@ openbsd-* { wikipoos { PRE_TARGETDEPS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a LIBS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a - LIBS *= -lglib-2.0 + + !win32 { + LIBS *= -lglib-2.0 + } } ################################### HEADERS & SOURCES ############################# From 33fc4308c4eba980b515374384684764ae4dca1b Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 03:06:20 +0200 Subject: [PATCH 024/147] Use Qt::MouseButton::NoButton instead of 0 in edge.cpp --- retroshare-gui/src/gui/elastic/edge.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/elastic/edge.cpp b/retroshare-gui/src/gui/elastic/edge.cpp index 0fd8707d2..b2dcb9101 100644 --- a/retroshare-gui/src/gui/elastic/edge.cpp +++ b/retroshare-gui/src/gui/elastic/edge.cpp @@ -32,7 +32,7 @@ Edge::Edge(Node *sourceNode, Node *destNode) : arrowSize(10) { - setAcceptedMouseButtons(0); + setAcceptedMouseButtons(Qt::MouseButton::NoButton); source = sourceNode; dest = destNode; source->addEdge(this); From 90041fc6272047f7240d2b9209cf5ed4e15d79e5 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 03:05:02 +0200 Subject: [PATCH 025/147] Replaced deprecated QLayout::setMargins by QLayout::setContentsMargins --- retroshare-gui/src/gui/AboutWidget.cpp | 2 +- retroshare-gui/src/gui/Identity/IdDialog.cpp | 4 ++-- retroshare-gui/src/gui/LogoBar.cpp | 2 +- retroshare-gui/src/gui/MainWindow.cpp | 2 +- retroshare-gui/src/gui/advsearch/guiexprelement.cpp | 2 +- retroshare-gui/src/gui/common/FriendList.cpp | 2 +- retroshare-gui/src/gui/common/NewFriendList.cpp | 4 ++-- retroshare-gui/src/gui/common/RSTreeWidget.cpp | 2 +- retroshare-gui/src/gui/statusbar/SoundStatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/ToasterDisable.cpp | 2 +- retroshare-gui/src/gui/statusbar/dhtstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/discstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/hashingstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/natstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/peerstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/ratesstatus.cpp | 2 +- retroshare-gui/src/gui/statusbar/torstatus.cpp | 2 +- retroshare-gui/src/util/Widget.cpp | 2 +- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index 1c4ae6827..9f5082fbd 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -49,7 +49,7 @@ AboutWidget::AboutWidget(QWidget* parent) setupUi(this); QHBoxLayout* l = new QHBoxLayout(); - l->setMargin(0); + l->setContentsMargins(0, 0, 0, 0); l->addStretch(1); l->addStretch(1); specialFrame->setContentsMargins(0, 0, 0, 0); diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index c9c2cdf18..9d38ed5d3 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2165,7 +2165,7 @@ void IdDialog::headerContextMenuRequested(QPoint) // create menu header //QHBoxLayout *hbox = new QHBoxLayout(widget); - //hbox->setMargin(0); + //hbox->setContentsMargins(0, 0, 0, 0); //hbox->setSpacing(6); auto addEntry = [&](const QString& name,RsIdentityListModel::Columns col) @@ -2264,7 +2264,7 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) // create menu header QHBoxLayout *hbox = new QHBoxLayout(widget); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(widget); diff --git a/retroshare-gui/src/gui/LogoBar.cpp b/retroshare-gui/src/gui/LogoBar.cpp index 081eb2c31..a5759ed16 100644 --- a/retroshare-gui/src/gui/LogoBar.cpp +++ b/retroshare-gui/src/gui/LogoBar.cpp @@ -80,7 +80,7 @@ void LogoBar::init() { ); QGridLayout * layout = new QGridLayout(this); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); layout->setSpacing(0); layout->addWidget(FillLabel1, 0, 0); diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 5ba8f1ddd..897d11136 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -261,7 +261,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags flags) QWidget *widget = new QWidget(); widget->setObjectName("trans_statusComboBoxFrame"); QHBoxLayout *hbox = new QHBoxLayout(); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); hbox->addWidget(statusComboBox); widget->setLayout(hbox); diff --git a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp index 5dd138186..cb146db1f 100644 --- a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp +++ b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp @@ -219,7 +219,7 @@ QStringList GuiExprElement::getConditionOptions(ExprSearchType t) QHBoxLayout * GuiExprElement::createLayout(QWidget * parent /*= nullptr*/) { QHBoxLayout * hboxLayout = new QHBoxLayout(parent); - hboxLayout->setMargin(0); + hboxLayout->setContentsMargins(0, 0, 0, 0); hboxLayout->setSpacing(0); return hboxLayout; } diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 00de7866a..7057e8418 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -304,7 +304,7 @@ void FriendList::peerTreeWidgetCustomPopupMenu() // create menu header QHBoxLayout *hbox = new QHBoxLayout(widget); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(widget); diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 66e692375..49f392b66 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -319,7 +319,7 @@ void NewFriendList::headerContextMenuRequested(QPoint /*p*/) // create menu header QHBoxLayout *hbox = new QHBoxLayout(widget); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(widget); @@ -591,7 +591,7 @@ void NewFriendList::peerTreeWidgetCustomPopupMenu() // create menu header QHBoxLayout *hbox = new QHBoxLayout(widget); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(widget); diff --git a/retroshare-gui/src/gui/common/RSTreeWidget.cpp b/retroshare-gui/src/gui/common/RSTreeWidget.cpp index 8ecdfde3f..ab4004633 100644 --- a/retroshare-gui/src/gui/common/RSTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/RSTreeWidget.cpp @@ -260,7 +260,7 @@ QMenu *RSTreeWidget::createStandardContextMenu(QMenu *contextMenu) // create menu header QHBoxLayout *hbox = new QHBoxLayout(widget); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(widget); diff --git a/retroshare-gui/src/gui/statusbar/SoundStatus.cpp b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp index 374a61b12..e798142a0 100644 --- a/retroshare-gui/src/gui/statusbar/SoundStatus.cpp +++ b/retroshare-gui/src/gui/statusbar/SoundStatus.cpp @@ -32,7 +32,7 @@ SoundStatus::SoundStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(0); imageButton = new QPushButton(this); diff --git a/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp b/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp index 1f52163ec..c4144d67c 100644 --- a/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp +++ b/retroshare-gui/src/gui/statusbar/SysTrayStatus.cpp @@ -33,7 +33,7 @@ SysTrayStatus::SysTrayStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(0); imageButton = new QPushButton(this); diff --git a/retroshare-gui/src/gui/statusbar/ToasterDisable.cpp b/retroshare-gui/src/gui/statusbar/ToasterDisable.cpp index 273245972..a304f8721 100644 --- a/retroshare-gui/src/gui/statusbar/ToasterDisable.cpp +++ b/retroshare-gui/src/gui/statusbar/ToasterDisable.cpp @@ -32,7 +32,7 @@ ToasterDisable::ToasterDisable(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(0); imageButton = new QPushButton(this); diff --git a/retroshare-gui/src/gui/statusbar/dhtstatus.cpp b/retroshare-gui/src/gui/statusbar/dhtstatus.cpp index 9d998137f..40790e4d6 100644 --- a/retroshare-gui/src/gui/statusbar/dhtstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/dhtstatus.cpp @@ -37,7 +37,7 @@ DHTStatus::DHTStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); statusDHT = new QLabel("" + tr("DHT") + ":", this ); diff --git a/retroshare-gui/src/gui/statusbar/discstatus.cpp b/retroshare-gui/src/gui/statusbar/discstatus.cpp index 64ac7813e..7475bf3a7 100644 --- a/retroshare-gui/src/gui/statusbar/discstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/discstatus.cpp @@ -33,7 +33,7 @@ DiscStatus::DiscStatus(QWidget *parent) hide (); // show only, when pending operations are available QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); QLabel *iconLabel = new QLabel(this); diff --git a/retroshare-gui/src/gui/statusbar/hashingstatus.cpp b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp index fc57bb286..109933cc8 100644 --- a/retroshare-gui/src/gui/statusbar/hashingstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/hashingstatus.cpp @@ -34,7 +34,7 @@ HashingStatus::HashingStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); movie = new QMovie(":/images/loader/indicator-16.gif"); diff --git a/retroshare-gui/src/gui/statusbar/natstatus.cpp b/retroshare-gui/src/gui/statusbar/natstatus.cpp index 15e2a7067..28ae53c35 100644 --- a/retroshare-gui/src/gui/statusbar/natstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/natstatus.cpp @@ -31,7 +31,7 @@ NATStatus::NATStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); statusNAT = new QLabel( tr("NAT:"), this ); diff --git a/retroshare-gui/src/gui/statusbar/peerstatus.cpp b/retroshare-gui/src/gui/statusbar/peerstatus.cpp index 4f1c9811f..5cfce309f 100644 --- a/retroshare-gui/src/gui/statusbar/peerstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/peerstatus.cpp @@ -28,7 +28,7 @@ PeerStatus::PeerStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); diff --git a/retroshare-gui/src/gui/statusbar/ratesstatus.cpp b/retroshare-gui/src/gui/statusbar/ratesstatus.cpp index 8e4f606f7..b953020fa 100644 --- a/retroshare-gui/src/gui/statusbar/ratesstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/ratesstatus.cpp @@ -32,7 +32,7 @@ RatesStatus::RatesStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(this); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); iconLabel = new QLabel( this ); diff --git a/retroshare-gui/src/gui/statusbar/torstatus.cpp b/retroshare-gui/src/gui/statusbar/torstatus.cpp index d43de1df3..12bcddf54 100644 --- a/retroshare-gui/src/gui/statusbar/torstatus.cpp +++ b/retroshare-gui/src/gui/statusbar/torstatus.cpp @@ -40,7 +40,7 @@ TorStatus::TorStatus(QWidget *parent) : QWidget(parent) { QHBoxLayout *hbox = new QHBoxLayout(); - hbox->setMargin(0); + hbox->setContentsMargins(0, 0, 0, 0); hbox->setSpacing(6); statusTor = new QLabel("" + tr("Tor") + ":", this ); diff --git a/retroshare-gui/src/util/Widget.cpp b/retroshare-gui/src/util/Widget.cpp index 0fdf10880..cb9f6ad91 100644 --- a/retroshare-gui/src/util/Widget.cpp +++ b/retroshare-gui/src/util/Widget.cpp @@ -27,7 +27,7 @@ QGridLayout * Widget::createLayout(QWidget * parent) { QGridLayout * layout = new QGridLayout(parent); layout->setSpacing(0); - layout->setMargin(0); + layout->setContentsMargins(0, 0, 0, 0); return layout; } From 5bdcf59b5cebd08b182b9f187968a4ae1ece42f4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 17:27:42 +0200 Subject: [PATCH 026/147] Replaced deprecated QString::sprintf by QString::asprintf --- retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp | 8 ++++---- retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp | 6 +++--- retroshare-gui/src/gui/TheWire/PulseViewItem.cpp | 6 +++--- retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 0a0c2b4c5..44d8580f0 100755 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -95,7 +95,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti for(int i = 0; i < 4; ++i) { if (fileSize < 1024) { fileSize = index.data().toLongLong(); - temp.sprintf("%.2f ", fileSize / multi); + temp = QString::asprintf("%.2f ", fileSize / multi); temp += byteUnits[i]; break; } @@ -114,7 +114,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti for(int i = 0; i < 4; ++i) { if (remaining < 1024) { remaining = index.data().toLongLong(); - temp.sprintf("%.2f ", remaining / multi); + temp = QString::asprintf("%.2f ", remaining / multi); temp += byteUnits[i]; break; } @@ -133,7 +133,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti for(int i = 0; i < 4; ++i) { if (completed < 1024) { completed = index.data().toLongLong(); - temp.sprintf("%.2f ", completed / multi); + temp = QString::asprintf("%.2f ", completed / multi); temp += byteUnits[i]; break; } @@ -149,7 +149,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti temp = ""; } else { temp.clear(); - temp.sprintf("%.2f", dlspeed/1024.); + temp = QString::asprintf("%.2f", dlspeed/1024.); temp += " KB/s"; } painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp); diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp index 8bddc5017..377205d3e 100755 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp @@ -93,7 +93,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti for(int i = 0; i < 4; ++i) { if (fileSize < 1024) { fileSize = index.data().toLongLong(); - temp.sprintf("%.2f ", fileSize / multi); + temp = QString::asprintf("%.2f ", fileSize / multi); temp += byteUnits[i]; break; } @@ -112,7 +112,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti for(int i = 0; i < 4; ++i) { if (transferred < 1024) { transferred = index.data().toLongLong(); - temp.sprintf("%.2f ", transferred / multi); + temp = QString::asprintf("%.2f ", transferred / multi); temp += byteUnits[i]; break; } @@ -128,7 +128,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti temp = ""; } else { temp.clear(); - temp.sprintf("%.2f", ulspeed/1024.); + temp = QString::asprintf("%.2f", ulspeed/1024.); temp += " KB/s"; } painter->drawText(option.rect, Qt::AlignRight | Qt::AlignVCenter, temp); diff --git a/retroshare-gui/src/gui/TheWire/PulseViewItem.cpp b/retroshare-gui/src/gui/TheWire/PulseViewItem.cpp index 5a309f94b..b46737bfd 100644 --- a/retroshare-gui/src/gui/TheWire/PulseViewItem.cpp +++ b/retroshare-gui/src/gui/TheWire/PulseViewItem.cpp @@ -450,15 +450,15 @@ QString ToNumberUnits(uint32_t count) QString ans; if (count > 1000000) { - ans.sprintf("%6.2fm", count / 1000000.0); + ans = QString::asprintf("%6.2fm", count / 1000000.0); } else if (count > 1000) { - ans.sprintf("%6.2fk", count / 1000.0); + ans = QString::asprintf("%6.2fk", count / 1000.0); } else { - ans.sprintf("%6d", count); + ans = QString::asprintf("%6d", count); } return ans; } diff --git a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp index 7d030a9f1..7eec812ac 100644 --- a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp @@ -96,12 +96,12 @@ void BWListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti switch(index.column()) { case COLUMN_IN_RATE: - temp.sprintf("%.3f ", index.data().toFloat()); + temp = QString::asprintf("%.3f ", index.data().toFloat()); //temp=QString::number(index.data().toFloat()); painter->drawText(option.rect, Qt::AlignRight, temp); break; case COLUMN_IN_MAX: - temp.sprintf("%.3f ", index.data().toFloat()); + temp = QString::asprintf("%.3f ", index.data().toFloat()); //temp=QString::number(index.data().toFloat()); painter->drawText(option.rect, Qt::AlignRight, temp); break; @@ -112,7 +112,7 @@ void BWListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti case COLUMN_IN_ALLOC: flValue = index.data().toFloat(); if (flValue < std::numeric_limits::max()){ - temp.sprintf("%.3f ", flValue); + temp = QString::asprintf("%.3f ", flValue); } else { temp=strNA; } @@ -128,12 +128,12 @@ void BWListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti painter->drawText(option.rect, Qt::AlignRight, temp); break; case COLUMN_OUT_RATE: - temp.sprintf("%.3f ", index.data().toFloat()); + temp = QString::asprintf("%.3f ", index.data().toFloat()); //temp=QString::number(index.data().toFloat()); painter->drawText(option.rect, Qt::AlignRight, temp); break; case COLUMN_OUT_MAX: - temp.sprintf("%.3f ", index.data().toFloat()); + temp = QString::asprintf("%.3f ", index.data().toFloat()); //temp=QString::number(index.data().toFloat()); painter->drawText(option.rect, Qt::AlignRight, temp); break; From e3202de4ef3804ae85fa7ceb734ca696838e0490 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 20 Jul 2025 14:30:18 +0200 Subject: [PATCH 027/147] CHANGE: remove qt4, make x11extras for qt5 only --- retroshare-gui/src/retroshare-gui.pro | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 34744ca11..eb2d235b7 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -96,12 +96,11 @@ HEADERS += TorControl/TorControlWindow.h greaterThan(QT_MAJOR_VERSION, 4) { # Qt 5 QT += widgets multimedia printsupport - linux-* { - QT += x11extras - } -} else { - # Qt 4 - CONFIG += uitools + lessThan(QT_MAJOR_VERSION, 6) { + linux-*{ + QT += x11extras + } + } } CONFIG += identities From eb4f482a4e082828f9b7b35e80f887e3a3085319 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 17:44:37 +0200 Subject: [PATCH 028/147] Fixed set of default language in LanguageSupport::localize. Use value of language map instead of key. --- retroshare-gui/src/lang/languagesupport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/lang/languagesupport.cpp b/retroshare-gui/src/lang/languagesupport.cpp index 46e749465..3be4a1ec2 100644 --- a/retroshare-gui/src/lang/languagesupport.cpp +++ b/retroshare-gui/src/lang/languagesupport.cpp @@ -261,6 +261,6 @@ bool LanguageSupport::localize(const QString &languageCode) { if (!isValidLanguageCode(languageCode)) return false; - QLocale::setDefault(locales().key(languageCode)); + QLocale::setDefault(locales()[languageCode]); return true; } From 48ffc595228fb957cdeb1f3ad139831c9d0dbae6 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 21 Jul 2025 21:50:48 +0200 Subject: [PATCH 029/147] Created new readme --- README.asciidoc | 70 ------------------------------------------------- README.md | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 70 deletions(-) delete mode 100644 README.asciidoc create mode 100644 README.md diff --git a/README.asciidoc b/README.asciidoc deleted file mode 100644 index 6e5c52ce9..000000000 --- a/README.asciidoc +++ /dev/null @@ -1,70 +0,0 @@ -// SPDX-FileCopyrightText: Retroshare Team -// SPDX-License-Identifier: CC-BY-SA-4.0 - -= RetroShare - -RetroShare is a decentralized, private, secure, cross-platform, communication -toolkit. -RetroShare provides file sharing, chat, messages, forums, channels and more. - -|=============================================================================== -| Developer Documentation | image:https://deepwiki.com/badge.svg[link="https://deepwiki.com/RetroShare/RetroShare",title="Ask DeepWiki"] -|=============================================================================== -.Build Status -|=============================================================================== -|GNU/Linux (via Gitlab CI) | image:https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/RetroShare/-/commits/master",title="pipeline status"] -|Windows (via AppVeyor) | image:https://ci.appveyor.com/api/projects/status/github/RetroShare/RetroShare?svg=true[link="https://ci.appveyor.com/project/RetroShare58622/retroshare"] -|macOS, (via Travis CI) | image:https://app.travis-ci.com/RetroShare/RetroShare.svg?branch=master[link="https://app.travis-ci.com/github/RetroShare/RetroShare"] -|libretroshare GNU/Linux, Android (via Gitlab CI) | image:https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg[link="https://gitlab.com/RetroShare/libretroshare/-/commits/master",title="pipeline status"] -|=============================================================================== - -== Get the source - -Clone this repository, enter the directory and then get the submodules with the -following command - -[source,bash] --------- -git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/ --------- - - -== Compilation - -Short of comprehensive and updated documentation on how to build RetroShare -(for the many supported platforms it runs on), scripts and recipes are provided -in the aim of creating packages for the supported platforms (and more) -in the `build_scripts` directory of this repository. - -Those packaging receipts together with the continuous integration files -`.travis.yml` and `appveyor.yml` are a good source of knowledge on how to -compile RetroShare on different platforms. - - -== Using RetroShare on a headless computer with web UI - -WARNING: This section is outdated need to be adapted to the new web UI - -The web UI needs to be enabled as a parameter option to the retroshare-service: - -[source,bash] --------- -./retroshare-nogui --webinterface 9090 --docroot /usr/share/retroshare/webui/ --------- - -The web UI is only accessible on localhost:9090. It is advised to keep it that way so that your RS -cannot be controlled using an untrusted connection. - -To access your web UI from a distance, just open a SSH tunnel to it: - -[source,bash] --------- -distant_machine:~/ > ssh rs_host -L 9090:localhost:9090 -N --------- - -"rs_host" is the machine running `retroshare-nogui`. Then on the distant machine, access your web UI on - - - http://localhost:9090 - -(This can also be done from the RetroShare GUI.) diff --git a/README.md b/README.md new file mode 100644 index 000000000..04f1e8c95 --- /dev/null +++ b/README.md @@ -0,0 +1,46 @@ +## RetroShare + +RetroShare is a decentralized, private, secure, cross-platform, communication +toolkit. +RetroShare provides file sharing, chat, messages, forums, channels, boards and more. + +[![GitHub release](https://img.shields.io/github/release/retroshare/retroshare.svg?label=latest%20release)](https://github.com/retroshare/retroshare/releases/latest) +[![Downloads](https://img.shields.io/github/downloads/retroshare/retroshare/total)](https://github.com/retroshare/retroshare/releases/latest) +[![GNU/Linux (via Gitlab CI)](https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/RetroShare/-/commits/master) +[![libretroshare GNU/Linux, Android (via Gitlab CI)](https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/libretroshare/-/commits/master) +[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/RetroShare/RetroShare) + +## Get the source + +Clone this repository, enter the directory and then get the submodules with the +following command + + git submodule update --init --remote --force libbitdht/ libretroshare/ openpgpsdk/ + + + +## Compilation + +Short of comprehensive and updated documentation on how to build RetroShare +(for the many supported platforms it runs on), scripts and recipes are provided +in the aim of creating packages for the supported platforms (and more) +in the [build_scripts](https://github.com/RetroShare/RetroShare/tree/master/build_scripts) directory of this repository. + +## Compilation on Windows +Follow this file : [WindowsMSys2_InstallGuide.md](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md) + +## Compilation on MacOSX + +Follow this file : [MacOS_X_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/OSX/MacOS_X_InstallGuide.md) + +## Releases + +Latest release [here](https://github.com/RetroShare/RetroShare/releases) + +Other Builds [RetroShare Downloads](https://retroshare.cc/downloads.html) + + +## Documentation + +- [RetroShare Docs](https://retrosharedocs.readthedocs.io/en/latest/) + From a9109060d6a01faaf9dd6cfd25b1404767c8a8d7 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 22 Jul 2025 20:55:58 +0200 Subject: [PATCH 030/147] Fix qt6 with cmake --- retroshare-gui/CMakeLists.txt | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/CMakeLists.txt b/retroshare-gui/CMakeLists.txt index 314edf1ab..ba732914f 100644 --- a/retroshare-gui/CMakeLists.txt +++ b/retroshare-gui/CMakeLists.txt @@ -77,14 +77,24 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON) -find_package( Qt5 COMPONENTS Core REQUIRED) -find_package( Qt5 COMPONENTS Widgets REQUIRED) -find_package( Qt5 COMPONENTS Xml REQUIRED) -find_package( Qt5 COMPONENTS Network REQUIRED) -find_package( Qt5 COMPONENTS Multimedia REQUIRED) -find_package( Qt5 COMPONENTS PrintSupport REQUIRED) +find_package( Qt6 COMPONENTS Core REQUIRED) +find_package( Qt6 COMPONENTS Widgets REQUIRED) +find_package( Qt6 COMPONENTS Xml REQUIRED) +find_package( Qt6 COMPONENTS Network REQUIRED) +find_package( Qt6 COMPONENTS Multimedia REQUIRED) +find_package( Qt6 COMPONENTS PrintSupport REQUIRED) -list( APPEND RS_LINK_LIBRARIES Qt5::Multimedia Qt5::Widgets Qt5::Xml Qt5::Network Qt5::PrintSupport) +list( APPEND RS_LINK_LIBRARIES Qt6::Multimedia Qt6::Widgets Qt6::Xml Qt6::Network Qt6::PrintSupport) +if (NOT Qt6_FOUND) + find_package( Qt5 COMPONENTS Core REQUIRED) + find_package( Qt5 COMPONENTS Widgets REQUIRED) + find_package( Qt5 COMPONENTS Xml REQUIRED) + find_package( Qt5 COMPONENTS Network REQUIRED) + find_package( Qt5 COMPONENTS Multimedia REQUIRED) + find_package( Qt5 COMPONENTS PrintSupport REQUIRED) + + list( APPEND RS_LINK_LIBRARIES Qt5::Multimedia Qt5::Widgets Qt5::Xml Qt5::Network Qt5::PrintSupport) +endif() ################################################################################ From 58681981810bfa2789c47e81fca9d125fc332a22 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 22 Jul 2025 21:29:32 +0200 Subject: [PATCH 031/147] Update CMakeLists.txt --- retroshare-gui/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/CMakeLists.txt b/retroshare-gui/CMakeLists.txt index ba732914f..9b5240e17 100644 --- a/retroshare-gui/CMakeLists.txt +++ b/retroshare-gui/CMakeLists.txt @@ -114,7 +114,10 @@ endif(RS_DEVELOPMENT_BUILD) include(src/CMakeLists.txt) -qt5_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS}) +qt_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS}) +if (NOT Qt6_FOUND) + qt5_wrap_ui(RS_UI_HEADERS ${RS_GUI_FORMS}) +endif() add_executable(${PROJECT_NAME} ${RS_GUI_SOURCES} ${RS_UI_HEADERS} ${RS_GUI_QTRESOURCES}) install(TARGETS ${PROJECT_NAME} DESTINATION ${RS_BIN_INSTALL_DIR}) From 9e121480c04a9ffc01ea3d35825f12c9f2eddf91 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:23:15 +0200 Subject: [PATCH 032/147] Added Qt6 workflow --- .github/workflows/ci-mingw64-Qt6.yml | 71 ++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 .github/workflows/ci-mingw64-Qt6.yml diff --git a/.github/workflows/ci-mingw64-Qt6.yml b/.github/workflows/ci-mingw64-Qt6.yml new file mode 100644 index 000000000..b23a537f3 --- /dev/null +++ b/.github/workflows/ci-mingw64-Qt6.yml @@ -0,0 +1,71 @@ +name: MINGW64 Qt6 Build + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow}}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: windows-latest + permissions: + actions: write + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup MSYS2 + uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0 + with: + msystem: MINGW64 + update: true + install: >- + base-devel + git + wget + p7zip + gcc + perl + ruby + doxygen + cmake + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-miniupnpc + mingw-w64-x86_64-libxslt + mingw-w64-x86_64-xapian-core + mingw-w64-x86_64-sqlcipher + mingw-w64-x86_64-qt6-base + mingw-w64-x86_64-qt6-multimedia + mingw-w64-x86_64-qt6 + mingw-w64-x86_64-ccmake + mingw-w64-x86_64-rapidjson + mingw-w64-x86_64-json-c + mingw-w64-x86_64-libbotan + mingw-w64-x86_64-asio + + - name: Checkout submodules + run: | + env + git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/ + git submodule update --init supportlibs/librnp supportlibs/rapidjson + + - name: Build + run: | + qmake6 ../RetroShare -spec win32-g++ "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + mingw32-make -j3 \ No newline at end of file From 93b232d7ae170c1b5e03557e13bf134c35f249b4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 28 Jul 2025 11:02:15 +0200 Subject: [PATCH 033/147] Windows native build: Removed external library libmicrohttpd --- build_scripts/Windows/build-libs/Makefile | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index b0c9ce137..391ea8a34 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -11,7 +11,6 @@ LIBXSLT_VERSION=$(LIBXSLT_MAIN_VERSION).43 CURL_VERSION=8.9.1 TCL_VERSION=8.6.10 SQLCIPHER_VERSION=4.5.0 -LIBMICROHTTPD_VERSION=0.9.75 FFMPEG_VERSION=4.4.6 RAPIDJSON_VERSION=1.1.0 XAPIAN_VERSION=1.4.29 @@ -26,7 +25,7 @@ DOWNLOAD_PATH?=download BUILD_PATH=build LIBS_PATH?=libs -all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan asio copylibs +all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml curl sqlcipher ffmpeg rapidjson xapian jsonc botan asio copylibs #rnp download: \ @@ -41,7 +40,6 @@ download: \ $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz \ $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz \ $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz \ - $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz \ $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz \ $(DOWNLOAD_PATH)/rapidjson-$(RAPIDJSON_VERSION).tar.gz \ $(DOWNLOAD_PATH)/xapian-core-$(XAPIAN_VERSION).tar.xz @@ -298,22 +296,6 @@ $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION) rm -r -f tcl$(TCL_VERSION) mv $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION) -libmicrohttpd: $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION) - -$(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz: - wget --no-check-certificate http://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz -O $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz - -$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION): $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz - # prepare - rm -r -f $(BUILD_PATH)/libmicrohttpd-* - tar xvf $(DOWNLOAD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tar.gz - # build - cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp" - cd libmicrohttpd-$(LIBMICROHTTPD_VERSION) && make install - # cleanup - rm -r -f libmicrohttpd-$(LIBMICROHTTPD_VERSION) - mv $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION).tmp $(BUILD_PATH)/libmicrohttpd-$(LIBMICROHTTPD_VERSION) - ffmpeg: $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION) $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz: From e4672d9a5767dbadfe60283f9cb1d670d703f93a Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 28 Jul 2025 12:30:46 +0200 Subject: [PATCH 034/147] Windows native build: Enabled parallel build of external libraries --- build_scripts/Windows/build-libs/Makefile | 33 +++++++++++------------ 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index 391ea8a34..79a424a44 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -63,8 +63,7 @@ $(BUILD_PATH)/zlib-$(ZLIB_VERSION): $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz rm -r -f $(BUILD_PATH)/zlib-* tar xvf $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz # build - cd zlib-$(ZLIB_VERSION) && make -f win32/Makefile.gcc libz.a - cd zlib-$(ZLIB_VERSION) && make + cd zlib-$(ZLIB_VERSION) && make -j -f win32/Makefile.gcc libz.a # copy files mkdir -p $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include cp zlib-$(ZLIB_VERSION)/zlib.h $(BUILD_PATH)/zlib-$(ZLIB_VERSION).tmp/include/ @@ -86,7 +85,7 @@ $(BUILD_PATH)/bzip2-$(BZIP2_VERSION): $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).ta tar xvf $(DOWNLOAD_PATH)/bzip2-$(BZIP2_VERSION).tar.gz # build #cd bzip2-$(BZIP2_VERSION) && make install PREFIX="`pwd`/../$(BUILD_PATH)" - cd bzip2-$(BZIP2_VERSION) && make + cd bzip2-$(BZIP2_VERSION) && make -j # copy files mkdir -p $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include cp bzip2-$(BZIP2_VERSION)/bzlib.h $(BUILD_PATH)/bzip2-$(BZIP2_VERSION).tmp/include/ @@ -106,7 +105,7 @@ $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION): $(DOWNLOAD_PATH)/miniupnpc-$(MINIU rm -r -f $(BUILD_PATH)/miniupnpc-* tar xvf $(DOWNLOAD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tar.gz # build - cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -f Makefile.mingw libminiupnpc.a miniupnpc.dll + cd miniupnpc-$(MINIUPNPC_VERSION) && export CC=gcc && export PATH=.:$$PATH && make -j -f Makefile.mingw libminiupnpc.a miniupnpc.dll # copy files mkdir -p $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc cp miniupnpc-$(MINIUPNPC_VERSION)/include/*.h $(BUILD_PATH)/miniupnpc-$(MINIUPNPC_VERSION).tmp/include/miniupnpc/ @@ -131,7 +130,7 @@ $(BUILD_PATH)/openssl-$(OPENSSL_VERSION): $(DOWNLOAD_PATH)/openssl-$(OPENSSL_VER #cd openssl-$(OPENSSL_VERSION) && ./config --prefix="`pwd`/../$(BUILD_PATH)" #cd openssl-$(OPENSSL_VERSION) && make install cd openssl-$(OPENSSL_VERSION) && ./config shared - cd openssl-$(OPENSSL_VERSION) && make + cd openssl-$(OPENSSL_VERSION) && make -j # copy files mkdir -p $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl cp openssl-$(OPENSSL_VERSION)/include/openssl/*.h $(BUILD_PATH)/openssl-$(OPENSSL_VERSION).tmp/include/openssl/ @@ -160,7 +159,7 @@ $(BUILD_PATH)/speex-$(SPEEX_VERSION): $(DOWNLOAD_PATH)/speex-$(SPEEX_VERSION).ta # build cd speex-$(SPEEX_VERSION) && ./configure #cd speex-$(SPEEX_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" - cd speex-$(SPEEX_VERSION) && make + cd speex-$(SPEEX_VERSION) && make -j # copy files mkdir -p $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex cp speex-$(SPEEX_VERSION)/include/speex/*.h $(BUILD_PATH)/speex-$(SPEEX_VERSION).tmp/include/speex/ @@ -181,7 +180,7 @@ $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION): $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP tar xvf $(DOWNLOAD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tar.gz # build cd speexdsp-$(SPEEXDSP_VERSION) && ./configure - cd speexdsp-$(SPEEXDSP_VERSION) && make + cd speexdsp-$(SPEEXDSP_VERSION) && make -j # copy files mkdir -p $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex cp speexdsp-$(SPEEXDSP_VERSION)/include/speex/*.h $(BUILD_PATH)/speexdsp-$(SPEEXDSP_VERSION).tmp/include/speex/ @@ -215,11 +214,11 @@ $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION) $(BUILD_PATH)/libxslt-$(LIBXSLT_VERSION # libxml2: build cd libxml2-$(LIBXML2_VERSION) && ./configure --without-iconv -enable-shared=no #cd libxml2-$(LIBXML2_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" - cd libxml2-$(LIBXML2_VERSION) && make libxml2.la + cd libxml2-$(LIBXML2_VERSION) && make -j libxml2.la # libxslt: build cd libxslt-$(LIBXSLT_VERSION) && ./configure --with-libxml-src=../libxml2-$(LIBXML2_VERSION) -enable-shared=no CFLAGS=-DLIBXML_STATIC - cd libxslt-$(LIBXSLT_VERSION)/libxslt && make - cd libxslt-$(LIBXSLT_VERSION)/libexslt && make + cd libxslt-$(LIBXSLT_VERSION)/libxslt && make -j + cd libxslt-$(LIBXSLT_VERSION)/libexslt && make -j # libxml2: copy files mkdir -p $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml cp libxml2-$(LIBXML2_VERSION)/include/libxml/*.h $(BUILD_PATH)/libxml2-$(LIBXML2_VERSION).tmp/include/libxml/ @@ -251,7 +250,7 @@ $(BUILD_PATH)/curl-$(CURL_VERSION): $(DOWNLOAD_PATH)/curl-$(CURL_VERSION).tar.gz # build cd curl-$(CURL_VERSION) && ./configure --disable-shared --with-ssl="`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)" #cd curl-$(CURL_VERSION) && make install exec_prefix="`pwd`/../$(BUILD_PATH)" - cd curl-$(CURL_VERSION)/lib && make + cd curl-$(CURL_VERSION)/lib && make -j # copy files mkdir -p $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl cp curl-$(CURL_VERSION)/include/curl/*.h $(BUILD_PATH)/curl-$(CURL_VERSION).tmp/include/curl/ @@ -276,14 +275,14 @@ $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION): $(DOWNLOAD_PATH)/tcl$(TCL_VERSION) tar xvf $(DOWNLOAD_PATH)/tcl$(TCL_VERSION)-src.tar.gz mkdir -p tcl$(TCL_VERSION)/build cd tcl$(TCL_VERSION)/build && ../win/configure - cd tcl$(TCL_VERSION)/build && make + cd tcl$(TCL_VERSION)/build && make -j #sqlcipher tar xvf $(DOWNLOAD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tar.gz cd sqlcipher-$(SQLCIPHER_VERSION) && ln -s ../tcl$(TCL_VERSION)/build/tclsh86.exe tclsh mkdir -p tcl$(TCL_VERSION)/lib ln -s `pwd`/tcl$(TCL_VERSION)/library `pwd`/tcl$(TCL_VERSION)/lib/tcl8.6 # build - cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make install prefix="`pwd`/install" + cd sqlcipher-$(SQLCIPHER_VERSION) && PATH=.:$$PATH:`pwd`/../tcl$(TCL_VERSION)/build && export LIBS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lgdi32 $$LIBS" && ./configure --disable-shared --enable-static --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC -I`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/include -I`pwd`/../tcl$(TCL_VERSION)/generic" LDFLAGS="-L`pwd`/../$(BUILD_PATH)/openssl-$(OPENSSL_VERSION)/lib -lcrypto -lgdi32" --with-tcl="`pwd`/../tcl$(TCL_VERSION)/build" && make -j install prefix="`pwd`/install" # copy files mkdir -p $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include cp -r sqlcipher-$(SQLCIPHER_VERSION)/install/include/* $(BUILD_PATH)/sqlcipher-$(SQLCIPHER_VERSION).tmp/include/ @@ -307,7 +306,7 @@ $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION): $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION tar xvf $(DOWNLOAD_PATH)/ffmpeg-$(FFMPEG_VERSION).tar.xz # build cd ffmpeg-$(FFMPEG_VERSION) && ./configure --disable-shared --enable-static --disable-programs --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-yasm --disable-everything --enable-encoder=mpeg4 --enable-decoder=mpeg4 --prefix="`pwd`/../$(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp" - cd ffmpeg-$(FFMPEG_VERSION) && make install + cd ffmpeg-$(FFMPEG_VERSION) && make -j install # cleanup rm -r -f ffmpeg-$(FFMPEG_VERSION) mv $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION).tmp $(BUILD_PATH)/ffmpeg-$(FFMPEG_VERSION) @@ -345,7 +344,7 @@ $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPI #cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static --prefix="`pwd`/../$(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp" #cd xapian-core-$(XAPIAN_VERSION) && make install cd xapian-core-$(XAPIAN_VERSION) && ./configure --disable-shared --enable-static - cd xapian-core-$(XAPIAN_VERSION) && make + cd xapian-core-$(XAPIAN_VERSION) && make -j # copy files mkdir -p $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include cp -r xapian-core-$(XAPIAN_VERSION)/include/* $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp/include/ @@ -365,7 +364,7 @@ $(BUILD_PATH)/json-c-$(JSON_C_VERSION): # build mkdir -p json-c-$(JSON_C_VERSION)/build cd json-c-$(JSON_C_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_BUILD_TYPE="release" -DBUILD_SHARED_LIBS=off -DBUILD_STATIC_LIBS=on -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT" -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DCMAKE_INSTALL_PREFIX="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp" - cd json-c-$(JSON_C_VERSION)/build && make install + cd json-c-$(JSON_C_VERSION)/build && make -j install # cleanup rm -r -f json-c-$(JSON_C_VERSION) mv $(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp $(BUILD_PATH)/json-c-$(JSON_C_VERSION) @@ -380,7 +379,7 @@ $(BUILD_PATH)/botan-$(BOTAN_VERSION): # build if [ $(MSYSTEM) = "MINGW32" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_32 --disable-shared-library --enable-static-library --extra-cxxflags="-D__MINGW_USE_VC2005_COMPAT" --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi if [ $(MSYSTEM) = "MINGW64" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_64 --disable-shared-library --enable-static-library --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi - cd botan-$(BOTAN_VERSION) && make install + cd botan-$(BOTAN_VERSION) && make -j install # cleanup rm -r -f botan-$(BOTAN_VERSION) mv $(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp $(BUILD_PATH)/botan-$(BOTAN_VERSION) From 07ee6581e1ba1c748e7a2fb838f0fc00bc4b7ba9 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 29 Jul 2025 18:31:22 +0200 Subject: [PATCH 035/147] MSYS2: Use date of last git commit instead of current date for packed filename --- build_scripts/Windows-msys2/build/pack.bat | 9 +++--- .../Windows-msys2/tools/get-rs-date.bat | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 build_scripts/Windows-msys2/tools/get-rs-date.bat diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index 3fa48c615..dfa3827f5 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -55,10 +55,11 @@ set RsVersion=%RsVersion.Major%.%RsVersion.Minor%.%RsVersion.Mini% :: Check WMIC is available wmic.exe alias /? >nul 2>&1 || echo WMIC is not available.&& goto error -:: Use WMIC to retrieve date in format YYYYMMDD -set RsDate= -for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /format:list') do set RsDate=%%I -set RsDate=%RsDate:~0,4%%RsDate:~4,2%%RsDate:~6,2% +:: Get date +call "%ToolsPath%\get-rs-date.bat" "%SourcePath%" RsDate +if errorlevel 1 %cecho% error "Could not get date."& goto error + +if "%RsDate%"=="" %cecho% error "Could not get date."& goto error set QtMainVersion=%QtVersion:~0,1% set QtSharePath=%RsMinGWPath%\share\qt%QtMainVersion%\ diff --git a/build_scripts/Windows-msys2/tools/get-rs-date.bat b/build_scripts/Windows-msys2/tools/get-rs-date.bat new file mode 100644 index 000000000..e2b5e93aa --- /dev/null +++ b/build_scripts/Windows-msys2/tools/get-rs-date.bat @@ -0,0 +1,32 @@ +REM Usage: +REM call get-rs-date.bat SourcePath Variable + +setlocal + +set SourcePath=%~1 +set Variable=%~2 +if "%Variable%"=="" ( + echo. + echo Parameter error + exit /B 1 +) + +:: Check git executable +set GitPath= +call "%~dp0find-in-path.bat" GitPath git.exe +if "%GitPath%"=="" ( + echo. + echo Git executable not found in PATH. + exit /B 1 +) + +set Date= + +pushd "%SourcePath%" +rem This doesn't work: git log -1 --date=format:"%Y%m%d" --format="%ad" +for /F "tokens=1,2,3* delims=-" %%A in ('git log -1 --date^=short --format^="%%ad"') do set Date=%%A%%B%%C +popd + +:exit +endlocal & set %Variable%=%Date% +exit /B 0 From a6cf10fd1a707931d9ca3877f3ff0e1efce5c1bd Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 17:52:34 +0200 Subject: [PATCH 036/147] Replaced deprecated endl by Qt::endl --- retroshare-gui/src/util/log.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/log.cpp b/retroshare-gui/src/util/log.cpp index f1d31d706..23efb329c 100644 --- a/retroshare-gui/src/util/log.cpp +++ b/retroshare-gui/src/util/log.cpp @@ -171,7 +171,12 @@ Log::LogMessage::~LogMessage() if (!--stream->ref) { if (stream->out && !stream->buf.isEmpty()) { QTextStream log(stream->out); - log << toString() << endl; + log << toString() << +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + Qt::endl; +#else + endl; +#endif log.flush(); } delete stream; From 0d37db307cb66421639440cfe02e0ff8f14a8735 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 18:55:04 +0200 Subject: [PATCH 037/147] Replaced some more QDateTime::setTime_t by DateTime::DateTimeFromTime_t --- retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp | 7 +++---- retroshare-gui/src/gui/Posted/PostedCardView.cpp | 7 +++---- retroshare-gui/src/gui/Posted/PostedItem.cpp | 7 +++---- retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp | 7 +++---- retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp | 4 ++-- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 3 +-- retroshare-gui/src/gui/msgs/MessageModel.cpp | 3 +-- .../src/gui/statistics/GlobalRouterStatistics.cpp | 6 ++---- .../src/gui/statistics/GxsTransportStatistics.cpp | 3 +-- 9 files changed, 19 insertions(+), 28 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp index 541cecac0..6bcf7a83f 100644 --- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp +++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp @@ -35,6 +35,7 @@ #include "util/HandleRichText.h" #include "gui/Identity/IdDialog.h" #include "gui/MainWindow.h" +#include "util/DateTime.h" #include "ui_BoardPostDisplayWidget_compact.h" #include "ui_BoardPostDisplayWidget_card.h" @@ -194,16 +195,14 @@ void BoardPostDisplayWidgetBase::baseSetup() voteDownButton()->setDisabled(true); fromLabel()->setId(mPost.mMeta.mAuthorId); titleLabel()->setText(tr( "

The author of this message (with ID %1) is banned.").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ; - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); dateLabel()->setText(timestamp); pictureLabel()->setDisabled(true); } else { - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs) + " " + tr("ago"); dateLabel()->setText(timestamp); diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.cpp b/retroshare-gui/src/gui/Posted/PostedCardView.cpp index 9824cfda2..5f7c6c286 100644 --- a/retroshare-gui/src/gui/Posted/PostedCardView.cpp +++ b/retroshare-gui/src/gui/Posted/PostedCardView.cpp @@ -31,6 +31,7 @@ #include "gui/common/FilesDefs.h" #include "util/qtthreadsutils.h" #include "util/HandleRichText.h" +#include "util/DateTime.h" #include "ui_PostedCardView.h" @@ -186,8 +187,7 @@ void PostedCardView::fill() ui->picture_frame->hide(); ui->fromLabel->setId(mPost.mMeta.mAuthorId); ui->titleLabel->setText(tr( "

The author of this message (with ID %1) is banned.").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ; - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); ui->dateLabel->setText(timestamp); } else { @@ -198,8 +198,7 @@ void PostedCardView::fill() //int desired_height = 1.5*(ui->voteDownButton->height() + ui->voteUpButton->height() + ui->scoreLabel->height()); //int desired_width = sqpixmap2.width()*desired_height/(float)sqpixmap2.height(); - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs); ui->dateLabel->setText(timestamp2); diff --git a/retroshare-gui/src/gui/Posted/PostedItem.cpp b/retroshare-gui/src/gui/Posted/PostedItem.cpp index 8f1cddf7d..aa5aea9c4 100644 --- a/retroshare-gui/src/gui/Posted/PostedItem.cpp +++ b/retroshare-gui/src/gui/Posted/PostedItem.cpp @@ -37,6 +37,7 @@ #include "PhotoView.h" #include "gui/Posted/PostedDialog.h" #include "ui_PostedItem.h" +#include "util/DateTime.h" #include @@ -498,8 +499,7 @@ void PostedItem::fill() ui->thumbnailLabel->setPicture( FilesDefs::getPixmapFromQtResourcePath(":/images/thumb-default.png")); ui->fromLabel->setId(mPost.mMeta.mAuthorId); ui->titleLabel->setText(tr( "

The author of this message (with ID %1) is banned.").arg(QString::fromStdString(mPost.mMeta.mAuthorId.toStdString()))) ; - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); ui->dateLabel->setText(timestamp); } else { @@ -514,8 +514,7 @@ void PostedItem::fill() ui->thumbnailLabel->setFixedSize(desired_width,desired_height); - QDateTime qtime; - qtime.setTime_t(mPost.mMeta.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(mPost.mMeta.mPublishTs); QString timestamp = qtime.toString("hh:mm dd-MMM-yyyy"); QString timestamp2 = misc::timeRelativeToNow(mPost.mMeta.mPublishTs); ui->dateLabel->setText(timestamp2); diff --git a/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp index 8dd0404d6..857ad0da8 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp @@ -22,6 +22,7 @@ #include "gui/gxs/GxsIdTreeWidgetItem.h" #include "gui/WikiPoos/WikiEditDialog.h" +#include "util/DateTime.h" #include @@ -727,10 +728,9 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token) { // From Forum stuff. - QDateTime qtime; + QDateTime qtime = DateTime::DateTimeFromTime_t(page.mMeta.mPublishTs); QString text; QString sort; - qtime.setTime_t(page.mMeta.mPublishTs); sort = qtime.toString("yyyyMMdd_hhmmss"); text = qtime.toString("dd/MM/yy hh:mm"); @@ -841,10 +841,9 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token) { // From Forum stuff. - QDateTime qtime; + QDateTime qtime = DateTime::DateTimeFromTime_t(snapshot.mMeta.mPublishTs); QString text; QString sort; - qtime.setTime_t(snapshot.mMeta.mPublishTs); sort = qtime.toString("yyyyMMdd_hhmmss"); text = qtime.toString("dd/MM/yy hh:mm"); diff --git a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp index 277b11e4f..85dc8826e 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentTreeWidget.cpp @@ -28,6 +28,7 @@ #include "gui/gxs/GxsCreateCommentDialog.h" #include "gui/gxs/GxsIdTreeWidgetItem.h" #include "util/qtthreadsutils.h" +#include "util/DateTime.h" #include #include @@ -798,8 +799,7 @@ void GxsCommentTreeWidget::insertComments(const std::vector& comme QString text; { - QDateTime qtime ; - qtime.setTime_t(comment.mMeta.mPublishTs) ; + QDateTime qtime = DateTime::DateTimeFromTime_t(comment.mMeta.mPublishTs) ; text = qtime.toString("yyyy-MM-dd hh:mm:ss") ; item->setText(PCITEM_COLUMN_DATE, text) ; diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index 18f518749..c52810218 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -670,8 +670,7 @@ QVariant RsGxsForumModel::displayRole(const ForumModelPostEntry& fmpe,int col) c if(fmpe.mPostFlags & ForumModelPostEntry::FLAG_POST_IS_MISSING) return QVariant(QString()); - QDateTime qtime; - qtime.setTime_t(fmpe.mPublishTs); + QDateTime qtime = DateTime::DateTimeFromTime_t(fmpe.mPublishTs); return QVariant(DateTime::formatDateTime(qtime)); } diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index dc2f16c7c..6e754b096 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -504,8 +504,7 @@ QVariant RsMessageModel::displayRole(const Rs::Msgs::MsgInfoSummary& fmpe,int co case COLUMN_THREAD_SPAM: case COLUMN_THREAD_READ:return QVariant(); case COLUMN_THREAD_DATE:{ - QDateTime qtime; - qtime.setTime_t(fmpe.ts); + QDateTime qtime = DateTime::DateTimeFromTime_t(fmpe.ts); return QVariant(DateTime::formatDateTime(qtime)); } diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index ec3b121f2..ae33bf7f3 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -188,10 +188,8 @@ void GlobalRouterStatistics::updateContent() if(nicknames.isEmpty()) nicknames = tr("Unknown"); - QDateTime routingtime; - routingtime.setTime_t(cache_infos[i].routing_time); - QDateTime senttime; - senttime.setTime_t(cache_infos[i].last_sent_time); + QDateTime routingtime = DateTime::DateTimeFromTime_t(cache_infos[i].routing_time); + QDateTime senttime = DateTime::DateTimeFromTime_t(cache_infos[i].last_sent_time); item -> setId(cache_infos[i].destination,COL_NICKNAME, false) ; item -> setData(COL_ID, Qt::DisplayRole, QString::number(cache_infos[i].mid,16).rightJustified(16,'0')); diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp index 72b986330..d96c4bab0 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp @@ -331,8 +331,7 @@ void GxsTransportStatistics::updateContent() rsIdentity->getIdDetails(meta.mAuthorId,idDetails); QPixmap pixmap ; - QDateTime qdatetime; - qdatetime.setTime_t(meta.mPublishTs); + QDateTime qdatetime = DateTime::DateTimeFromTime_t(meta.mPublishTs); if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) pixmap = GxsIdDetails::makeDefaultIcon(meta.mAuthorId,GxsIdDetails::SMALL); From 6251f36e3ecf1117911eb162d70fb5073c0f2744 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 21:18:36 +0200 Subject: [PATCH 038/147] Replaced deprecated QDateTime::toTime_t by QDateTime::toSecsSinceEpoch --- plugins/FeedReader/gui/FeedReaderFeedNotify.cpp | 3 ++- retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp | 3 ++- retroshare-gui/src/gui/advsearch/guiexprelement.cpp | 4 +++- retroshare-gui/src/gui/common/GroupTreeWidget.cpp | 2 +- retroshare-gui/src/gui/feeds/SecurityIpItem.cpp | 2 +- retroshare-gui/src/gui/feeds/SecurityItem.cpp | 2 +- retroshare-gui/src/util/DateTime.cpp | 9 +++++++++ retroshare-gui/src/util/DateTime.h | 3 +++ 8 files changed, 22 insertions(+), 6 deletions(-) diff --git a/plugins/FeedReader/gui/FeedReaderFeedNotify.cpp b/plugins/FeedReader/gui/FeedReaderFeedNotify.cpp index 23d95f50e..566229311 100644 --- a/plugins/FeedReader/gui/FeedReaderFeedNotify.cpp +++ b/plugins/FeedReader/gui/FeedReaderFeedNotify.cpp @@ -27,6 +27,7 @@ #include "FeedReaderFeedItem.h" #include "gui/settings/rsharesettings.h" #include "retroshare/rsiface.h" +#include "util/DateTime.h" FeedReaderFeedNotify::FeedReaderFeedNotify(RsFeedReader *feedReader, FeedReaderNotify *notify, QObject *parent) : FeedNotify(parent), mFeedReader(feedReader), mNotify(notify) @@ -135,7 +136,7 @@ FeedItem *FeedReaderFeedNotify::testFeedItem(FeedHolder */*parent*/) FeedMsgInfo msgInfo; msgInfo.title = tr("Test message").toUtf8().constData(); msgInfo.description = tr("This is a test message.").toUtf8().constData(); - msgInfo.pubDate = QDateTime::currentDateTime().toTime_t(); + msgInfo.pubDate = DateTime::DateTimeToTime_t(QDateTime::currentDateTime()); //TODO: parent? return new FeedReaderFeedItem(mFeedReader, mNotify, feedInfo, msgInfo); diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index c7a8310e1..9dd64ac8d 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -40,6 +40,7 @@ #include "util/RsQtVersion.h" #include "util/RsFile.h" #include "util/qtthreadsutils.h" +#include "util/DateTime.h" #include "retroshare/rsdisc.h" #include "retroshare/rsfiles.h" @@ -434,7 +435,7 @@ public: //Get Last Access on File if (file.exists()) - qi64LastDL = file.lastModified().toTime_t(); + qi64LastDL = DateTime::DateTimeToTime_t(file.lastModified()); } return QVariant(qi64LastDL) ; } diff --git a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp index cb146db1f..baf4264a3 100644 --- a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp +++ b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp @@ -21,6 +21,8 @@ *******************************************************************************/ #include "guiexprelement.h" +#include "util/DateTime.h" + #define STR_FIELDS_MIN_WFACTOR 20.0 #define SIZE_FIELDS_MIN_WFACTOR 8.0 #define DATE_FIELDS_MIN_WFACTOR 10.0 @@ -607,7 +609,7 @@ uint64_t ExprParamElement::getIntValueFromField(QString fieldName, bool isToFiel #else QDateTime time = dateEdit->date().startOfDay(); #endif - val = (uint64_t)time.toTime_t(); + val = (uint64_t) DateTime::DateTimeToTime_t(time); break; } case SizeSearch: diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 3f2092f32..49675913c 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -435,7 +435,7 @@ void GroupTreeWidget::fillGroupItems(QTreeWidgetItem *categoryItem, const QList< else { item->setText(GTW_COLUMN_LAST_POST, itemInfo.lastpost.toString(Qt::ISODate).replace("T"," ")); - item->setData(GTW_COLUMN_LAST_POST, ROLE_SORT, itemInfo.lastpost.toTime_t()); + item->setData(GTW_COLUMN_LAST_POST, ROLE_SORT, (qint64) DateTime::DateTimeToTime_t(itemInfo.lastpost)); } diff --git a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp index 6e543108d..6ba4df6f5 100644 --- a/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityIpItem.cpp @@ -110,7 +110,7 @@ void SecurityIpItem::updateItemStatic() } QDateTime currentTime = QDateTime::currentDateTime(); - ui->timeLabel->setText(DateTime::formatLongDateTime(currentTime.toTime_t())); + ui->timeLabel->setText(DateTime::formatLongDateTime(currentTime)); } void SecurityIpItem::updateItem() diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 584eee212..41d0a4b10 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -153,7 +153,7 @@ void SecurityItem::updateItemStatic() titleLabel->setText(title); QDateTime currentTime = QDateTime::currentDateTime(); - timeLabel->setText(DateTime::formatLongDateTime(currentTime.toTime_t())); + timeLabel->setText(DateTime::formatLongDateTime(currentTime)); if (mIsHome) { diff --git a/retroshare-gui/src/util/DateTime.cpp b/retroshare-gui/src/util/DateTime.cpp index f96be5052..2699ba0d3 100644 --- a/retroshare-gui/src/util/DateTime.cpp +++ b/retroshare-gui/src/util/DateTime.cpp @@ -87,3 +87,12 @@ QDateTime DateTime::DateTimeFromTime_t(time_t timeValue) return QDateTime::fromTime_t(timeValue); #endif } + +time_t DateTime::DateTimeToTime_t(const QDateTime& dateTime) +{ +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + return dateTime.toSecsSinceEpoch(); +#else + return dateTime.toTime_t(); +#endif +} diff --git a/retroshare-gui/src/util/DateTime.h b/retroshare-gui/src/util/DateTime.h index e26965b6e..4d38c48c1 100644 --- a/retroshare-gui/src/util/DateTime.h +++ b/retroshare-gui/src/util/DateTime.h @@ -52,6 +52,9 @@ public: /* Convert time_t to QDateTime */ static QDateTime DateTimeFromTime_t(time_t timeValue); + + /* Convert QDateTime to time_t */ + static time_t DateTimeToTime_t(const QDateTime& dateTime); }; #endif From 291b2f7cad172f000a8ce78cabd40712f97f7b4d Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 22:15:29 +0200 Subject: [PATCH 039/147] Fixed usage of QLayout::addWidget --- retroshare-gui/src/gui/common/HashBox.cpp | 2 +- retroshare-gui/src/gui/settings/NotifyPage.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/common/HashBox.cpp b/retroshare-gui/src/gui/common/HashBox.cpp index 0a96068e5..a046ac071 100644 --- a/retroshare-gui/src/gui/common/HashBox.cpp +++ b/retroshare-gui/src/gui/common/HashBox.cpp @@ -174,7 +174,7 @@ void HashBox::addAttachments(const QStringList& files,TransferRequestFlags tfl, hashingInfo.item = file; hashingInfo.flag = flag; mHashingInfos.push_back(hashingInfo); - ui->verticalLayout->addWidget(file, 1, 0); + ui->verticalLayout->addWidget(file, 1); } QApplication::processEvents(); diff --git a/retroshare-gui/src/gui/settings/NotifyPage.cpp b/retroshare-gui/src/gui/settings/NotifyPage.cpp index 8fb6fda49..c0b2ea1a0 100755 --- a/retroshare-gui/src/gui/settings/NotifyPage.cpp +++ b/retroshare-gui/src/gui/settings/NotifyPage.cpp @@ -129,7 +129,7 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WindowFlags flags) QCheckBox *enabledCheckBox = new QCheckBox(name, this); enabledCheckBox->setFont(font); - ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0, 0); + ui.notifyLayout->addWidget(enabledCheckBox, rowFeed, 0); connect(enabledCheckBox, SIGNAL(toggled(bool)), this, SLOT(notifyToggled())); QCheckBox *combinedCheckBox = new QCheckBox(tr("Combined"), this); From f0286740f493aa8d62dd87d8aab4bd27ac3a2e0c Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 20 Jul 2025 23:43:49 +0200 Subject: [PATCH 040/147] Replaced deprecated QDateTime::toString by QLocale::toString --- retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp | 3 ++- retroshare-gui/src/gui/Identity/IdDialog.cpp | 3 ++- .../src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp | 2 +- retroshare-gui/src/util/DateTime.cpp | 5 +++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp index 9056b5f31..c3e3129cb 100644 --- a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp @@ -28,6 +28,7 @@ #include "gui/common/FilesDefs.h" #include "gui/msgs/MessageComposer.h" #include "gui/RetroShareLink.h" +#include "util/DateTime.h" #include @@ -148,7 +149,7 @@ void IdDetailsDialog::loadIdentity(RsGxsIdGroup data) ui->autoBanIdentities_CB->setVisible(!data.mPgpId.isNull()) ; ui->banoption_label->setVisible(!data.mPgpId.isNull()) ; - ui->lineEdit_Created->setText(QDateTime::fromMSecsSinceEpoch(qint64(1000)*data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate)); + ui->lineEdit_Created->setText(QLocale::system().toString(DateTime::DateTimeFromTime_t(data.mMeta.mPublishTs), QLocale::ShortFormat)); time_t now = time(NULL) ; ui->lineEdit_LastUsed->setText(getHumanReadableDuration(now - data.mLastUsageTS)) ; diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 9d38ed5d3..0e63e54ed 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -50,6 +50,7 @@ #include "util/RsQtVersion.h" #include "util/rstime.h" #include "util/rsdebug.h" +#include "util/DateTime.h" #include "retroshare/rsgxsflags.h" #include "retroshare/rsmsgs.h" @@ -1653,7 +1654,7 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) /* get GPG Details from rsPeers */ RsPgpId ownPgpId = rsPeers->getGPGOwnId(); - ui->lineEdit_PublishTS->setText(QDateTime::fromMSecsSinceEpoch(qint64(1000)*data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate)); + ui->lineEdit_PublishTS->setText(QLocale::system().toString(DateTime::DateTimeFromTime_t(data.mMeta.mPublishTs), QLocale::ShortFormat)); //ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE)); ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString())); //ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString())); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 56f7568a5..2a8d1c2f1 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -227,7 +227,7 @@ void ChannelPostDelegate::paint(QPainter * painter, const QStyleOptionViewItem & y += font_height; y += font_height/2.0; - QString info_text = QDateTime::fromMSecsSinceEpoch(qint64(1000)*post.mMeta.mPublishTs).toString(Qt::DefaultLocaleShortDate); + QString info_text = QLocale::system().toString(DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs), QLocale::ShortFormat); if(post.mAttachmentCount > 0) info_text += ", " + QString::number(post.mAttachmentCount)+ " " +((post.mAttachmentCount>1)?tr("files"):tr("file")) + " (" + misc::friendlyUnit(qulonglong(post.mSize)) + ")" ; diff --git a/retroshare-gui/src/util/DateTime.cpp b/retroshare-gui/src/util/DateTime.cpp index 2699ba0d3..ea81e69fd 100644 --- a/retroshare-gui/src/util/DateTime.cpp +++ b/retroshare-gui/src/util/DateTime.cpp @@ -19,6 +19,7 @@ *******************************************************************************/ #include +#include #include "DateTime.h" #include "rshare.h" @@ -66,7 +67,7 @@ QString DateTime::formatDate(time_t dateValue) QString DateTime::formatDate(const QDate &dateValue) { - return dateValue.toString(Qt::SystemLocaleShortDate); + return QLocale::system().toString(dateValue, QLocale::ShortFormat); } QString DateTime::formatTime(time_t timeValue) @@ -76,7 +77,7 @@ QString DateTime::formatTime(time_t timeValue) QString DateTime::formatTime(const QTime &timeValue) { - return timeValue.toString(Qt::SystemLocaleShortDate); + return QLocale::system().toString(timeValue, QLocale::ShortFormat); } QDateTime DateTime::DateTimeFromTime_t(time_t timeValue) From 13b294838bf6d2fc784a83c81c71d546c999f125 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 00:37:10 +0200 Subject: [PATCH 041/147] Replaced deprecated QRegExp by QRegularExpression --- retroshare-gui/src/gui/advsearch/guiexprelement.cpp | 10 ++++++---- retroshare-gui/src/gui/advsearch/guiexprelement.h | 6 ++++-- retroshare-gui/src/gui/chat/ChatStyle.cpp | 7 ++++--- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 2 +- retroshare-gui/src/rshare.cpp | 6 +++--- retroshare-gui/src/util/HandleRichText.cpp | 5 +++-- retroshare-gui/src/util/RichTextEdit.cpp | 4 ++-- retroshare-gui/src/util/RsSyntaxHighlighter.cpp | 4 +++- 8 files changed, 26 insertions(+), 18 deletions(-) diff --git a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp index baf4264a3..26d623bde 100644 --- a/retroshare-gui/src/gui/advsearch/guiexprelement.cpp +++ b/retroshare-gui/src/gui/advsearch/guiexprelement.cpp @@ -20,6 +20,8 @@ * * *******************************************************************************/ +#include + #include "guiexprelement.h" #include "util/DateTime.h" @@ -400,10 +402,10 @@ void ExprParamElement::adjustForSearchType(ExprSearchType type) { // record which search type is active searchType = type; - QRegExp regExp("0|[1-9][0-9]*"); - numValidator = new QRegExpValidator(regExp, this); - QRegExp hexRegExp("[A-Fa-f0-9]*"); - hexValidator = new QRegExpValidator(hexRegExp, this); + QRegularExpression regExp("0|[1-9][0-9]*"); + numValidator = new QRegularExpressionValidator(regExp, this); + QRegularExpression hexRegExp("[A-Fa-f0-9]*"); + hexValidator = new QRegularExpressionValidator(hexRegExp, this); QHBoxLayout* hbox = static_cast(layout()); clearLayout(hbox); diff --git a/retroshare-gui/src/gui/advsearch/guiexprelement.h b/retroshare-gui/src/gui/advsearch/guiexprelement.h index 50ebeaa15..c64e15bcb 100644 --- a/retroshare-gui/src/gui/advsearch/guiexprelement.h +++ b/retroshare-gui/src/gui/advsearch/guiexprelement.h @@ -34,6 +34,8 @@ #include +class QRegularExpressionValidator; + enum ExprSearchType { NameSearch, @@ -191,8 +193,8 @@ public: virtual QString toString(); private: - QRegExpValidator * numValidator; - QRegExpValidator * hexValidator; + QRegularExpressionValidator * numValidator; + QRegularExpressionValidator * hexValidator; QFrame * rangeParamsFrame; bool inRangedConfig; uint64_t getIntValueFromField(QString fieldName, bool isToField=false,bool *ok = NULL); diff --git a/retroshare-gui/src/gui/chat/ChatStyle.cpp b/retroshare-gui/src/gui/chat/ChatStyle.cpp index 481f87e95..dab12f082 100644 --- a/retroshare-gui/src/gui/chat/ChatStyle.cpp +++ b/retroshare-gui/src/gui/chat/ChatStyle.cpp @@ -103,6 +103,7 @@ #include #include #include +#include #include "ChatStyle.h" #include "gui/settings/rsharesettings.h" @@ -376,7 +377,7 @@ QString ChatStyle::formatMessage(enumFormatMessage type QString strDate = DateTime::formatDate(timestamp.date()).prepend(QString("")).append(QString("")); QString strTime = DateTime::formatTime(timestamp.time()).prepend(QString("")).append(QString("")); - int bi = name.lastIndexOf(QRegExp(" \\(.*\\)")); //trim location from the end + int bi = name.lastIndexOf(QRegularExpression(" \\(.*\\)")); //trim location from the end QString strShortName = RsHtml::plainText(name.left(bi)).prepend(QString("")).append(QString("")); //handle /me @@ -384,9 +385,9 @@ QString ChatStyle::formatMessage(enumFormatMessage type //meName class for modifying the style of the name in the palce of /me if(me){ messageBody = messageBody.replace(messageBody.indexOf("/me "), 3, strShortName.prepend(QString("")).append(QString(""))); //replace only the first /me - style = style.remove(QRegExp("%nome%.*%/nome%")).remove("%me%").remove("%/me%"); + style = style.remove(QRegularExpression("%nome%.*%/nome%")).remove("%me%").remove("%/me%"); } else { - style = style.remove(QRegExp("%me%.*%/me%")).remove("%nome%").remove("%/nome%"); + style = style.remove(QRegularExpression("%me%.*%/me%")).remove("%nome%").remove("%/nome%"); } QString formatMsg = style.replace("%name%", strName) diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 6e1a3d39b..52994454b 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -640,7 +640,7 @@ void MessageWidget::fill(const std::string &msgId) ui.trans_ToText->setText(to_text); - int recipientsCount = ui.trans_ToText->toPlainText().split(QRegExp("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count(); + int recipientsCount = ui.trans_ToText->toPlainText().split(QRegularExpression("(\\s|\\n|\\r)+"), QtSkipEmptyParts).count(); ui.expandButton->setText( QString::number(recipientsCount)+ " " + tr("more")); if (recipientsCount >=20) { diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index 1cb0b5766..5dc08cc2e 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -311,8 +311,8 @@ void RsApplication::customizeDateFormat() QLocale locale = QLocale(); // set to default locale /* get long date format without weekday */ options.dateformat = locale.dateFormat(QLocale::LongFormat); - options.dateformat.replace(QRegExp("^dddd,*[^ ]* *('[^']+' )*"), ""); - options.dateformat.replace(QRegExp(",* *dddd"), ""); + options.dateformat.replace(QRegularExpression("^dddd,*[^ ]* *('[^']+' )*"), ""); + options.dateformat.replace(QRegularExpression(",* *dddd"), ""); options.dateformat = options.dateformat.trimmed(); } diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index fcfe6d2b9..e74cc9071 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "HandleRichText.h" #include "gui/RetroShareLink.h" @@ -1171,7 +1172,7 @@ void RsHtml::optimizeHtml(QString &text, unsigned int flag /*= 0*/ { // remove doctype - text.remove(QRegExp("]*>")); + text.remove(QRegularExpression("]*>")); //remove all prepend char that make doc.setContent() fail text.remove(0,text.indexOf("<")); // Save Space and Tab because doc loose it. @@ -1253,7 +1254,7 @@ QString RsHtml::makeQuotedText(RSTextBrowser *browser) { text = browser->toPlainText(); } - QStringList sl = text.split(QRegExp("[\r\n]"),QtSkipEmptyParts); + QStringList sl = text.split(QRegularExpression("[\r\n]"),QtSkipEmptyParts); text = sl.join("\n> "); text.replace("\n> >","\n>>"); // Don't add space for already quotted lines. text.replace(QChar(-4)," ");//Char used when image on text. diff --git a/retroshare-gui/src/util/RichTextEdit.cpp b/retroshare-gui/src/util/RichTextEdit.cpp index 020b13db9..8233058f9 100644 --- a/retroshare-gui/src/util/RichTextEdit.cpp +++ b/retroshare-gui/src/util/RichTextEdit.cpp @@ -547,9 +547,9 @@ void RichTextEdit::slotClipboardDataChanged() { QString RichTextEdit::toHtml() const { QString s = f_textedit->toHtml(); // convert emails to links - s = s.replace(QRegExp("(<[^a][^>]+>(?:]+>)?|\\s)([a-zA-Z\\d]+@[a-zA-Z\\d]+\\.[a-zA-Z]+)"), "\\1\\2"); + s = s.replace(QRegularExpression("(<[^a][^>]+>(?:]+>)?|\\s)([a-zA-Z\\d]+@[a-zA-Z\\d]+\\.[a-zA-Z]+)"), "\\1\\2"); // convert links - s = s.replace(QRegExp("(<[^a][^>]+>(?:]+>)?|\\s)((?:https?|ftp|file)://[^\\s'\"<>]+)"), "\\1\\2"); + s = s.replace(QRegularExpression("(<[^a][^>]+>(?:]+>)?|\\s)((?:https?|ftp|file)://[^\\s'\"<>]+)"), "\\1\\2"); // see also: Utils::linkify() return s; } diff --git a/retroshare-gui/src/util/RsSyntaxHighlighter.cpp b/retroshare-gui/src/util/RsSyntaxHighlighter.cpp index ed05b702c..c204932a7 100644 --- a/retroshare-gui/src/util/RsSyntaxHighlighter.cpp +++ b/retroshare-gui/src/util/RsSyntaxHighlighter.cpp @@ -18,6 +18,8 @@ * * *******************************************************************************/ +#include + #include "RsSyntaxHighlighter.h" RsSyntaxHighlighter::RsSyntaxHighlighter(QTextEdit *parent) @@ -65,7 +67,7 @@ void RsSyntaxHighlighter::highlightBlock(const QString &text) { if (text == "") return; - QRegExp endl("[\\r\\n\\x2028]"); //Usually 0x2028 character is used for newline, no idea why + QRegularExpression endl("[\\r\\n\\x2028]"); //Usually 0x2028 character is used for newline, no idea why int index = 0; QStringList lines = text.split(endl); foreach (const QString &cLine, lines) { From fad77747677c187f090465dfc293b006b05c1565 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 01:04:24 +0200 Subject: [PATCH 042/147] Added Qt dependent macro for QSortFilterProxyModel::setFilterRegularExpression/setFilterRegExp --- .../gui/FileTransfer/SharedFilesDialog.cpp | 4 +- .../src/gui/FileTransfer/TransfersDialog.cpp | 2 +- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- .../src/gui/common/NewFriendList.cpp | 8 ++-- .../gui/gxsforums/GxsForumThreadWidget.cpp | 4 +- .../src/gui/msgs/MessagesDialog.cpp | 8 ++-- .../src/gui/settings/JsonApiPage.cc | 42 ++++++++++--------- retroshare-gui/src/util/RsQtVersion.h | 6 +++ 8 files changed, 42 insertions(+), 34 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 49b65cc64..a865d38c7 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -199,7 +199,7 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent) tree_proxyModel->setSortRole(RetroshareDirModel::SortRole); tree_proxyModel->sort(SHARED_FILES_DIALOG_COLUMN_NAME); tree_proxyModel->setFilterRole(RetroshareDirModel::FilterRole); - tree_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ; + QSortFilterProxyModel_setFilterRegularExpression(tree_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ; flat_proxyModel = new SFDSortFilterProxyModel(flat_model, this); flat_proxyModel->setSourceModel(flat_model); @@ -207,7 +207,7 @@ SharedFilesDialog::SharedFilesDialog(bool remote_mode, QWidget *parent) flat_proxyModel->setSortRole(RetroshareDirModel::SortRole); flat_proxyModel->sort(SHARED_FILES_DIALOG_COLUMN_NAME); flat_proxyModel->setFilterRole(RetroshareDirModel::FilterRole); - flat_proxyModel->setFilterRegExp(QRegExp(QString(SHARED_FILES_DIALOG_FILTER_STRING))) ; + QSortFilterProxyModel_setFilterRegularExpression(flat_proxyModel, QString(SHARED_FILES_DIALOG_FILTER_STRING)) ; connect(ui.filterClearButton, SIGNAL(clicked()), this, SLOT(clearFilter())); connect(ui.filterStartButton, SIGNAL(clicked()), this, SLOT(startFilter())); diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index 9dd64ac8d..b35fcf138 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -2647,5 +2647,5 @@ void TransfersDialog::filterChanged(const QString& /*text*/) int filterColumn = ui.filterLineEdit->currentFilter(); QString text = ui.filterLineEdit->text(); DLLFilterModel->setFilterKeyColumn(filterColumn); - DLLFilterModel->setFilterRegExp(text); + QSortFilterProxyModel_setFilterRegularExpression(DLLFilterModel, text); } diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 0e63e54ed..d40ca01ec 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -231,7 +231,7 @@ IdDialog::IdDialog(QWidget *parent) mProxyModel->setSortRole(RsIdentityListModel::SortRole); mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); mProxyModel->setFilterRole(RsIdentityListModel::FilterRole); - mProxyModel->setFilterRegExp(QRegExp(RsIdentityListModel::FilterString)); + QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, RsIdentityListModel::FilterString); ui->idTreeWidget->setModel(mProxyModel); //ui->idTreeWidget->setSelectionModel(new QItemSelectionModel(mProxyModel));// useless in Qt5. diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 49f392b66..97de3e2ab 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -213,7 +213,7 @@ NewFriendList::NewFriendList(QWidget */*parent*/) : /* RsAutoUpdatePage(5000,par mProxyModel->setSortRole(RsFriendListModel::SortRole); mProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); mProxyModel->setFilterRole(RsFriendListModel::FilterRole); - mProxyModel->setFilterRegExp(QRegExp(RsFriendListModel::FilterString)); + QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, RsFriendListModel::FilterString); ui->peerTreeWidget->setModel(mProxyModel); RSElidedItemDelegate *itemDelegate = new RSElidedItemDelegate(this); @@ -558,7 +558,7 @@ void NewFriendList::processSettings(bool load) void NewFriendList::toggleSortByState(bool sort) { mProxyModel->setSortByState(sort); - mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ;// triggers a re-display. + QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ;// triggers a re-display. processSettings(false); } @@ -1623,7 +1623,7 @@ bool NewFriendList::getOrCreateGroup(const std::string& name, uint flag, RsNodeG void NewFriendList::setShowUnconnected(bool show) { mProxyModel->setShowOfflineNodes(show); - mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ;// triggers a re-display. + QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ;// triggers a re-display. } bool NewFriendList::isColumnVisible(int col) const @@ -1682,7 +1682,7 @@ void NewFriendList::filterItems(const QString &text) mModel->setFilter(RsFriendListModel::FILTER_TYPE_ID,lst); // We do this in order to trigger a new filtering action in the proxy model. - mProxyModel->setFilterRegExp(QRegExp(QString(RsFriendListModel::FilterString))) ; + QSortFilterProxyModel_setFilterRegularExpression(mProxyModel, QString(RsFriendListModel::FilterString)) ; if(!lst.empty()) ui->peerTreeWidget->expandAll(); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 9a8a927d9..59f68663d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -264,7 +264,7 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget ui->threadTreeWidget->setModel(mThreadProxyModel); mThreadProxyModel->setFilterRole(RsGxsForumModel::FilterRole); - mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ; + QSortFilterProxyModel_setFilterRegularExpression(mThreadProxyModel, QString(RsGxsForumModel::FilterString)) ; ui->threadTreeWidget->setSortingEnabled(true); @@ -1854,7 +1854,7 @@ void GxsForumThreadWidget::filterItems(const QString& text) mThreadModel->setFilter(filterColumn,lst,count) ; // We do this in order to trigger a new filtering action in the proxy model. - mThreadProxyModel->setFilterRegExp(QRegExp(QString(RsGxsForumModel::FilterString))) ; + QSortFilterProxyModel_setFilterRegularExpression(mThreadProxyModel, QString(RsGxsForumModel::FilterString)) ; if(!lst.empty()) ui->threadTreeWidget->expandAll(); diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index d6f82417a..48a14bd2d 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -157,7 +157,7 @@ MessagesDialog::MessagesDialog(QWidget *parent) mMessageProxyModel->setSortRole(RsMessageModel::SortRole); mMessageProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); mMessageProxyModel->setFilterRole(RsMessageModel::FilterRole); - mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); + QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); ui.messageTreeWidget->setModel(mMessageProxyModel); @@ -1016,7 +1016,7 @@ void MessagesDialog::changeQuickView(int newrow) } mMessageModel->setQuickViewFilter(f); - mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model + QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model } // click in messageTreeWidget @@ -1263,7 +1263,7 @@ void MessagesDialog::filterChanged(const QString& text) } mMessageModel->setFilter(f,items); - mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model + QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model QCoreApplication::processEvents(); } @@ -1289,7 +1289,7 @@ void MessagesDialog::filterColumnChanged(int column) QStringList items = ui.filterLineEdit->text().split(' ',QtSkipEmptyParts); mMessageModel->setFilter(f,items); - mMessageProxyModel->setFilterRegExp(QRegExp(RsMessageModel::FilterString)); // this triggers the update of the proxy model + QSortFilterProxyModel_setFilterRegularExpression(mMessageProxyModel, RsMessageModel::FilterString); // this triggers the update of the proxy model // save index Settings->setValueToGroup("MessageDialog", "filterColumn", column); diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.cc b/retroshare-gui/src/gui/settings/JsonApiPage.cc index ace092e0c..a7ad05574 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.cc +++ b/retroshare-gui/src/gui/settings/JsonApiPage.cc @@ -28,6 +28,8 @@ #include #include #include +#include +#include #define IMAGE_LEDOFF ":/images/ledoff1.png" #define IMAGE_LEDON ":/images/ledon1.png" @@ -47,8 +49,8 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) // This limits the possible tokens to alphanumeric QString anRange = "[a-zA-Z0-9]+"; - QRegExp anRegex ("^" + anRange + ":" + anRange + "$"); - QRegExpValidator *anValidator = new QRegExpValidator(anRegex, this); + QRegularExpression anRegex ("^" + anRange + ":" + anRange + "$"); + QRegularExpressionValidator *anValidator = new QRegularExpressionValidator(anRegex, this); ui.tokenLineEdit->setValidator(anValidator); @@ -56,8 +58,8 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) QString ipRange = "(?:[0-1]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])"; // You may want to use QRegularExpression for new code with Qt 5 (not mandatory). - QRegExp ipRegex ("^" + ipRange + "\\." + ipRange + "\\." + ipRange + "\\." + ipRange + "$"); - QRegExpValidator *ipValidator = new QRegExpValidator(ipRegex, this); + QRegularExpression ipRegex ("^" + ipRange + "\\." + ipRange + "\\." + ipRange + "\\." + ipRange + "$"); + QRegularExpressionValidator *ipValidator = new QRegularExpressionValidator(ipRegex, this); ui.listenAddressLineEdit->setValidator(ipValidator); ui.providersListView->setSelectionMode(QAbstractItemView::NoSelection); // prevents edition. @@ -232,22 +234,22 @@ void JsonApiPage::addTokenClicked() whileBlocking(ui.tokensListView)->setModel(new QStringListModel(newTk)); } -void JsonApiPage::removeTokenClicked() -{ - QString token(ui.tokenLineEdit->text()); - std::string tokenStr = token.toStdString(); - rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":"))); - - QStringList newTk; - - for(const auto& it : rsJsonApi->getAuthorizedTokens()) - newTk.push_back( - QString::fromStdString(it.first) + ":" + - QString::fromStdString(it.second) ); - - whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) ); -} - +void JsonApiPage::removeTokenClicked() +{ + QString token(ui.tokenLineEdit->text()); + std::string tokenStr = token.toStdString(); + rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":"))); + + QStringList newTk; + + for(const auto& it : rsJsonApi->getAuthorizedTokens()) + newTk.push_back( + QString::fromStdString(it.first) + ":" + + QString::fromStdString(it.second) ); + + whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) ); +} + void JsonApiPage::tokenClicked(const QModelIndex& index) { ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString()); diff --git a/retroshare-gui/src/util/RsQtVersion.h b/retroshare-gui/src/util/RsQtVersion.h index dc3000969..ae11dff70 100644 --- a/retroshare-gui/src/util/RsQtVersion.h +++ b/retroshare-gui/src/util/RsQtVersion.h @@ -49,4 +49,10 @@ #define QtSkipEmptyParts QString::SkipEmptyParts #endif +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#define QSortFilterProxyModel_setFilterRegularExpression(proxyModel, pattern) proxyModel->setFilterRegularExpression(pattern); +#else +#define QSortFilterProxyModel_setFilterRegularExpression(proxyModel, pattern) proxyModel->setFilterRegExp(pattern); +#endif + #endif From fce618f2aabf148d8e0a5b29b8a0730b25355430 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 15:04:57 +0200 Subject: [PATCH 043/147] Added Qt dependent macro for QFontMetrics::horizontalAdvance/width --- retroshare-gui/src/gui/AboutWidget.cpp | 3 ++- .../src/gui/Circles/CreateCircleDialog.cpp | 3 ++- .../src/gui/FileTransfer/DLListDelegate.cpp | 3 ++- .../src/gui/FileTransfer/ULListDelegate.cpp | 3 ++- retroshare-gui/src/gui/Identity/IdDialog.cpp | 2 +- .../src/gui/common/LineEditClear.cpp | 3 ++- .../src/gui/common/RSGraphWidget.cpp | 5 +++-- retroshare-gui/src/gui/elastic/elnode.cpp | 3 ++- .../GxsChannelPostsWidgetWithModel.cpp | 10 ++++----- .../src/gui/msgs/MessagesDialog.cpp | 16 +++++++------- .../gui/settings/RSPermissionMatrixWidget.cpp | 21 ++++++++++--------- .../src/gui/statistics/BwCtrlWindow.cpp | 2 +- .../gui/statistics/GlobalRouterStatistics.cpp | 17 ++++++++------- .../src/gui/statistics/GxsIdStatistics.cpp | 10 ++++----- retroshare-gui/src/main.cpp | 3 ++- retroshare-gui/src/util/RetroStyleLabel.cpp | 4 +++- retroshare-gui/src/util/RsQtVersion.h | 6 ++++++ 17 files changed, 66 insertions(+), 48 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index 9f5082fbd..dfd738dc9 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -33,6 +33,7 @@ #include #include #include "settings/rsharesettings.h" +#include "util/RsQtVersion.h" #include #include @@ -306,7 +307,7 @@ void AWidget::drawBitField() AWidget::AWidget() : page(0), density(5) , mImagesReady(false), mState(0), mTimerId(0) - , mStep(1.0f), mMaxStep(QFontMetricsF(font()).width(' ')) + , mStep(1.0f), mMaxStep(QFontMetrics_horizontalAdvance(QFontMetricsF(font()), ' ')) { setMouseTracking(true); //startTimer(15); diff --git a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp index 92003e0a6..af8d128b7 100644 --- a/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp +++ b/retroshare-gui/src/gui/Circles/CreateCircleDialog.cpp @@ -38,6 +38,7 @@ #include "gui/gxs/GxsIdDetails.h" #include "gui/Identity/IdDialog.h" #include "gui/Identity/IdEditDialog.h" +#include "util/RsQtVersion.h" //#define DEBUG_CREATE_CIRCLE_DIALOG 1 @@ -74,7 +75,7 @@ CreateCircleDialog::CreateCircleDialog() ui.IdFilter->addFilter(QIcon(), headerText, RSCIRCLEID_COL_KEYID, QString("%1 %2").arg(tr("Search"), headerText)); /* Set initial column width */ - int fontWidth = QFontMetricsF(ui.treeWidget_IdList->font()).width("W"); + int fontWidth = QFontMetrics_horizontalAdvance(QFontMetricsF(ui.treeWidget_IdList->font()), "W"); ui.treeWidget_IdList->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth); ui.treeWidget_membership->setColumnWidth(RSCIRCLEID_COL_NICKNAME, 17 * fontWidth); diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 44d8580f0..6daa350ca 100755 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -30,6 +30,7 @@ #include "DLListDelegate.h" #include "util/DateTime.h" +#include "util/RsQtVersion.h" Q_DECLARE_METATYPE(FileProgressInfo) @@ -278,7 +279,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti QSize DLListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { - float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString()); + float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString()); int S = QFontMetricsF(option.font).height()*1.5 ; return QSize(w,S); diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp index 377205d3e..9eefe76f5 100755 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp @@ -22,6 +22,7 @@ #include "ULListDelegate.h" #include "xprogressbar.h" +#include "util/RsQtVersion.h" Q_DECLARE_METATYPE(FileProgressInfo) @@ -179,7 +180,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti QSize ULListDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { - float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString()); + float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString()); int S = QFontMetricsF(option.font).height()*1.5 ; return QSize(w,S); diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index d40ca01ec..65351e3f0 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -394,7 +394,7 @@ IdDialog::IdDialog(QWidget *parent) /* Set initial section sizes */ QHeaderView * circlesheader = ui->treeWidget_membership->header () ; - circlesheader->resizeSection (CIRCLEGROUP_CIRCLE_COL_GROUPNAME, fm.width("Circle name")*1.5) ; + circlesheader->resizeSection (CIRCLEGROUP_CIRCLE_COL_GROUPNAME, QFontMetrics_horizontalAdvance(fm, "Circle name")*1.5) ; ui->treeWidget_membership->setColumnWidth(CIRCLEGROUP_CIRCLE_COL_GROUPNAME, 270); /* Setup tree */ diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index cf45bc75b..1a91db591 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -20,6 +20,7 @@ #include "gui/common/FilesDefs.h" #include "LineEditClear.h" +#include "util/RsQtVersion.h" #include #include @@ -237,7 +238,7 @@ void LineEditClear::setFilterButtonIcon(const QIcon &icon) ensurePolished(); #if !defined(Q_OS_DARWIN) QFontMetrics fm(this->font()); - QSize size(fm.width("___"), fm.height()); + QSize size(QFontMetrics_horizontalAdvance(fm, "___"), fm.height()); mFilterButton->setFixedSize(size); mFilterButton->setIconSize(size); #endif diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index c2a4a4581..f642a3077 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -35,6 +35,7 @@ #include #include "rshare.h" #include "RSGraphWidget.h" +#include "util/RsQtVersion.h" #if QT_VERSION < 0x040700 #include @@ -655,12 +656,12 @@ void RSGraphWidget::paintScale1() if (_flags & RSGRAPH_FLAGS_DARK_STYLE){ _painter->setPen(SCALE_COLOR_DARK); - _painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text); + _painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetrics_horizontalAdvance(QFontMetricsF(font()), text) - 4*fact, pos+0.4*FS), text); _painter->setPen(GRID_COLOR_DARK); _painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos)); }else{ _painter->setPen(SCALE_COLOR); - _painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text); + _painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetrics_horizontalAdvance(QFontMetricsF(font()), text) - 4*fact, pos+0.4*FS), text); _painter->setPen(GRID_COLOR); _painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos)); } diff --git a/retroshare-gui/src/gui/elastic/elnode.cpp b/retroshare-gui/src/gui/elastic/elnode.cpp index 86bb4e31e..bf5e231c6 100644 --- a/retroshare-gui/src/gui/elastic/elnode.cpp +++ b/retroshare-gui/src/gui/elastic/elnode.cpp @@ -38,6 +38,7 @@ #include "edge.h" #include "elnode.h" #include "graphwidget.h" +#include "util/RsQtVersion.h" #define IMAGE_AUTHED ":/images/accepted16.png" #define IMAGE_DENIED ":/images/denied16.png" @@ -313,7 +314,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid if (!mDeterminedBB) { - QRect textBox = painter->boundingRect(-10, 5*f, QFontMetricsF(graph->font()).width(txt), 1.5*m, Qt::AlignVCenter, QString::fromUtf8(_desc_string.c_str())); + QRect textBox = painter->boundingRect(-10, 5*f, QFontMetrics_horizontalAdvance(QFontMetricsF(graph->font()), txt), 1.5*m, Qt::AlignVCenter, QString::fromUtf8(_desc_string.c_str())); mBBWidth = textBox.width()+40*f; mDeterminedBB = true; } diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index 2a8d1c2f1..a0d3ed95e 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -355,9 +355,9 @@ QSize ChannelPostFilesDelegate::sizeHint(const QStyleOptionViewItem& option, con switch(index.column()) { - case RsGxsChannelPostFilesModel::COLUMN_FILES_NAME: return QSize(1.1*fm.width(QString::fromUtf8(file.mName.c_str())),fm.height()); - case RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE: return QSize(1.1*fm.width(misc::friendlyUnit(qulonglong(file.mSize))),fm.height()); - case RsGxsChannelPostFilesModel::COLUMN_FILES_DATE: return QSize(1.1*fm.width(QDateTime::fromMSecsSinceEpoch(file.mPublishTime*1000).toString("MM/dd/yyyy, hh:mm")),fm.height()); + case RsGxsChannelPostFilesModel::COLUMN_FILES_NAME: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, QString::fromUtf8(file.mName.c_str())),fm.height()); + case RsGxsChannelPostFilesModel::COLUMN_FILES_SIZE: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, misc::friendlyUnit(qulonglong(file.mSize))),fm.height()); + case RsGxsChannelPostFilesModel::COLUMN_FILES_DATE: return QSize(1.1*QFontMetrics_horizontalAdvance(fm, QDateTime::fromMSecsSinceEpoch(file.mPublishTime*1000).toString("MM/dd/yyyy, hh:mm")),fm.height()); default: case RsGxsChannelPostFilesModel::COLUMN_FILES_FILE: return QSize(option.rect.width(),GxsChannelFilesStatusWidget(file).height()); } @@ -463,8 +463,8 @@ GxsChannelPostsWidgetWithModel::GxsChannelPostsWidgetWithModel(const RsGxsGroupI QHeaderView * channelpostfilesheader = ui->channelPostFiles_TV->header () ; QHeaderView * channelfilesheader = ui->channelFiles_TV->header () ; - channelpostfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, fm.width("RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z")); - channelfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, fm.width("RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z")); + channelpostfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, QFontMetrics_horizontalAdvance(fm, "RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z")); + channelfilesheader->resizeSection (RsGxsChannelPostFilesModel::COLUMN_FILES_NAME, QFontMetrics_horizontalAdvance(fm, "RetroShare-v0.6.5-1487-g6714648e5-Windows-x64-portable-20200518-Qt-5.14.2.7z")); /* Initialize feed widget */ //ui->feedWidget->setSortRole(ROLE_PUBLISH, Qt::DescendingOrder); diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 48a14bd2d..8b5067ae6 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -209,15 +209,15 @@ MessagesDialog::MessagesDialog(QWidget *parent) ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_CONTENT,true); ui.messageTreeWidget->setColumnHidden(RsMessageModel::COLUMN_THREAD_MSGID,true); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_STAR, fm.width('0')*1.5); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_ATTACHMENT, fm.width('0')*1.5); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_READ, fm.width('0')*1.5); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SPAM, fm.width('0')*1.5); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_STAR, QFontMetrics_horizontalAdvance(fm, '0')*1.5); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_ATTACHMENT, QFontMetrics_horizontalAdvance(fm, '0')*1.5); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_READ, QFontMetrics_horizontalAdvance(fm, '0')*1.5); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SPAM, QFontMetrics_horizontalAdvance(fm, '0')*1.5); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SUBJECT, fm.width("You have a message")*3.0); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_AUTHOR, fm.width("[Retroshare]")*1.1); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_TO, fm.width("[Retroshare]")*1.1); - msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_DATE, fm.width("01/01/1970")*1.1); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_SUBJECT, QFontMetrics_horizontalAdvance(fm, "You have a message")*3.0); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_AUTHOR, QFontMetrics_horizontalAdvance(fm, "[Retroshare]")*1.1); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_TO, QFontMetrics_horizontalAdvance(fm, "[Retroshare]")*1.1); + msgwheader->resizeSection (RsMessageModel::COLUMN_THREAD_DATE, QFontMetrics_horizontalAdvance(fm, "01/01/1970")*1.1); msgwheader->setSectionResizeMode(RsMessageModel::COLUMN_THREAD_SUBJECT, QHeaderView::Interactive); msgwheader->setSectionResizeMode(RsMessageModel::COLUMN_THREAD_AUTHOR, QHeaderView::Interactive); diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp index 76622625b..20937de63 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp @@ -37,6 +37,7 @@ #include #include "rsitems/rsserviceids.h" #include +#include "util/RsQtVersion.h" #define NOT_IMPLEMENTED std::cerr << __PRETTY_FUNCTION__ << ": not yet implemented." << std::endl; @@ -300,7 +301,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) if(name.length() > 20 + 3) name = name.left(20)+"..." ; - peer_name_size = std::max(peer_name_size, fm.width(name)) ; + peer_name_size = std::max(peer_name_size, QFontMetrics_horizontalAdvance(fm, name)) ; names.push_back(name) ; } @@ -315,13 +316,13 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) for(std::list::const_iterator it(ssllist.begin());it!=ssllist.end();++it,++i) { - float X = S*fMATRIX_START_X + peer_name_size - fm.width(names[i]) ; + float X = S*fMATRIX_START_X + peer_name_size - QFontMetrics_horizontalAdvance(fm, names[i]) ; float Y = S*fMATRIX_START_Y + (i+0.5)*S*fROW_SIZE + line_height/2.0f-2 ; _painter->drawText(QPointF(X,Y),names[i]) ; if(*it == _current_peer_id) - _painter->drawLine(QPointF(X,Y+3),QPointF(X+fm.width(names[i]),Y+3)) ; + _painter->drawLine(QPointF(X,Y+3),QPointF(X+QFontMetrics_horizontalAdvance(fm, names[i]),Y+3)) ; y += line_height ; } @@ -336,7 +337,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) for(std::map::const_iterator it(ownServices.mServiceList.begin());it!=ownServices.mServiceList.end();++it,++i) { QString name = QString::fromUtf8(it->second.mServiceName.c_str()) ; - int text_width = fm.width(name) ; + int text_width = QFontMetrics_horizontalAdvance(fm, name) ; int X = matrix_start_x + S*fCOL_SIZE/2 - 2 + i*S*fCOL_SIZE - text_width/2; @@ -490,11 +491,11 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) QFontMetrics fm(font); int text_size_x = 0 ; - text_size_x = std::max(text_size_x,fm.width(service_name)); - text_size_x = std::max(text_size_x,fm.width(peer_name)); - text_size_x = std::max(text_size_x,fm.width(peer_id)); - text_size_x = std::max(text_size_x,fm.width(local_status)); - text_size_x = std::max(text_size_x,fm.width(remote_status)); + text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, service_name)); + text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, peer_name)); + text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, peer_id)); + text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, local_status)); + text_size_x = std::max(text_size_x,QFontMetrics_horizontalAdvance(fm, remote_status)); // draw a half-transparent rectangle @@ -558,7 +559,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) QRect position = computeNodePosition(0,i,false) ; int popup_x = position.x() + (50 * S / 14.0); int popup_y = position.y() - (10 * S / 14.0) + line_height; - int popup_width = std::max((int)td.size().width(), fm.width(service_name)) + S; + int popup_width = std::max((int)td.size().width(), QFontMetrics_horizontalAdvance(fm, service_name)) + S; int popup_height = td.size().height() + line_height*2; while (popup_x + popup_width > _max_width) popup_x -= S; diff --git a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp index 7eec812ac..e2ac17ce9 100644 --- a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp @@ -172,7 +172,7 @@ QSize BWListDelegate::sizeHint(const QStyleOptionViewItem & option/*option*/, co float FS = QFontMetricsF(option.font).height(); //float fact = FS/14.0 ; - float w = QFontMetricsF(option.font).width(index.data(Qt::DisplayRole).toString()); + float w = QFontMetrics_horizontalAdvance(QFontMetricsF(option.font), index.data(Qt::DisplayRole).toString()); return QSize(w,FS*1.2); //return QSize(50*fact,17*fact); diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index ae33bf7f3..67013e1dc 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -45,6 +45,7 @@ #include "util/DateTime.h" #include "util/RsQtVersion.h" #include "util/misc.h" +#include "util/RsQtVersion.h" #define COL_ID 0 #define COL_NICKNAME 1 @@ -275,7 +276,7 @@ void GlobalRouterStatisticsWidget::updateContent() QFontMetricsF fm_monospace(monospace_f) ; QFontMetricsF fm_times(times_f) ; - static const int cellx = fm_monospace.width(QString(" ")) ; + static const int cellx = QFontMetrics_horizontalAdvance(fm_monospace, QString(" ")) ; static const int celly = fm_monospace.height() ; maxHeight = 500*fact ; @@ -316,11 +317,11 @@ void GlobalRouterStatisticsWidget::updateContent() for(int i=0;i<100*fact;++i) { painter.setPen(colorScale(i/100.0/fact)) ; - painter.drawLine(ox+fm_times.width(Q)+i,oy+fm_times.height()*0.5,ox+fm_times.width(Q)+i,oy+fm_times.height()) ; + painter.drawLine(ox+QFontMetrics_horizontalAdvance(fm_times, Q)+i,oy+fm_times.height()*0.5,ox+QFontMetrics_horizontalAdvance(fm_times, Q)+i,oy+fm_times.height()) ; } painter.setPen(QColor::fromRgb(0,0,0)) ; - painter.drawText(ox+fm_times.width(Q) + 102*fact,oy+celly,")") ; + painter.drawText(ox+QFontMetrics_horizontalAdvance(fm_times, Q) + 102*fact,oy+celly,")") ; oy += celly ; oy += celly ; @@ -370,21 +371,21 @@ void GlobalRouterStatisticsWidget::updateContent() painter.drawText(ox+2*cellx,oy+celly,ids) ; for(uint32_t i=0;isecond[i])) ; + painter.fillRect(ox+i*cellx+QFontMetrics_horizontalAdvance(fm_monospace, ids),oy+0.15*celly,cellx,celly,colorScale(it->second[i])) ; if(n == mCurrentN) { current_probs = it->second ; current_oy = oy ; current_id = it->first ; - current_width = ox+matrix_info.friend_ids.size()*cellx+fm_monospace.width(ids); + current_width = ox+matrix_info.friend_ids.size()*cellx+QFontMetrics_horizontalAdvance(fm_monospace, ids); } oy += celly ; //} } - mMaxWheelZoneX = ox+matrix_info.friend_ids.size()*cellx + fm_monospace.width(ids); + mMaxWheelZoneX = ox+matrix_info.friend_ids.size()*cellx + QFontMetrics_horizontalAdvance(fm_monospace, ids); RsIdentityDetails iddetails ; if(rsIdentity->getIdDetails(current_id,iddetails)) @@ -397,14 +398,14 @@ void GlobalRouterStatisticsWidget::updateContent() painter.setPen(QColor::fromRgb(0,0,0)) ; painter.setPen(QColor::fromRgb(127,127,127)); - painter.drawRect(ox+2*cellx,current_oy+0.15*celly,fm_monospace.width(ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ; + painter.drawRect(ox+2*cellx,current_oy+0.15*celly,QFontMetrics_horizontalAdvance(fm_monospace, ids)+cellx*matrix_info.friend_ids.size()- 2*cellx,celly) ; float total_length = (matrix_info.friend_ids.size()+2)*cellx ; if(!current_probs.empty()) for(uint32_t i=0;i #include +#include "util/RsQtVersion.h" + RetroStyleLabel::RetroStyleLabel(QWidget * parent, Mode mode, Qt::AlignmentFlag hAlign) : QLabel(parent), _mode(mode) { @@ -206,7 +208,7 @@ void RetroStyleLabel::mouseReleaseEvent(QMouseEvent * event) { void RetroStyleLabel::setText(const QString & text) { QLabel::setText(text); QFontMetrics fm(font()); - int textWidth = fm.width(text); + int textWidth = QFontMetrics_horizontalAdvance(fm, text); textWidth += 40; QSize s = size(); if (textWidth > s.width()) { diff --git a/retroshare-gui/src/util/RsQtVersion.h b/retroshare-gui/src/util/RsQtVersion.h index ae11dff70..cce082627 100644 --- a/retroshare-gui/src/util/RsQtVersion.h +++ b/retroshare-gui/src/util/RsQtVersion.h @@ -55,4 +55,10 @@ #define QSortFilterProxyModel_setFilterRegularExpression(proxyModel, pattern) proxyModel->setFilterRegExp(pattern); #endif +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#define QFontMetrics_horizontalAdvance(fontMetrics, text) fontMetrics.horizontalAdvance(text) +#else +#define QFontMetrics_horizontalAdvance(fontMetrics, text) fontMetrics.width(text) +#endif + #endif From 32350dfe839039c75ce418762a16c9ffe072c93f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 25 Jul 2025 00:35:17 +0200 Subject: [PATCH 044/147] Added Qt dependent macro for QLabel::pixmap --- .../src/gui/Identity/IdEditDialog.cpp | 3 +- .../src/gui/common/AvatarDialog.cpp | 5 +-- retroshare-gui/src/retroshare-gui.pro | 1 + retroshare-gui/src/util/RsQtVersion.cpp | 36 +++++++++++++++++++ retroshare-gui/src/util/RsQtVersion.h | 11 +++++- 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 retroshare-gui/src/util/RsQtVersion.cpp diff --git a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp index add0de131..f22bf238e 100644 --- a/retroshare-gui/src/gui/Identity/IdEditDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdEditDialog.cpp @@ -35,6 +35,7 @@ #include "retroshare/rspeers.h" #include "gui/common/FilesDefs.h" #include "util/imageutil.h" +#include "util/RsQtVersion.h" #include @@ -700,7 +701,7 @@ void IdEditDialog::removeAvatar() void IdEditDialog::updateInterface() { - QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue); + QPixmap pixmap = QLabel_pixmap(ui->avatarLabel); if (!pixmap.isNull()) { ui->removeButton->setEnabled(true); } else if (mEditGroup.mImage.mSize > 0) { diff --git a/retroshare-gui/src/gui/common/AvatarDialog.cpp b/retroshare-gui/src/gui/common/AvatarDialog.cpp index a5e8d15d4..c89483499 100644 --- a/retroshare-gui/src/gui/common/AvatarDialog.cpp +++ b/retroshare-gui/src/gui/common/AvatarDialog.cpp @@ -42,6 +42,7 @@ #include "gui/common/FilesDefs.h" #include "util/HandleRichText.h" #include "util/imageutil.h" +#include "util/RsQtVersion.h" #include "retroshare/rsinit.h" #define ICONNAME "groupicon.png" @@ -107,7 +108,7 @@ void AvatarDialog::removeAvatar() void AvatarDialog::updateInterface() { - QPixmap pixmap = ui->avatarLabel->pixmap(Qt::ReturnByValue); + QPixmap pixmap = QLabel_pixmap(ui->avatarLabel); if (!pixmap.isNull()) { ui->removeButton->setEnabled(true); } else { @@ -123,7 +124,7 @@ void AvatarDialog::setAvatar(const QPixmap &avatar) void AvatarDialog::getAvatar(QPixmap &avatar) { - avatar = ui->avatarLabel->pixmap(Qt::ReturnByValue); + avatar = QLabel_pixmap(ui->avatarLabel); } void AvatarDialog::getAvatar(QByteArray &avatar) diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index eb2d235b7..6a50480f5 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -816,6 +816,7 @@ SOURCES += main.cpp \ util/misc.cpp \ util/HandleRichText.cpp \ util/ObjectPainter.cpp \ + util/RsQtVersion.cpp \ util/RsFile.cpp \ util/RichTextEdit.cpp \ util/ClickableLabel.cpp \ diff --git a/retroshare-gui/src/util/RsQtVersion.cpp b/retroshare-gui/src/util/RsQtVersion.cpp new file mode 100644 index 000000000..0762e5510 --- /dev/null +++ b/retroshare-gui/src/util/RsQtVersion.cpp @@ -0,0 +1,36 @@ +/******************************************************************************* + * util/RsQtVersion.cpp * + * * + * Copyright (C) 2025 Retroshare Team * + * * + * This program is free software: you can redistribute it and/or modify * + * it under the terms of the GNU Affero General Public License as * + * published by the Free Software Foundation, either version 3 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU Affero General Public License for more details. * + * * + * You should have received a copy of the GNU Affero General Public License * + * along with this program. If not, see . * + * * + *******************************************************************************/ + +#include + +// Functions to compile with Qt 4, Qt 5 and Qt 6 + +#if QT_VERSION < QT_VERSION_CHECK (5, 15, 0) +#include +QPixmap QLabel_pixmap(QLabel* label) +{ + const QPixmap *pixmap = label->pixmap(); + if (pixmap) { + return *pixmap; + } + + return QPixmap(); +} +#endif diff --git a/retroshare-gui/src/util/RsQtVersion.h b/retroshare-gui/src/util/RsQtVersion.h index cce082627..3631a0bac 100644 --- a/retroshare-gui/src/util/RsQtVersion.h +++ b/retroshare-gui/src/util/RsQtVersion.h @@ -1,5 +1,5 @@ /******************************************************************************* - * util/qthreadutils.h * + * util/RsQtVersion.h * * * * Copyright (C) 2013 Retroshare Team * * * @@ -61,4 +61,13 @@ #define QFontMetrics_horizontalAdvance(fontMetrics, text) fontMetrics.width(text) #endif +#if QT_VERSION >= QT_VERSION_CHECK (6, 6, 0) +#define QLabel_pixmap(label) label->pixmap() +#elif QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) +#define QLabel_pixmap(label) label->pixmap(Qt::ReturnByValue) +#else +class QLabel; +extern QPixmap QLabel_pixmap(QLabel* label); +#endif + #endif From c9e8ac4c3c00b8ae3f36ce18b36f0ff253908be6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 25 Jul 2025 13:53:16 +0200 Subject: [PATCH 045/147] Added Qt dependent macro for Q_FALLTHROUGH --- retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp | 1 + retroshare-gui/src/util/RsQtVersion.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp index 47317c801..b5d8b4ffc 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelDialog.cpp @@ -36,6 +36,7 @@ #include "gui/common/GroupTreeWidget.h" #include "util/qtthreadsutils.h" #include "util/misc.h" +#include "util/RsQtVersion.h" // class GxsChannelGroupInfoData : public RsUserdata // { diff --git a/retroshare-gui/src/util/RsQtVersion.h b/retroshare-gui/src/util/RsQtVersion.h index 3631a0bac..e313f6054 100644 --- a/retroshare-gui/src/util/RsQtVersion.h +++ b/retroshare-gui/src/util/RsQtVersion.h @@ -70,4 +70,8 @@ class QLabel; extern QPixmap QLabel_pixmap(QLabel* label); #endif +#if QT_VERSION < QT_VERSION_CHECK (5, 8, 0) +#define Q_FALLTHROUGH() (void)0 +#endif + #endif From 9816be4b5317383c7223da7aad08bc3fffd49830 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 15:12:43 +0200 Subject: [PATCH 046/147] Replaced QColor::light by QColor::lighter and QColor::dark by QColor::darker --- retroshare-gui/src/gui/AboutWidget.cpp | 4 ++-- retroshare-gui/src/util/printpreview.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index dfd738dc9..fc0235c3e 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -810,11 +810,11 @@ void TBoard::drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape) { QColor color = colorTable[int(shape)]; painter.fillRect(x + 1, y + 1, squareWidth() - 2, squareHeight() - 2, color); - painter.setPen(color.light()); + painter.setPen(color.lighter()); painter.drawLine(x, y + squareHeight() - 1, x, y); painter.drawLine(x, y, x + squareWidth() - 1, y); - painter.setPen(color.dark()); + painter.setPen(color.darker()); painter.drawLine(x + 1, y + squareHeight() - 1, x + squareWidth() - 1, y + squareHeight() - 1); painter.drawLine(x + squareWidth() - 1, y + squareHeight() - 1, x + squareWidth() - 1, y + 1); } diff --git a/retroshare-gui/src/util/printpreview.cpp b/retroshare-gui/src/util/printpreview.cpp index cae4214d2..0d6e7d962 100644 --- a/retroshare-gui/src/util/printpreview.cpp +++ b/retroshare-gui/src/util/printpreview.cpp @@ -108,11 +108,11 @@ void PreviewView::paintPage(QPainter *painter, int page) painter->drawRect(QRectF(QPointF(0, 0), printPreview->paperSize)); painter->setBrush(Qt::NoBrush); - col = col.light(); + col = col.lighter(); painter->drawLine(QLineF(printPreview->paperSize.width(), 1, printPreview->paperSize.width(), printPreview->paperSize.height() - 1)); - col = col.light(); + col = col.lighter(); painter->drawLine(QLineF(printPreview->paperSize.width(), 2, printPreview->paperSize.width(), printPreview->paperSize.height() - 2)); From 47916ee8c051c1c222a7ed18b0ec6483a8c39c18 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 02:47:12 +0200 Subject: [PATCH 047/147] Removed check for QSysInfo::WindowsVersion in misc::getOpenFileName/getOpenFileNames --- retroshare-gui/src/util/misc.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index 84c408de3..6ab427d10 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -335,8 +335,7 @@ bool misc::getOpenFileName(QWidget *parent, RshareSettings::enumLastDir type #ifdef WINDOWS_SYS // fix bug in Qt for Windows Vista and higher, convert path from native separators - if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) - file = QDir::fromNativeSeparators(file); + file = QDir::fromNativeSeparators(file); #endif return true; @@ -361,11 +360,9 @@ bool misc::getOpenFileNames(QWidget *parent, RshareSettings::enumLastDir type Settings->setLastDir(type, lastDir); #ifdef WINDOWS_SYS - // fix bug in Qt for Windows Vista and higher, convert path from native separators - if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) - for (QStringList::iterator file = files.begin(); file != files.end(); ++file) { - (*file) = QDir::fromNativeSeparators(*file); - } + for (QStringList::iterator file = files.begin(); file != files.end(); ++file) { + (*file) = QDir::fromNativeSeparators(*file); + } #endif return true; From 6652d7f4f8f708b44112245e06f954a816ebb194 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 17:29:40 +0200 Subject: [PATCH 048/147] Replaced deprecated QTextStream::setCodec by QTextStream::setEncoding --- retroshare-gui/src/gui/HomePage.cpp | 4 ++++ retroshare-gui/src/gui/chat/ChatWidget.cpp | 4 ++++ retroshare-gui/src/gui/common/NewFriendList.cpp | 4 ++++ retroshare-gui/src/gui/common/RsCollection.cpp | 4 ++++ retroshare-gui/src/gui/msgs/MessageComposer.cpp | 5 +++++ retroshare-gui/src/gui/msgs/MessageWidget.cpp | 5 +++++ retroshare-gui/src/gui/settings/CryptoPage.cpp | 4 ++++ 7 files changed, 30 insertions(+) diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index 9b8213646..89e1ac120 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -352,7 +352,11 @@ void HomePage::saveCert() //Todo: move save to file to p3Peers::SaveCertificateToFile QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); +#else ts.setCodec(QTextCodec::codecForName("UTF-8")); +#endif ts << ui->retroshareid->text(); } diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 3c995f147..8b3864c8e 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -1763,7 +1763,11 @@ bool ChatWidget::fileSave() if (!file.open(QFile::WriteOnly)) return false; QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); +#else ts.setCodec(QTextCodec::codecForName("UTF-8")); +#endif ts << ui->textBrowser->document()->toPlainText(); ui->textBrowser->document()->setModified(false); return true; diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 97de3e2ab..ab218e54c 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -1419,7 +1419,11 @@ bool NewFriendList::exportFriendlist(QString &fileName) root.appendChild(groups); QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); +#else ts.setCodec("UTF-8"); +#endif ts << doc.toString(); file.close(); diff --git a/retroshare-gui/src/gui/common/RsCollection.cpp b/retroshare-gui/src/gui/common/RsCollection.cpp index e13452038..02ab0cf44 100644 --- a/retroshare-gui/src/gui/common/RsCollection.cpp +++ b/retroshare-gui/src/gui/common/RsCollection.cpp @@ -311,7 +311,11 @@ bool RsCollection::save(const QString& fileName) const xml_doc.appendChild(root); QTextStream stream(&file) ; +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + stream.setEncoding(QStringConverter::Utf8); +#else stream.setCodec("UTF-8") ; +#endif stream << xml_doc.toString() ; file.close(); diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index f30ced70a..de021991f 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -2403,8 +2403,13 @@ bool MessageComposer::fileSave() if (!file.open(QFile::WriteOnly)) return false; QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); + ts << ui.msgText->document()->toHtml(); +#else ts.setCodec(QTextCodec::codecForName("UTF-8")); ts << ui.msgText->document()->toHtml("UTF-8"); +#endif std::cerr << "Setting modified 002 = false" << std::endl; ui.msgText->document()->setModified(false); return true; diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index 52994454b..b8e22b968 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -802,8 +802,13 @@ void MessageWidget::saveAs() if (!file.open(QFile::WriteOnly)) return; QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); + ts << ui.msgText->document()->toHtml(); +#else ts.setCodec(QTextCodec::codecForName("UTF-8")); ts << ui.msgText->document()->toHtml("UTF-8"); +#endif ui.msgText->document()->setModified(false); } } diff --git a/retroshare-gui/src/gui/settings/CryptoPage.cpp b/retroshare-gui/src/gui/settings/CryptoPage.cpp index 296f6aec3..45e2a0b06 100755 --- a/retroshare-gui/src/gui/settings/CryptoPage.cpp +++ b/retroshare-gui/src/gui/settings/CryptoPage.cpp @@ -212,7 +212,11 @@ bool CryptoPage::fileSave() if (!file.open(QFile::WriteOnly)) return false; QTextStream ts(&file); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + ts.setEncoding(QStringConverter::Utf8); +#else ts.setCodec(QTextCodec::codecForName("UTF-8")); +#endif ts << ui.certplainTextEdit->document()->toPlainText(); return true; } From 484d220b044733e013d9cb5f686d34f5a176554e Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 18:45:50 +0200 Subject: [PATCH 049/147] Replace depracated QTextEdit::setTabStopWidth by QTextEdit::setTabStopDistance --- retroshare-gui/src/util/RichTextEdit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/util/RichTextEdit.cpp b/retroshare-gui/src/util/RichTextEdit.cpp index 8233058f9..acf9a8c76 100644 --- a/retroshare-gui/src/util/RichTextEdit.cpp +++ b/retroshare-gui/src/util/RichTextEdit.cpp @@ -45,7 +45,11 @@ static const uint32_t MAX_ALLOWED_GXS_MESSAGE_SIZE = 199000; RichTextEdit::RichTextEdit(QWidget *parent) : QWidget(parent) { setupUi(this); m_lastBlockList = 0; +#if QT_VERSION >= QT_VERSION_CHECK (5, 10, 0) + f_textedit->setTabStopDistance(40); +#else f_textedit->setTabStopWidth(40); +#endif connect(f_textedit, SIGNAL(currentCharFormatChanged(QTextCharFormat)), this, SLOT(slotCurrentCharFormatChanged(QTextCharFormat))); From 88230fd9bd0147bb970036dfe493901449c6db51 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 18:57:25 +0200 Subject: [PATCH 050/147] Replaced deprecated QPalette::foreground by QPalette::windowText and QPalette::background by QPalette::window --- retroshare-gui/src/gui/AboutWidget.cpp | 2 +- retroshare-gui/src/gui/common/FlowLayout.cpp | 2 +- .../src/gui/im_history/IMHistoryItemPainter.cpp | 2 +- retroshare-gui/src/util/RichTextEdit.cpp | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index fc0235c3e..0ccf621d9 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -775,7 +775,7 @@ void TBoard::showNextPiece() { QPixmap pixmap(dx * squareWidth(), dy * squareHeight()); QPainter painter(&pixmap); - painter.fillRect(pixmap.rect(), nextPieceLabel->palette().background()); + painter.fillRect(pixmap.rect(), nextPieceLabel->palette().window()); for (int i = 0; i < 4; ++i) { int x = nextPiece.x(i) - nextPiece.minX(); diff --git a/retroshare-gui/src/gui/common/FlowLayout.cpp b/retroshare-gui/src/gui/common/FlowLayout.cpp index aca787c22..5118b573b 100644 --- a/retroshare-gui/src/gui/common/FlowLayout.cpp +++ b/retroshare-gui/src/gui/common/FlowLayout.cpp @@ -645,7 +645,7 @@ void FlowLayout::performDrag() if (curs==0) dragPixmap = itemPixmap; QPixmap oldPixmap = dragPixmap; if (curs!=0) dragPixmap = QPixmap(oldPixmap.width() + 20 , oldPixmap.height()); - dragPixmap.fill(widget->palette().background().color()); + dragPixmap.fill(widget->palette().window().color()); QPainter painter(&dragPixmap); painter.drawPixmap(0, 0, oldPixmap); if (curs!=0) painter.drawPixmap((20 * curs), 0, itemPixmap); diff --git a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp index b75af79d0..a015cf95e 100644 --- a/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp +++ b/retroshare-gui/src/gui/im_history/IMHistoryItemPainter.cpp @@ -44,7 +44,7 @@ void IMHistoryItemPainter::paint(QPainter *painter, const QStyleOptionViewItem & // if (mode == Editable) { // painter->setBrush(option.palette.highlight()); // } else { - painter->setBrush(option.palette.foreground()); + painter->setBrush(option.palette.windowText()); // } if (option.state & QStyle::State_Selected) { painter->fillRect(option.rect, option.palette.highlight()); diff --git a/retroshare-gui/src/util/RichTextEdit.cpp b/retroshare-gui/src/util/RichTextEdit.cpp index acf9a8c76..1f53af489 100644 --- a/retroshare-gui/src/util/RichTextEdit.cpp +++ b/retroshare-gui/src/util/RichTextEdit.cpp @@ -181,14 +181,14 @@ RichTextEdit::RichTextEdit(QWidget *parent) : QWidget(parent) { // text foreground color QPixmap pix(16, 16); - pix.fill(QApplication::palette().foreground().color()); + pix.fill(QApplication::palette().windowText().color()); f_fgcolor->setIcon(pix); connect(f_fgcolor, SIGNAL(clicked()), this, SLOT(textFgColor())); // text background color - pix.fill(QApplication::palette().background().color()); + pix.fill(QApplication::palette().window().color()); f_bgcolor->setIcon(pix); connect(f_bgcolor, SIGNAL(clicked()), this, SLOT(textBgColor())); @@ -519,7 +519,7 @@ void RichTextEdit::fgColorChanged(const QColor &c) { if (c.isValid()) { pix.fill(c); } else { - pix.fill(QApplication::palette().foreground().color()); + pix.fill(QApplication::palette().windowText().color()); } f_fgcolor->setIcon(pix); } @@ -529,7 +529,7 @@ void RichTextEdit::bgColorChanged(const QColor &c) { if (c.isValid()) { pix.fill(c); } else { - pix.fill(QApplication::palette().background().color()); + pix.fill(QApplication::palette().window().color()); } f_bgcolor->setIcon(pix); } From 9052b813b98b2165f06fad883d23d2257ae3bced Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 19:36:56 +0200 Subject: [PATCH 051/147] Replaced deprecated qrand by QRandomGenerator for Qt 6 --- retroshare-gui/src/gui/AboutWidget.cpp | 10 +++++++++- retroshare-gui/src/gui/chat/PopupChatWindow.cpp | 12 +++++++++++- retroshare-gui/src/gui/elastic/graphwidget.cpp | 15 +++++++++++++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index 0ccf621d9..288db418a 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -43,6 +43,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif AboutWidget::AboutWidget(QWidget* parent) : QWidget(parent) @@ -821,7 +824,12 @@ void TBoard::drawSquare(QPainter &painter, int x, int y, TPiece::Shape shape) { void TPiece::setRandomShape() { - setShape(TPiece::Shape(qrand() % 7 + 1)); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int rand = QRandomGenerator::global()->generate(); +#else + int rand = qrand(); +#endif + setShape(TPiece::Shape(rand % 7 + 1)); } diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp index 1f15345b1..3858c806e 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp @@ -23,6 +23,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif #include "gui/common/FilesDefs.h" #include "PopupChatWindow.h" @@ -205,7 +208,14 @@ void PopupChatWindow::showEvent(QShowEvent */*event*/) if (tabbedWindow) { Settings->loadWidgetInformation(this); } else { - this->move(qrand()%100, qrand()%100); //avoid to stack multiple popup chat windows on the same position +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int x = QRandomGenerator::global()->generate(); + int y = QRandomGenerator::global()->generate(); +#else + int x = qrand(); + int y = qrand(); +#endif + this->move(x % 100, y % 100); //avoid to stack multiple popup chat windows on the same position PeerSettings->loadWidgetInformation(chatId, this); } } diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index d0f90050f..750e73ff3 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -29,6 +29,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif #include @@ -131,8 +134,16 @@ void GraphWidget::keyPressEvent(QKeyEvent *event) case Qt::Key_Space: case Qt::Key_Enter: foreach (QGraphicsItem *item, scene()->items()) { - if (qgraphicsitem_cast(item)) - item->setPos(-150 + qrand() % 300, -150 + qrand() % 300); + if (qgraphicsitem_cast(item)) { +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int x = QRandomGenerator::global()->generate(); + int y = QRandomGenerator::global()->generate(); +#else + int x = qrand(); + int y = qrand(); +#endif + item->setPos(-150 + x % 300, -150 + y % 300); + } } break; default: From 5efed259e7e674f40cafe4775851da4781442993 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 20:33:04 +0200 Subject: [PATCH 052/147] Replaced depracated QWheelEvent::delta by QWheelEvent::angleDelta for Qt 6 --- .../src/gui/common/RSGraphWidget.cpp | 12 +++++++++--- .../src/gui/elastic/graphwidget.cpp | 8 +++++++- .../gxschannels/GxsChannelPostThumbnail.cpp | 8 +++++++- .../gui/statistics/GlobalRouterStatistics.cpp | 19 ++++++++++++++++--- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index f642a3077..2304e0128 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -697,18 +697,24 @@ void RSGraphWidget::paintScale2() void RSGraphWidget::wheelEvent(QWheelEvent *e) { +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = e->angleDelta().y(); +#else + int delta = e->delta(); +#endif + if(e->modifiers() & Qt::ShiftModifier) - if(e->delta() > 0) + if(delta > 0) _time_filter *= 1.1 ; else _time_filter /= 1.1 ; else if(e->modifiers() & Qt::ControlModifier) - if(e->delta() > 0) + if(delta > 0) _linewidthscale *= 1.2 ; else _linewidthscale /= 1.2 ; else - if(e->delta() > 0) + if(delta > 0) _time_scale *= 1.1 ; else _time_scale /= 1.1 ; diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index 750e73ff3..f62628ccd 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -342,7 +342,13 @@ void GraphWidget::resizeEvent(QResizeEvent *event) void GraphWidget::wheelEvent(QWheelEvent *event) { - scaleView(pow((double)2, -event->delta() / 240.0)); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = event->angleDelta().y(); +#else + int delta = event->delta(); +#endif + + scaleView(pow((double)2, -delta / 240.0)); } void GraphWidget::scaleView(qreal scaleFactor) diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp index 560c37577..dd0163371 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostThumbnail.cpp @@ -283,7 +283,13 @@ void ZoomableLabel::wheelEvent(QWheelEvent *me) if(!mZoomEnabled) return; - float new_zoom_factor = (me->delta() > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05); +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int delta = me->angleDelta().y(); +#else + int delta = me->delta(); +#endif + + float new_zoom_factor = (delta > 0)?(mZoomFactor*1.05):(mZoomFactor/1.05); float new_center_x = mCenterX; float new_center_y = mCenterY; diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index 67013e1dc..333544a37 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -31,6 +31,9 @@ #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif #include #include @@ -429,16 +432,26 @@ void GlobalRouterStatisticsWidget::updateContent() void GlobalRouterStatisticsWidget::wheelEvent(QWheelEvent *e) { - if(e->x() < mMinWheelZoneX || e->x() > mMaxWheelZoneX || e->y() < mMinWheelZoneY || e->y() > mMaxWheelZoneY) +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + int x = e->position().toPoint().x(); + int y = e->position().toPoint().y(); + int delta = e->angleDelta().y(); +#else + int x = e->x(); + int y = e->y(); + int delta = e->delta(); +#endif + + if(x < mMinWheelZoneX || x > mMaxWheelZoneX || y < mMinWheelZoneY || y > mMaxWheelZoneY) { QWidget::wheelEvent(e) ; return ; } - if(e->delta() < 0 && mCurrentN+PARTIAL_VIEW_SIZE/2+1 < mNumberOfKnownKeys) + if(delta < 0 && mCurrentN+PARTIAL_VIEW_SIZE/2+1 < mNumberOfKnownKeys) mCurrentN++ ; - if(e->delta() > 0 && mCurrentN > PARTIAL_VIEW_SIZE/2+1) + if(delta > 0 && mCurrentN > PARTIAL_VIEW_SIZE/2+1) mCurrentN-- ; updateContent(); From 990f4dbf09850b79f0cec4caa587a4d3081f8445 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 23:10:46 +0200 Subject: [PATCH 053/147] Replaced deprecated QLayout::margin by QLayout::contentsMargins --- retroshare-gui/src/gui/common/FlowLayout.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/common/FlowLayout.cpp b/retroshare-gui/src/gui/common/FlowLayout.cpp index 5118b573b..de29ca029 100644 --- a/retroshare-gui/src/gui/common/FlowLayout.cpp +++ b/retroshare-gui/src/gui/common/FlowLayout.cpp @@ -23,6 +23,7 @@ #include #include #include +#include //*** FlowLayoutItem ********************************************************** @@ -598,7 +599,8 @@ QSize FlowLayout::minimumSize() const foreach (item, m_itemList) size = size.expandedTo(item->minimumSize()); - size += QSize(2*margin(), 2*margin()); + QMargins margins = contentsMargins(); + size += QSize(margins.left() + margins.right(), margins.top() + margins.bottom()); return size; } From bdae3b35b472a9d05731c112c6327956c599a2ac Mon Sep 17 00:00:00 2001 From: thunder2 Date: Mon, 21 Jul 2025 23:28:21 +0200 Subject: [PATCH 054/147] Replaced deprecated QColorDialog::getRgba by QColorDialog::getColor --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 7 +++---- retroshare-gui/src/gui/settings/ChatPage.cpp | 7 +++---- retroshare-gui/src/gui/settings/NewTag.cpp | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 8b3864c8e..df0e8deff 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -1507,10 +1507,9 @@ void ChatWidget::on_markButton_clicked(bool bValue) void ChatWidget::chooseColor() { - bool ok; - QRgb color = QColorDialog::getRgba(currentColor.rgba(), &ok, window()); - if (ok) { - currentColor = QColor(color); + QColor color = QColorDialog::getColor(currentColor, window(), "", QColorDialog::ShowAlphaChannel); + if (color.isValid()) { + currentColor = color; PeerSettings->setPrivateChatColor(chatId, currentColor.name()); colorChanged(); setColorAndFont(false); diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 44afbf996..38cb81be0 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -686,10 +686,9 @@ void ChatPage::on_cbSearch_WithoutLimit_toggled(bool checked) void ChatPage::on_btSearch_FoundColor_clicked() { - bool ok; - QRgb color = QColorDialog::getRgba(rgbChatSearchFoundColor, &ok, window()); - if (ok) { - rgbChatSearchFoundColor=color; + QColor color = QColorDialog::getColor(QColor::fromRgba(rgbChatSearchFoundColor), window(), "", QColorDialog::ShowAlphaChannel); + if (color.isValid()) { + rgbChatSearchFoundColor = color.rgba(); QPixmap pix(24, 24); pix.fill(color); ui.btSearch_FoundColor->setIcon(pix); diff --git a/retroshare-gui/src/gui/settings/NewTag.cpp b/retroshare-gui/src/gui/settings/NewTag.cpp index 09489ad89..bfc1b16b9 100644 --- a/retroshare-gui/src/gui/settings/NewTag.cpp +++ b/retroshare-gui/src/gui/settings/NewTag.cpp @@ -123,10 +123,9 @@ void NewTag::textChanged(const QString &text) void NewTag::setTagColor() { - bool ok; - QRgb color = QColorDialog::getRgba(m_Color, &ok, this); - if (ok) { - m_Color = color; + QColor color = QColorDialog::getColor(QColor::fromRgba(m_Color), this, "", QColorDialog::ShowAlphaChannel); + if (color.isValid()) { + m_Color = color.rgba(); showColor (m_Color); } } From a530bd9adb58ee6b9f94862e18b01d731580af1d Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 00:10:39 +0200 Subject: [PATCH 055/147] Replaced deprecated QList::toList by range constructors --- retroshare-gui/src/util/imageutil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/util/imageutil.cpp b/retroshare-gui/src/util/imageutil.cpp index 690872bdb..57a07de3f 100644 --- a/retroshare-gui/src/util/imageutil.cpp +++ b/retroshare-gui/src/util/imageutil.cpp @@ -340,7 +340,11 @@ void ImageUtil::quantization(const QImage &img, QVector &palette) colors.insert(pixel); } +#if QT_VERSION >= QT_VERSION_CHECK (5, 14, 0) + QList colorlist(colors.begin(), colors.end()); +#else QList colorlist = colors.toList(); +#endif //don't do the algoritmh if we have less than 16 different colors if(colorlist.size() <= (1 << bits)) { for(int i = 0; i < colors.count(); ++i) From f97b0e9a647b94fe5702a3c9bb399cf044520e26 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 00:13:39 +0200 Subject: [PATCH 056/147] Replaced deprecated qSort by std::sort --- retroshare-gui/src/util/imageutil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/util/imageutil.cpp b/retroshare-gui/src/util/imageutil.cpp index 57a07de3f..472ea2369 100644 --- a/retroshare-gui/src/util/imageutil.cpp +++ b/retroshare-gui/src/util/imageutil.cpp @@ -391,14 +391,14 @@ void ImageUtil::quantization(QList::iterator begin, QList::iterator //order by the widest channel if(red > green) if(red > blue) - qSort(begin, end, redLessThan); + std::sort(begin, end, redLessThan); else - qSort(begin, end, blueLessThan); + std::sort(begin, end, blueLessThan); else if(green > blue) - qSort(begin, end, greenLessThan); + std::sort(begin, end, greenLessThan); else - qSort(begin, end, blueLessThan); + std::sort(begin, end, blueLessThan); //split into two buckets QList::iterator split = begin + count / 2; From 1735797d8241c3533eb7948542bc46f21b115b59 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 01:10:34 +0200 Subject: [PATCH 057/147] Replaced deprecated QTreeWidget::isItemExpanded by QTreeWidgetItem::isExpanded and QTreeWidget::setItemExpanded by QTreeWidgetItem::setExpanded --- .../src/gui/help/browser/helpbrowser.cpp | 14 +++++++------- .../src/gui/statistics/GxsTransportStatistics.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp index 0da10e9d9..1da6fb4cf 100644 --- a/retroshare-gui/src/gui/help/browser/helpbrowser.cpp +++ b/retroshare-gui/src/gui/help/browser/helpbrowser.cpp @@ -104,7 +104,7 @@ HelpBrowser::HelpBrowser(QWidget *parent) /* Show the first help topic in the tree */ ui.treeContents->setCurrentItem(ui.treeContents->topLevelItem(0)); - ui.treeContents->setItemExpanded(ui.treeContents->topLevelItem(0), true); + ui.treeContents->topLevelItem(0)->setExpanded(true); } HelpBrowser::~HelpBrowser() @@ -231,7 +231,7 @@ HelpBrowser::contentsItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *prev QList selected = ui.treeSearch->selectedItems(); /* Deselect the selection in the search tree */ if (!selected.isEmpty()) { - ui.treeSearch->setItemSelected(selected[0], false); + selected[0]->setSelected(false); } currentItemChanged(current, prev); } @@ -243,7 +243,7 @@ HelpBrowser::searchItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *prev) QList selected = ui.treeContents->selectedItems(); /* Deselect the selection in the contents tree */ if (!selected.isEmpty()) { - ui.treeContents->setItemSelected(selected[0], false); + selected[0]->setSelected(false); } /* Change to selected page */ @@ -288,7 +288,7 @@ HelpBrowser::findTopicItem(QTreeWidgetItem *startItem, QString topic) if (subtopic == item->data(0, ROLE_TOPIC_ID).toString().toLower()) { /* Found a subtopic match, so expand this item */ - ui.treeContents->setItemExpanded(item, true); + item->setSelected(true); if (!topic.contains(".")) { /* Found the exact topic */ return item; @@ -314,10 +314,10 @@ HelpBrowser::showTopic(QString topic) * tree item. */ QTreeWidgetItem* selected = ui.treeContents->selectedItems()[0]; if (selected) { - ui.treeContents->setItemSelected(selected, false); + selected->setSelected(false); } - ui.treeContents->setItemExpanded(ui.treeContents->topLevelItem(0), true); - ui.treeContents->setItemSelected(item, true); + ui.treeContents->topLevelItem(0)->setExpanded(true); + item->setSelected(true); currentItemChanged(item, selected); } } diff --git a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp index d96c4bab0..a6c729862 100644 --- a/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsTransportStatistics.cpp @@ -273,7 +273,7 @@ void GxsTransportStatistics::updateContent() std::set openned_groups ; for(int i=0; itopLevelItemCount(); ++i) - if( groupTreeWidget->isItemExpanded(groupTreeWidget->topLevelItem(i)) ) + if( groupTreeWidget->topLevelItem(i)->isExpanded() ) openned_groups.insert(RsGxsGroupId(groupTreeWidget->topLevelItem(i)->data(COL_GROUP_GRP_ID, Qt::DisplayRole).toString().toStdString())); groupTreeWidget->clear(); @@ -295,7 +295,7 @@ void GxsTransportStatistics::updateContent() } groupTreeWidget->addTopLevelItem(item); - groupTreeWidget->setItemExpanded(item,openned_groups.find(it->first) != openned_groups.end()); + item->setExpanded(openned_groups.find(it->first) != openned_groups.end()); QString msg_time_string = (stat.last_publish_TS>0)?QString("(Last msg: %1)").arg(DateTime::DateTimeFromTime_t((uint)stat.last_publish_TS).toString()):"" ; From 395a0b05d024ffbbc1e0ae9dfbe483a806ddcab0 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 16:44:51 +0200 Subject: [PATCH 058/147] Replaced deprecated QTableWidgetItem::setBackgroundColor by QTableWidgetItem::setBackground --- retroshare-gui/src/gui/ShareManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/ShareManager.cpp b/retroshare-gui/src/gui/ShareManager.cpp index 1e00d043e..707f9e08b 100644 --- a/retroshare-gui/src/gui/ShareManager.cpp +++ b/retroshare-gui/src/gui/ShareManager.cpp @@ -242,7 +242,7 @@ void ShareManager::load() listWidget->setCellWidget(row, COLUMN_SHARE_FLAGS, widget); listWidget->setItem(row, COLUMN_GROUPS, new QTableWidgetItem()) ; - listWidget->item(row,COLUMN_GROUPS)->setBackgroundColor(QColor(183,236,181)) ; + listWidget->item(row,COLUMN_GROUPS)->setBackground(QColor(183,236,181)) ; connect(widget,SIGNAL(flagsChanged(FileStorageFlags)),this,SLOT(updateFlags())) ; From f4960a89032cfdb435a72813d602abeee66069f4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 02:39:15 +0200 Subject: [PATCH 059/147] Replaced deprecated qVariantFromValue by QVariant::fromValue --- retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp | 6 +++--- retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp | 2 +- retroshare-gui/src/gui/settings/ChatPage.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp index 719ad7d2d..c15d6d0b4 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyUserNotify.cpp @@ -229,7 +229,7 @@ void ChatLobbyUserNotify::iconClicked() QString strName=tr("Remove All"); QAction *pAction = new QAction( QIcon(), strName, trayMenu); ActionTag actionTag={0x0, "", true}; - pAction->setData(qVariantFromValue(actionTag)); + pAction->setData(QVariant::fromValue(actionTag)); trayMenu->addAction(pAction); trayMenu->exec(QCursor::pos()); @@ -268,14 +268,14 @@ void ChatLobbyUserNotify::makeSubMenu(QMenu* parentMenu, QIcon icoLobby, QString QAction *pAction = new QAction( icoLobby, strName, lobbyMenu); pAction->setToolTip(doc.toPlainText()); ActionTag actionTag={itCL->first, itMsg->first, false}; - pAction->setData(qVariantFromValue(actionTag)); + pAction->setData(QVariant::fromValue(actionTag)); lobbyMenu->addAction(pAction); } QString strName=tr("Remove All"); QAction *pAction = new QAction( icoLobby, strName, lobbyMenu); ActionTag actionTag={itCL->first, "", true}; - pAction->setData(qVariantFromValue(actionTag)); + pAction->setData(QVariant::fromValue(actionTag)); lobbyMenu->addAction(pAction); } diff --git a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp index f4c01ddf1..114071ae7 100644 --- a/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp +++ b/retroshare-gui/src/gui/im_history/ImHistoryBrowser.cpp @@ -295,7 +295,7 @@ void ImHistoryBrowser::fillItem(QListWidgetItem *itemWidget, HistoryMsg& msg) QColor backgroundColor = ui.listWidget->palette().base().color(); QString formatMsg = style.formatMessage(type, name, DateTime::DateTimeFromTime_t(msg.sendTime), messageText, 0, backgroundColor); - itemWidget->setData(Qt::DisplayRole, qVariantFromValue(IMHistoryItemPainter(formatMsg))); + itemWidget->setData(Qt::DisplayRole, QVariant::fromValue(IMHistoryItemPainter(formatMsg))); itemWidget->setData(ROLE_MSGID, msg.msgId); /* calculate plain text */ diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 38cb81be0..2fc22a13d 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -78,7 +78,7 @@ QString ChatPage::loadStyleInfo(ChatStyle::enumStyleType type, QComboBox *style_ { whileBlocking(style_CB)->insertItem(n,style->styleName); - style_CB->setItemData(n, qVariantFromValue(*style),Qt::UserRole); + style_CB->setItemData(n, QVariant::fromValue(*style),Qt::UserRole); if (style->stylePath == stylePath) { activeItem = n; From 07e7cd023c2b7867cf08656e9b8eadfe7d78461d Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 14:14:11 +0200 Subject: [PATCH 060/147] Replaced deprecated QPrinter::pageRect by QPrinter::pageLayout().paintRectPixels(resolution()) and QPrinter::paperRect by QPrinter::pageLayout().fullRectPixels(resolution()) --- retroshare-gui/src/util/printpreview.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/util/printpreview.cpp b/retroshare-gui/src/util/printpreview.cpp index 0d6e7d962..4bf4ad7c4 100644 --- a/retroshare-gui/src/util/printpreview.cpp +++ b/retroshare-gui/src/util/printpreview.cpp @@ -239,12 +239,12 @@ PrintPreview::PrintPreview(const QTextDocument *document, QWidget *parent) void PrintPreview::setup() { - QSizeF page = printer.pageRect().size(); - paperSize = printer.paperRect().size(); + QRect page = printer.pageLayout().paintRectPixels(printer.resolution()); + paperSize = printer.pageLayout().fullRectPixels(printer.resolution()).size(); paperSize.rwidth() *= qreal(view->logicalDpiX()) / printer.logicalDpiX(); paperSize.rheight() *= qreal(view->logicalDpiY()) / printer.logicalDpiY(); - pageTopLeft = printer.pageRect().topLeft(); + pageTopLeft = page.topLeft(); pageTopLeft.rx() *= qreal(view->logicalDpiX()) / printer.logicalDpiX(); pageTopLeft.ry() *= qreal(view->logicalDpiY()) / printer.logicalDpiY(); @@ -257,7 +257,7 @@ void PrintPreview::setup() fmt.setMargin(margin); doc->rootFrame()->setFrameFormat(fmt); - doc->setPageSize(page); + doc->setPageSize(page.size()); } PrintPreview::~PrintPreview() From ff822498a6e95d78d8509cd7d90df5b5151fb9ce Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 14:54:36 +0200 Subject: [PATCH 061/147] Replaced deprecated QAbstractPrintDialog::addEnabledOption by QPrintDialog::setOption --- retroshare-gui/src/gui/msgs/MessageComposer.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.cpp b/retroshare-gui/src/gui/msgs/MessageComposer.cpp index de021991f..aff01fc29 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.cpp +++ b/retroshare-gui/src/gui/msgs/MessageComposer.cpp @@ -2438,7 +2438,7 @@ void MessageComposer::filePrint() printer.setFullPage(true); QPrintDialog *dlg = new QPrintDialog(&printer, this); if (ui.msgText->textCursor().hasSelection()) - dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg->setOption(QPrintDialog::PrintSelection); dlg->setWindowTitle(tr("Print Document")); if (dlg->exec() == QDialog::Accepted) { ui.msgText->print(&printer); diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index b8e22b968..13cb46753 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -775,7 +775,7 @@ void MessageWidget::print() printer.setFullPage(true); QPrintDialog *dlg = new QPrintDialog(&printer, this); if (ui.msgText->textCursor().hasSelection()) - dlg->addEnabledOption(QAbstractPrintDialog::PrintSelection); + dlg->setOption(QPrintDialog::PrintSelection); dlg->setWindowTitle(tr("Print Document")); if (dlg->exec() == QDialog::Accepted) { ui.msgText->print(&printer); From c4c2c5a0d12040435e04dcaeb4e4dc3bcedc5b00 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 17:07:06 +0200 Subject: [PATCH 062/147] Replaced deprecated Qt::BackgroundColorRole by Qt::BackgroundRole and Qt::TextColorRole by Qt::ForegroundRole --- retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp | 2 +- retroshare-gui/src/gui/RSHumanReadableDelegate.h | 4 ++-- retroshare-gui/src/gui/RemoteDirModel.cpp | 2 +- retroshare-gui/src/gui/common/FriendListModel.cpp | 2 +- retroshare-gui/src/gui/common/GroupSelectionBox.cpp | 2 +- retroshare-gui/src/gui/common/RsCollectionModel.cpp | 2 +- retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp | 2 +- retroshare-gui/src/gui/msgs/MessageModel.cpp | 2 +- retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 6daa350ca..5c976a8f1 100755 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -61,7 +61,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti painter->setClipRect(opt.rect); //set text color - QVariant value = index.data(Qt::TextColorRole); + QVariant value = index.data(Qt::ForegroundRole); if(value.isValid() && qvariant_cast(value).isValid()) { opt.palette.setColor(QPalette::Text, qvariant_cast(value)); } diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index b35fcf138..3be6343bd 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -287,7 +287,7 @@ public: { case Qt::SizeHintRole: return sizeHintRole(index.column()) ; case Qt::TextAlignmentRole: - case Qt::TextColorRole: + case Qt::ForegroundRole: case Qt::WhatsThisRole: case Qt::EditRole: case Qt::ToolTipRole: diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp index 9eefe76f5..81d3b6f0b 100755 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp @@ -53,7 +53,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti painter->setClipRect(opt.rect); //set text color - QVariant value = index.data(Qt::TextColorRole); + QVariant value = index.data(Qt::ForegroundRole); if(value.isValid() && qvariant_cast(value).isValid()) { opt.palette.setColor(QPalette::Text, qvariant_cast(value)); } diff --git a/retroshare-gui/src/gui/RSHumanReadableDelegate.h b/retroshare-gui/src/gui/RSHumanReadableDelegate.h index 1b3995cd7..1688ce782 100644 --- a/retroshare-gui/src/gui/RSHumanReadableDelegate.h +++ b/retroshare-gui/src/gui/RSHumanReadableDelegate.h @@ -54,7 +54,7 @@ class RSHumanReadableDelegate: public QAbstractItemDelegate // This part of the code is copied from DLListDelegate.cpp // QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled; - QVariant value = index.data(Qt::TextColorRole); + QVariant value = index.data(Qt::ForegroundRole); if(value.isValid() && qvariant_cast(value).isValid()) option.palette.setColor(QPalette::Text, qvariant_cast(value)); @@ -75,7 +75,7 @@ class RSHumanReadableDelegate: public QAbstractItemDelegate } else { - value = index.data(Qt::BackgroundColorRole); + value = index.data(Qt::BackgroundRole); if(value.isValid() && qvariant_cast(value).isValid()) painter->fillRect(option.rect, qvariant_cast(value)); diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 962001a76..14cf490a9 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -825,7 +825,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const if (role == RetroshareDirModel::FileNameRole) /* end of FileNameRole */ return QString::fromUtf8(details.name.c_str()) ; - if (role == Qt::TextColorRole) + if (role == Qt::ForegroundRole) { if((details.type == DIR_TYPE_FILE || details.type == DIR_TYPE_EXTRA_FILE) && details.hash.isNull()) return QVariant(QColor(Qt::green)) ; diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index eebf384c5..89a924b01 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -422,7 +422,7 @@ QVariant RsFriendListModel::data(const QModelIndex &index, int role) const case Qt::SizeHintRole: return sizeHintRole(entry,index.column()) ; case Qt::DisplayRole: return displayRole(entry,index.column()) ; case Qt::FontRole: return fontRole(entry,index.column()) ; - case Qt::TextColorRole: return textColorRole(entry,index.column()) ; + case Qt::ForegroundRole: return textColorRole(entry,index.column()) ; case Qt::DecorationRole: return decorationRole(entry,index.column()) ; case FilterRole: return filterRole(entry,index.column()) ; diff --git a/retroshare-gui/src/gui/common/GroupSelectionBox.cpp b/retroshare-gui/src/gui/common/GroupSelectionBox.cpp index 18cdff34d..c57f6bd37 100644 --- a/retroshare-gui/src/gui/common/GroupSelectionBox.cpp +++ b/retroshare-gui/src/gui/common/GroupSelectionBox.cpp @@ -52,7 +52,7 @@ void GroupSelectionBox::fillGroups() for (std::list::const_iterator it(groupIds.begin()); it != groupIds.end(); ++it) { QListWidgetItem *item = new QListWidgetItem(GroupDefs::name(*it)); item->setData(ROLE_ID, QString::fromStdString(it->id.toStdString())); - item->setBackgroundColor(QColor(183,236,181)); + item->setBackground(QColor(183,236,181)); addItem(item); } diff --git a/retroshare-gui/src/gui/common/RsCollectionModel.cpp b/retroshare-gui/src/gui/common/RsCollectionModel.cpp index 8c7fa9283..0d4e19000 100644 --- a/retroshare-gui/src/gui/common/RsCollectionModel.cpp +++ b/retroshare-gui/src/gui/common/RsCollectionModel.cpp @@ -239,7 +239,7 @@ QVariant RsCollectionModel::data(const QModelIndex& index, int role) const case Qt::DisplayRole: return displayRole(i,index.column()); case Qt::DecorationRole: return decorationRole(i,index.column()); case Qt::CheckStateRole: return checkStateRole(i,index.column()); - case Qt::TextColorRole: return textColorRole(i,index.column()); + case Qt::ForegroundRole: return textColorRole(i,index.column()); default: return QVariant(); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp index c52810218..270a98a15 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumModel.cpp @@ -418,7 +418,7 @@ QVariant RsGxsForumModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; case Qt::UserRole: return userRole (fmpe,index.column()) ; - case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ; + case Qt::ForegroundRole: return textColorRole (fmpe,index.column()) ; case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ; case FilterRole: return filterRole (fmpe,index.column()) ; diff --git a/retroshare-gui/src/gui/msgs/MessageModel.cpp b/retroshare-gui/src/gui/msgs/MessageModel.cpp index 6e754b096..17185771b 100644 --- a/retroshare-gui/src/gui/msgs/MessageModel.cpp +++ b/retroshare-gui/src/gui/msgs/MessageModel.cpp @@ -273,7 +273,7 @@ QVariant RsMessageModel::data(const QModelIndex &index, int role) const case Qt::DecorationRole: return decorationRole(fmpe,index.column()) ; case Qt::ToolTipRole: return toolTipRole (fmpe,index.column()) ; case Qt::UserRole: return userRole (fmpe,index.column()) ; - case Qt::TextColorRole: return textColorRole (fmpe,index.column()) ; + case Qt::ForegroundRole: return textColorRole (fmpe,index.column()) ; case Qt::BackgroundRole: return backgroundRole(fmpe,index.column()) ; case FilterRole: return filterRole (fmpe,index.column()) ; diff --git a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp index e2ac17ce9..adc65ab82 100644 --- a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp @@ -70,7 +70,7 @@ void BWListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti painter->setClipRect(opt.rect); //set text color - QVariant value = index.data(Qt::TextColorRole); + QVariant value = index.data(Qt::ForegroundRole); if(value.isValid() && qvariant_cast(value).isValid()) { opt.palette.setColor(QPalette::Text, qvariant_cast(value)); } From d4dcaaa41a9588d05fb47a06af50955f7f29c8a6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 00:24:27 +0200 Subject: [PATCH 063/147] Changed QDomDocument::setContent for Qt 6.5 --- retroshare-gui/src/gui/common/NewFriendList.cpp | 2 +- retroshare-gui/src/gui/common/RsCollection.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index ab218e54c..557998090 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -1472,7 +1472,7 @@ bool NewFriendList::importFriendlist(QString &fileName, bool &errorPeers, bool & return false; } - bool ok = doc.setContent(&file); + bool ok = (bool) doc.setContent(&file); file.close(); if(!ok) { diff --git a/retroshare-gui/src/gui/common/RsCollection.cpp b/retroshare-gui/src/gui/common/RsCollection.cpp index 02ab0cf44..6daa54de8 100644 --- a/retroshare-gui/src/gui/common/RsCollection.cpp +++ b/retroshare-gui/src/gui/common/RsCollection.cpp @@ -194,7 +194,7 @@ RsCollection::RsCollection(const QString& fileName, RsCollectionErrorCode& error } QDomDocument xml_doc; - bool ok = xml_doc.setContent(&file) ; + bool ok = (bool) xml_doc.setContent(&file); if(!ok) { From c00a4dccb52c7e4503315c20049b6f1c9a9b9707 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 15:19:13 +0200 Subject: [PATCH 064/147] Replaced deprecated QSortFilterProxyModel::filterChanged by QSortFilterProxyModel::invalidateFilter --- retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp index e7b81ef2b..9da32fe2a 100644 --- a/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp +++ b/retroshare-gui/src/gui/NetworkDialog/pgpid_item_proxy.cpp @@ -44,7 +44,7 @@ pgpid_item_proxy::pgpid_item_proxy(QObject *parent) : void pgpid_item_proxy::use_only_trusted_keys(bool val) { only_trusted_keys = val; - filterChanged(); + invalidateFilter(); } bool pgpid_item_proxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const From ec497f001506ad7f8f6087fa3ada2373f7ea5d73 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 18:29:22 +0200 Subject: [PATCH 065/147] Replaced deprecated QModelIndex::child by QAbstractItemModel::index --- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 2 +- retroshare-gui/src/gui/Identity/IdDialog.cpp | 4 ++-- retroshare-gui/src/gui/common/NewFriendList.cpp | 4 ++-- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index a865d38c7..024afef1e 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -1018,7 +1018,7 @@ void SharedFilesDialog::recursExpandAll(const QModelIndex& index) for(int row=0;rowmodel()->rowCount(index);++row) { - QModelIndex idx(index.child(row,0)) ; + QModelIndex idx(ui.dirTreeView->model()->index(row,0,index)) ; if(ui.dirTreeView->model()->rowCount(idx) > 0) recursExpandAll(idx) ; diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 65351e3f0..f363f898b 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2720,7 +2720,7 @@ void IdDialog::recursSaveExpandedItems_idTreeView(const QModelIndex& proxy_index expanded.insert(local_path) ; for(int row=0;rowrowCount(proxy_index);++row) - recursSaveExpandedItems_idTreeView(proxy_index.child(row,0),local_path,expanded,selected) ; + recursSaveExpandedItems_idTreeView(mProxyModel->index(row,0,proxy_index),local_path,expanded,selected) ; } if(ui->idTreeWidget->selectionModel()->isSelected(proxy_index)) @@ -2752,7 +2752,7 @@ void IdDialog::recursRestoreExpandedItems_idTreeView(const QModelIndex& proxy_in ui->idTreeWidget->setExpanded(proxy_index,true) ; for(int row=0;rowrowCount(proxy_index);++row) - recursRestoreExpandedItems_idTreeView(proxy_index.child(row,0),local_path,expanded,selected) ; + recursRestoreExpandedItems_idTreeView(mProxyModel->index(row,0,proxy_index),local_path,expanded,selected) ; } if(selected.find(local_path) != selected.end()) diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 557998090..1f2cf27ca 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -448,7 +448,7 @@ void NewFriendList::recursSaveExpandedItems(const QModelIndex& index,const QMode exp.insert(local_path) ; for(int row=0;rowrowCount(index);++row) - recursSaveExpandedItems(index.child(row,0),current_index,local_path,exp,sel,indx+1) ; + recursSaveExpandedItems(mProxyModel->index(row,0,index),current_index,local_path,exp,sel,indx+1) ; } #ifdef DEBUG_NEW_FRIEND_LIST else @@ -479,7 +479,7 @@ void NewFriendList::recursRestoreExpandedItems(const QModelIndex& index, const Q ui->peerTreeWidget->setExpanded(index,true) ; for(int row=0;rowrowCount(index);++row) - recursRestoreExpandedItems(index.child(row,0),local_path,exp,sel,selected_index,indx+1) ; + recursRestoreExpandedItems(mProxyModel->index(row,0,index),local_path,exp,sel,selected_index,indx+1) ; } #ifdef DEBUG_NEW_FRIEND_LIST else diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 59f68663d..b68b02ead 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -540,7 +540,7 @@ void GxsForumThreadWidget::recursSaveExpandedItems(const QModelIndex& index, QLi if(ui->threadTreeWidget->isExpanded(index)) { for(int row=0;rowrowCount(index);++row) - recursSaveExpandedItems(index.child(row,0),expanded_items) ; + recursSaveExpandedItems(mThreadProxyModel->index(row,0,index),expanded_items) ; RsGxsMessageId message_id(index.sibling(index.row(),RsGxsForumModel::COLUMN_THREAD_MSGID).data(Qt::UserRole).toString().toStdString()); expanded_items.push_back(message_id); From 79a8b3143f39b01cffa2b52d0c557714a485bd04 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 20:17:28 +0200 Subject: [PATCH 066/147] Replaced deprecated QPalette::Background by QPalette::Window --- retroshare-gui/src/gui/AboutWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/AboutWidget.cpp b/retroshare-gui/src/gui/AboutWidget.cpp index 288db418a..5ed017d24 100644 --- a/retroshare-gui/src/gui/AboutWidget.cpp +++ b/retroshare-gui/src/gui/AboutWidget.cpp @@ -215,7 +215,7 @@ void AWidget::initImages() if(height() == 0) return ; image1 = QImage(width(),height(),QImage::Format_ARGB32); - image1.fill(palette().color(QPalette::Background)); + image1.fill(palette().color(QPalette::Window)); //QImage image(":/images/logo/logo_info.png"); QPixmap image(":/images/logo/logo_splash.png"); @@ -271,7 +271,7 @@ void AWidget::initGoL() void AWidget::drawBitField() { - image2.fill(palette().color(QPalette::Background)); + image2.fill(palette().color(QPalette::Window)); QPainter p(&image2) ; p.setPen(QColor(200,200,200)); @@ -914,7 +914,7 @@ TPiece TPiece::rotatedRight() const { NextPieceLabel::NextPieceLabel( QWidget* parent /* = 0*/ ) : QLabel(parent) { QPalette p = palette(); - p.setColor(QPalette::Background, Qt::white); + p.setColor(QPalette::Window, Qt::white); setPalette(p); setFrameShape(QFrame::Box); setAlignment(Qt::AlignCenter); From 8d497dce0a2c97972347913768534ea08b783ac7 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 21:10:34 +0200 Subject: [PATCH 067/147] Replaced deprecated QVariant::operator< by QVariant::compare for Qt 6 --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 ++++ retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index b68b02ead..c6e6339a5 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -219,7 +219,11 @@ public: if(left_is_not_pinned ^ right_is_not_pinned) return (m_header->sortIndicatorOrder()==Qt::AscendingOrder)?right_is_not_pinned:left_is_not_pinned ; // always put pinned posts on top +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + return QVariant::compare(left.data(RsGxsForumModel::SortRole), right.data(RsGxsForumModel::SortRole)) < 0; +#else return left.data(RsGxsForumModel::SortRole) < right.data(RsGxsForumModel::SortRole) ; +#endif } bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 8b5067ae6..4a558cce0 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -117,7 +117,11 @@ public: protected: bool lessThan(const QModelIndex& left, const QModelIndex& right) const override { +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + return QVariant::compare(sourceModel()->data(left, RsMessageModel::SortRole), sourceModel()->data(right, RsMessageModel::SortRole)) < 0; +#else return sourceModel()->data(left, RsMessageModel::SortRole) < sourceModel()->data(right, RsMessageModel::SortRole) ; +#endif } bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override From 71aaa25e698073d675d4217d9435f7830ab064d1 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 21:55:08 +0200 Subject: [PATCH 068/147] Replaced deprecated QGraphicsView::matrix by matrix::transform --- retroshare-gui/src/gui/elastic/graphwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/elastic/graphwidget.cpp b/retroshare-gui/src/gui/elastic/graphwidget.cpp index f62628ccd..deb4dff2d 100644 --- a/retroshare-gui/src/gui/elastic/graphwidget.cpp +++ b/retroshare-gui/src/gui/elastic/graphwidget.cpp @@ -353,7 +353,7 @@ void GraphWidget::wheelEvent(QWheelEvent *event) void GraphWidget::scaleView(qreal scaleFactor) { - qreal factor = matrix().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); + qreal factor = transform().scale(scaleFactor, scaleFactor).mapRect(QRectF(0, 0, 1, 1)).width(); if (factor < 0.07 || factor > 100) return; From 15437c0d2d0493a880aedb3bf193fa7a6a2f7e11 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 22:22:12 +0200 Subject: [PATCH 069/147] Replaced deprecated QMatrix by QTransform --- retroshare-gui/src/gui/common/RSTextBrowser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index c11d4edef..f0dfd8943 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -284,10 +284,10 @@ void RSTextBrowser::contextMenuEvent(QContextMenuEvent *event) QMenu *RSTextBrowser::createStandardContextMenuFromPoint(const QPoint &widgetPos) { - QMatrix matrix; - matrix.translate(horizontalScrollBar()->value(), verticalScrollBar()->value()); + QTransform transform; + transform.translate(horizontalScrollBar()->value(), verticalScrollBar()->value()); - QMenu *menu = QTextBrowser::createStandardContextMenu(matrix.map(widgetPos)); + QMenu *menu = QTextBrowser::createStandardContextMenu(transform.map(widgetPos)); menu->addSeparator(); QAction *a = menu->addAction(FilesDefs::getIconFromQtResourcePath("://icons/textedit/code.png"), tr("View &Source"), this, SLOT(viewSource())); From 3874390de7c4531ec5ffd2bedc27746f29885b5b Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 23:04:01 +0200 Subject: [PATCH 070/147] Replaced deprecated QStyleOptionProgressBarV2 by QStyleOptionProgressBar and QStyleOptionViewItemV4 by QStyleOptionViewItem --- retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp | 4 ++-- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 2 +- retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp index 5c976a8f1..726ec205b 100755 --- a/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/DLListDelegate.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -44,7 +44,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti { QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")}; QStyleOptionViewItem opt = option; - QStyleOptionProgressBarV2 newopt; + QStyleOptionProgressBar newopt; QRect pixmapRect; QPixmap pixmap; qlonglong fileSize; diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index 024afef1e..cceaa0d28 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -145,7 +145,7 @@ public: { Q_ASSERT(index.isValid()); - QStyleOptionViewItemV4 opt = option; + QStyleOptionViewItem opt = option; initStyleOption(&opt, index); // disable default icon opt.icon = QIcon(); diff --git a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp index 81d3b6f0b..a22591574 100755 --- a/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp +++ b/retroshare-gui/src/gui/FileTransfer/ULListDelegate.cpp @@ -40,7 +40,7 @@ void ULListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti { QString byteUnits[4] = {tr("B"), tr("KB"), tr("MB"), tr("GB")}; QStyleOptionViewItem opt = option; - QStyleOptionProgressBarV2 newopt; + QStyleOptionProgressBar newopt; QRect pixmapRect; QPixmap pixmap; qlonglong fileSize; From 9ebc4b00ed18463ef56ef1184ecf6759f596d9c5 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 23:29:19 +0200 Subject: [PATCH 071/147] Replaced deprecated QStyleOption::init by QStyleOption::initFrom --- retroshare-gui/src/gui/common/FlowLayout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/common/FlowLayout.h b/retroshare-gui/src/gui/common/FlowLayout.h index ff21f266a..585c98717 100644 --- a/retroshare-gui/src/gui/common/FlowLayout.h +++ b/retroshare-gui/src/gui/common/FlowLayout.h @@ -81,7 +81,7 @@ public: void paintEvent(QPaintEvent *) { QStyleOption opt; - opt.init(this); + opt.initFrom(this); QPainter p(this); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); } From 21174aa5d7b8241ae79bd5aa910799e4fe84c78f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 22 Jul 2025 23:38:53 +0200 Subject: [PATCH 072/147] Replaced depecated QPainter::initFrom by QPainter::begin --- .../src/gui/FileTransfer/FileTransferInfoWidget.cpp | 2 +- retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp | 2 +- retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp | 2 +- retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp | 4 ++-- retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp index 6adb61a68..76c50c5dc 100644 --- a/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp +++ b/retroshare-gui/src/gui/FileTransfer/FileTransferInfoWidget.cpp @@ -84,7 +84,7 @@ void FileTransferInfoWidget::updateDisplay() setFixedHeight(maxHeight); QPainter painter(&pixmap); - painter.initFrom(this); + painter.begin(this); float S = QFontMetricsF(font()).height(); int chunk_square_size = S*chunk_square_size_factor; diff --git a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp index 333544a37..f0019e9ad 100644 --- a/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GlobalRouterStatistics.cpp @@ -268,7 +268,7 @@ void GlobalRouterStatisticsWidget::updateContent() setFixedHeight(maxHeight); QPainter painter(&tmppixmap); - painter.initFrom(this); + painter.begin(this); painter.setPen(QColor::fromRgb(0,0,0)) ; QFont times_f(font());//"Times") ; diff --git a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp index 65b7c4bbd..8a877a131 100644 --- a/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/GxsIdStatistics.cpp @@ -258,7 +258,7 @@ void GxsIdStatisticsWidget::updateContent() setFixedHeight(mMaxHeight); QPainter painter(&tmppixmap); - painter.initFrom(this); + painter.begin(this); painter.setPen(QColor::fromRgb(0,0,0)) ; QFont times_f(font());//"Times") ; diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp index b866ae994..05759c3e1 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterDialog.cpp @@ -402,7 +402,7 @@ void GxsAuthenticatedTunnelsDialog::updateDisplay() //setFixedHeight(maxHeight); QPainter painter(&tmppixmap); - painter.initFrom(this); + painter.begin(this); // extracts the height of the fonts in pixels. This is used to calibrate the size of the objects to draw. @@ -576,7 +576,7 @@ void GxsNetTunnelsDialog::updateDisplay() //setFixedHeight(maxHeight); QPainter painter(&tmppixmap); - painter.initFrom(this); + painter.begin(this); // extracts the height of the fonts in pixels. This is used to calibrate the size of the objects to draw. diff --git a/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp b/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp index 50015406b..3b45e753d 100644 --- a/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp +++ b/retroshare-gui/src/gui/statistics/TurtleRouterStatistics.cpp @@ -296,7 +296,7 @@ void TurtleRouterStatisticsWidget::updateTunnelStatistics(const std::vector Date: Tue, 22 Jul 2025 23:51:56 +0200 Subject: [PATCH 073/147] Replaced deprecated QObject::trUtf8 by QObject::tr --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index df0e8deff..228c6d1cf 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -1933,7 +1933,7 @@ void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QStr void ChatWidget::updateStatusString(const QString &statusMask, const QString &statusString, bool permanent) { - ui->typingLabel->setText(QString(statusMask).arg(trUtf8(statusString.toUtf8()))); // displays info for 5 secs. + ui->typingLabel->setText(QString(statusMask).arg(tr(statusString.toUtf8()))); // displays info for 5 secs. ui->typingPixmapLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":icons/png/typing.png") ); if (statusString == "is typing...") { From c64cca9954414460caafbc52aa7f06531f55f7f1 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 23 Jul 2025 00:40:52 +0200 Subject: [PATCH 074/147] Removed usage of deprecated QSysInfo::WindowsVersion --- .../src/gui/statistics/BandwidthGraphWindow.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.cpp b/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.cpp index f621d355b..b1bc6814e 100644 --- a/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BandwidthGraphWindow.cpp @@ -84,12 +84,6 @@ BandwidthGraph::BandwidthGraph(QWidget *parent, Qt::WindowFlags flags) /* Load the previously saved settings */ /* Turn off opacity group on unsupported platforms */ - #if defined(Q_OS_WIN) - if(!(QSysInfo::WV_2000 <= QSysInfo::WindowsVersion)) { - ui.frmOpacity->setVisible(false); - } - #endif - #if defined(Q_OS_LINUX) ui.frmOpacity->setVisible(false); ui.chkAlwaysOnTop->setVisible(false); @@ -283,10 +277,8 @@ void BandwidthGraph::setOpacity(int value) this->setWindowOpacity(newValue); ui.lblPercentOpacity->setText(QString::number(value)); #elif defined(Q_OS_WIN) - if(QSysInfo::WV_2000 <= QSysInfo::WindowsVersion) { - this->setWindowOpacity(newValue); - ui.lblPercentOpacity->setText(QString::number(value)); - } + this->setWindowOpacity(newValue); + ui.lblPercentOpacity->setText(QString::number(value)); #else Q_UNUSED(newValue); #endif From 1b1cb6e1762cf0074d70825ee943c65df5257f60 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 23 Jul 2025 00:24:02 +0200 Subject: [PATCH 075/147] Replaced deprecated QSysInfo::MacintoshVersion and QSysInfo::windowsVersion by QSysInfo::prettyProductName --- retroshare-gui/src/gui/GetStartedDialog.cpp | 89 +-------------------- 1 file changed, 1 insertion(+), 88 deletions(-) diff --git a/retroshare-gui/src/gui/GetStartedDialog.cpp b/retroshare-gui/src/gui/GetStartedDialog.cpp index 399cc36d7..954189997 100644 --- a/retroshare-gui/src/gui/GetStartedDialog.cpp +++ b/retroshare-gui/src/gui/GetStartedDialog.cpp @@ -332,95 +332,8 @@ void GetStartedDialog::emailSupport() QString text = QString("Hello") + "\n"; text += "\n"; - QString sysVersion; + QString sysVersion = QSysInfo::prettyProductName(); -#ifdef __APPLE__ - - #ifdef Q_OS_MAC - switch(QSysInfo::MacintoshVersion) - { - case QSysInfo::MV_9: - sysVersion = "Mac OS 9"; - break; - case QSysInfo::MV_10_0: - sysVersion = "Mac OSX 10.0"; - break; - case QSysInfo::MV_10_1: - sysVersion = "Mac OSX 10.1"; - break; - case QSysInfo::MV_10_2: - sysVersion = "Mac OSX 10.2"; - break; - case QSysInfo::MV_10_3: - sysVersion = "Mac OSX 10.3"; - break; - case QSysInfo::MV_10_4: - sysVersion = "Mac OSX 10.4"; - break; - case QSysInfo::MV_10_5: - sysVersion = "Mac OSX 10.5"; - break; - case QSysInfo::MV_10_6: - sysVersion = "Mac OSX 10.6"; - break; -// case QSysInfo::MV_10_7: -// sysVersion = "Mac OSX 10.7"; -// break; - default: - sysVersion = "Mac Unknown"; - break; - } - #else - sysVersion = "OSX Unknown"; - #endif -#else - #if defined(_WIN32) || defined(__MINGW32__) - // Windows - #ifdef Q_OS_WIN - switch(QSysInfo::windowsVersion()) - { - case QSysInfo::WV_32s: - sysVersion = "Windows 2.1"; - break; - case QSysInfo::WV_95: - sysVersion = "Windows 95"; - break; - case QSysInfo::WV_98: - sysVersion = "Windows 98"; - break; - case QSysInfo::WV_Me: - sysVersion = "Windows Me"; - break; - case QSysInfo::WV_NT: - sysVersion = "Windows NT"; - break; - case QSysInfo::WV_2000: - sysVersion = "Windows 2000"; - break; - case QSysInfo::WV_XP: - sysVersion = "Windows XP"; - break; - case QSysInfo::WV_2003: - sysVersion = "Windows 2003"; - break; - case QSysInfo::WV_VISTA: - sysVersion = "Windows Vista"; - break; - case QSysInfo::WV_WINDOWS7: - sysVersion = "Windows 7"; - break; - default: - sysVersion = "Windows"; - break; - } - #else - sysVersion = "Windows Unknown"; - #endif - #else - // Linux - sysVersion = "Linux"; - #endif -#endif text += QString("My RetroShare Configuration is: (%1, %2, %3)").arg(RsApplication::retroshareVersion(true) , sysVersion ).arg(static_cast::type>(userLevel)) + "\n"; From c8c833b3d6e8e9a460d93f478484dbfb72fd93e5 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 23 Jul 2025 00:51:03 +0200 Subject: [PATCH 076/147] Removed deprecated QAbstractEventDispatcher::hasPendingEvents for Q 6 --- retroshare-gui/src/gui/GenCertDialog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index 0f318049d..7f836be89 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -613,7 +613,9 @@ void GenCertDialog::genPerson() std::cout << "Waiting ed->processEvents()" << std::endl; #endif time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents +#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0) if (ed->hasPendingEvents()) +#endif while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd)); std::string email_str = "" ; From 96c02d94c3fd8333def7803d57439c3c50d71428 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Wed, 23 Jul 2025 01:30:22 +0200 Subject: [PATCH 077/147] Removed deprecated QCoreApplication::flush for Qt 6 --- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 3 +++ retroshare-gui/src/gui/MainWindow.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index cceaa0d28..c7500b6cf 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -1131,7 +1131,10 @@ void SharedFilesDialog::postModDirectories(bool local) #ifdef DEBUG_SHARED_FILES_DIALOG std::cerr << "****** updated directories! Re-enabling sorting ******" << std::endl; #endif + +#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0) QCoreApplication::flush(); +#endif } class ChannelCompare diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 897d11136..0c0f3767c 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -939,7 +939,9 @@ void MainWindow::postModDirectories(bool /*update_local*/) { //RSettingsPage::postModDirectories(update_local); +#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0) QCoreApplication::flush(); +#endif } #ifdef WINDOWS_SYS From 15684bf8d3ea11908b8e6acd754f838529ea7861 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 16:58:27 +0200 Subject: [PATCH 078/147] Added Qt 5 Core Compat module for QRegExp for Qt 6 --- plugins/FeedReader/FeedReader.pro | 2 ++ retroshare-gui/src/gui/chat/ChatWidget.cpp | 1 + retroshare-gui/src/gui/common/RSTextBrowser.cpp | 1 + retroshare-gui/src/retroshare-gui.pro | 2 ++ retroshare-gui/src/util/HandleRichText.cpp | 3 ++- retroshare-gui/src/util/HandleRichText.h | 3 ++- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/FeedReader/FeedReader.pro b/plugins/FeedReader/FeedReader.pro index 97137c2b2..4b0cae546 100644 --- a/plugins/FeedReader/FeedReader.pro +++ b/plugins/FeedReader/FeedReader.pro @@ -28,6 +28,8 @@ greaterThan(QT_MAJOR_VERSION, 4) { QT += widgets } +greaterThan(QT_MAJOR_VERSION,5): QT += core5compat + target.files = lib/libFeedReader.so SOURCES = FeedReaderPlugin.cpp \ diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 228c6d1cf..32e3991e1 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -61,6 +61,7 @@ #include #include #include +#include #include diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp index f0dfd8943..4a203ea1b 100644 --- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp +++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 6a50480f5..9b0a31b6e 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -25,6 +25,8 @@ CONFIG += console TARGET = retroshare DEFINES += TARGET=\\\"$${TARGET}\\\" +greaterThan(QT_MAJOR_VERSION,5): QT += core5compat + DEPENDPATH *= $${PWD} $${RS_INCLUDE_DIR} INCLUDEPATH *= $${PWD} diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index e74cc9071..5a4a166a4 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "HandleRichText.h" #include "gui/RetroShareLink.h" @@ -359,7 +360,7 @@ void RsHtml::filterEmbeddedImages(QDomDocument &doc, QDomElement ¤tElement } } -int RsHtml::indexInWithValidation(QRegExp &rx, const QString &text, EmbedInHtml &embedInfos, int pos) +int RsHtml::indexInWithValidation(const QRegExp &rx, const QString &text, EmbedInHtml &embedInfos, int pos) { int index = rx.indexIn(text, pos); if(index == -1 || embedInfos.myType != Img) return index; diff --git a/retroshare-gui/src/util/HandleRichText.h b/retroshare-gui/src/util/HandleRichText.h index 3e98ea21c..cefb40c70 100644 --- a/retroshare-gui/src/util/HandleRichText.h +++ b/retroshare-gui/src/util/HandleRichText.h @@ -54,6 +54,7 @@ class QDomElement; class EmbedInHtml; class RetroShareLink; class QTextCursor; +class QRegExp; class RsHtml { @@ -89,7 +90,7 @@ protected: virtual void anchorStylesheetForImg(QDomDocument &doc, QDomElement &element, const RetroShareLink &link, QString &styleSheet); private: - int indexInWithValidation(QRegExp &rx, const QString &text, EmbedInHtml &embedInfos, int pos = 0); + int indexInWithValidation(const QRegExp &rx, const QString &text, EmbedInHtml &embedInfos, int pos = 0); }; #endif // HANDLE_RICH_TEXT_H_ From 95127592d71c12304ca3f474514efb85f2b24b2a Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 18 Jul 2025 18:33:23 +0200 Subject: [PATCH 079/147] Replaced deprecated QSound and QAudioDeviceInfo by QAudioDevice and QMediaDevices for Qt 6 --- retroshare-gui/src/gui/SoundManager.cpp | 28 +++++++++++++++++++++---- retroshare-gui/src/gui/SoundManager.h | 8 +++++++ 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/SoundManager.cpp b/retroshare-gui/src/gui/SoundManager.cpp index 69ba9e64b..3fc60dd87 100644 --- a/retroshare-gui/src/gui/SoundManager.cpp +++ b/retroshare-gui/src/gui/SoundManager.cpp @@ -21,12 +21,22 @@ #include #include #include -#include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#include +#include +#elif QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) +#include +#endif + +#if QT_VERSION < QT_VERSION_CHECK (6, 0, 0) +#include +#endif + #if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) #include -#include #endif // #ifdef QMEDIAPLAYER @@ -241,15 +251,25 @@ void SoundManager::playFile(const QString &filename) QString playFilename = realFilename(filename); bool played = false ; - -#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) + +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + if (!QMediaDevices::audioOutputs().isEmpty()) +#elif QT_VERSION >= QT_VERSION_CHECK (5, 0, 0) if (!QAudioDeviceInfo::availableDevices(QAudio::AudioOutput).isEmpty()) #else if (QSound::isAvailable()) #endif { +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + if (soundManager) { + soundManager->mSoundEffect.setSource(QUrl::fromLocalFile(playFilename)); + soundManager->mSoundEffect.play(); + played = true; + } +#else QSound::play(playFilename); played = true ; +#endif } if(!played) // let's go for the hard core stuff diff --git a/retroshare-gui/src/gui/SoundManager.h b/retroshare-gui/src/gui/SoundManager.h index 41db55ce4..eeceb3048 100644 --- a/retroshare-gui/src/gui/SoundManager.h +++ b/retroshare-gui/src/gui/SoundManager.h @@ -24,6 +24,10 @@ #include #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#endif + #define SOUND_NEW_CHAT_MESSAGE "NewChatMessage" #define SOUND_USER_ONLINE "User_go_Online" #define SOUND_MESSAGE_ARRIVED "MessageArrived" @@ -91,6 +95,10 @@ public: private: SoundManager(); + +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + QSoundEffect mSoundEffect; +#endif }; extern SoundManager *soundManager; From 26088a7cbba39a4c87a42fc1e0fc75fb8a07096f Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 20 Jul 2025 20:48:07 +0200 Subject: [PATCH 080/147] Replaced depracted QX11Info by QGuiApplication --- retroshare-gui/src/idle/idle_platform.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/retroshare-gui/src/idle/idle_platform.cpp b/retroshare-gui/src/idle/idle_platform.cpp index 71928dc59..c3d582acc 100644 --- a/retroshare-gui/src/idle/idle_platform.cpp +++ b/retroshare-gui/src/idle/idle_platform.cpp @@ -24,10 +24,15 @@ #ifdef HAVE_XSS #include +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) +#include +#else +#include +#endif + #if QT_VERSION < QT_VERSION_CHECK(5,0,0) #include #endif -#include #include #include @@ -75,7 +80,10 @@ bool IdlePlatform::init() old_handler = XSetErrorHandler(xerrhandler); int event_base, error_base; -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + QNativeInterface::QX11Application *nativeInterface = qGuiApp->nativeInterface(); + if (nativeInterface && XScreenSaverQueryExtension(nativeInterface->display(), &event_base, &error_base)) { +#elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) if(QX11Info::isPlatformX11() && XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) { #else if(XScreenSaverQueryExtension(QApplication::desktop()->screen()->x11Info().display(), &event_base, &error_base)) { @@ -90,7 +98,10 @@ int IdlePlatform::secondsIdle() { if(!d->ss_info) return 0; -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#if QT_VERSION >= QT_VERSION_CHECK (6, 0, 0) + QNativeInterface::QX11Application *nativeInterface = qGuiApp->nativeInterface(); + if(!nativeInterface || !XScreenSaverQueryInfo(nativeInterface->display(), DefaultRootWindow(nativeInterface->display()), d->ss_info)) +#elif QT_VERSION >= QT_VERSION_CHECK(5,0,0) if(!QX11Info::isPlatformX11() || !XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info)) #else if(!XScreenSaverQueryInfo(QApplication::desktop()->screen()->x11Info().display(), QX11Info::appRootWindow(), d->ss_info)) From 9a84fef2dd87e0f31ddedd1b66f26fd24233e6cd Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 24 Jul 2025 13:21:19 +0200 Subject: [PATCH 081/147] Added pack and installer with Qt 6 Windows native build --- build_scripts/Windows/build/build.bat | 8 +- build_scripts/Windows/build/pack.bat | 26 +- .../Windows/installer/retroshare-Qt5.nsi | 2 +- .../Windows/installer/retroshare-Qt6.nsi | 622 ++++++++++++++++++ 4 files changed, 645 insertions(+), 13 deletions(-) create mode 100644 build_scripts/Windows/installer/retroshare-Qt6.nsi diff --git a/build_scripts/Windows/build/build.bat b/build_scripts/Windows/build/build.bat index 91ff71382..591510580 100644 --- a/build_scripts/Windows/build/build.bat +++ b/build_scripts/Windows/build/build.bat @@ -33,7 +33,7 @@ echo. echo === Version echo. -title Build - %SourceName%-%RsBuildConfig% [Version] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [Version] pushd "%SourcePath%\retroshare-gui\src\gui\images" :: Touch resource file @@ -47,7 +47,7 @@ echo. echo === qmake echo. -title Build - %SourceName%-%RsBuildConfig% [qmake] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [qmake] set RS_QMAKE_CONFIG=%RsBuildConfig% if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin @@ -66,7 +66,7 @@ echo. echo === make echo. -title Build - %SourceName%-%RsBuildConfig% [make] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [make] mingw32-make -j %CoreCount% if errorlevel 1 goto error @@ -75,7 +75,7 @@ echo. echo === Changelog echo. -title Build - %SourceName%-%RsBuildConfig% [changelog] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [changelog] call "%ToolsPath%\generate-changelog.bat" "%SourcePath%" "%RsBuildPath%\changelog.txt" :error diff --git a/build_scripts/Windows/build/pack.bat b/build_scripts/Windows/build/pack.bat index ff347babf..d2259106d 100644 --- a/build_scripts/Windows/build/pack.bat +++ b/build_scripts/Windows/build/pack.bat @@ -59,10 +59,12 @@ set QtMainVersion=%QtVersion:~0,1% rem Qt 4 = QtSvg4.dll rem Qt 5 = Qt5Svg.dll +rem Qt 6 = Qt6Svg.dll set QtMainVersion1= set QtMainVersion2= if "%QtMainVersion%"=="4" set QtMainVersion2=4 if "%QtMainVersion%"=="5" set QtMainVersion1=5 +if "%QtMainVersion%"=="6" set QtMainVersion1=6 if "%RsBuildConfig%" NEQ "release" ( set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%GCCArchitecture%%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z @@ -75,7 +77,7 @@ if exist "%Archive%" del /Q "%Archive%" :: Create deploy path mkdir "%RsDeployPath%" -title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% [copy files] set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc set Extensions= @@ -131,18 +133,24 @@ if exist "%RsDeployPath%\retroshare.dll" call :copy_dependencies "%RsDeployPath% echo copy Qt DLL's copy "%QtPath%\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite% -if "%QtMainVersion%"=="5" ( +if %QtMainVersion% GEQ 5 ( mkdir "%RsDeployPath%\platforms" copy "%QtPath%\..\plugins\platforms\qwindows.dll" "%RsDeployPath%\platforms" %Quite% +) + +if "%QtMainVersion%"=="5" ( mkdir "%RsDeployPath%\audio" copy "%QtPath%\..\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite% ) -if exist "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" ( - echo Copy styles - mkdir "%RsDeployPath%\styles" %Quite% +echo Copy styles +mkdir "%RsDeployPath%\styles" %Quite% +if "%QtMainVersion%"=="5" ( copy "%QtPath%\..\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite% ) +if "%QtMainVersion%"=="6" ( + copy "%QtPath%\..\plugins\styles\qmodernwindowsstyle.dll" "%RsDeployPath%\styles" %Quite% +) copy "%QtPath%\..\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite% del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite% @@ -169,10 +177,12 @@ xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Qui echo copy translation copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite% -if "%QtMainVersion%"=="5" ( +if %QtMainVersion% GEQ 5 ( copy "%QtPath%\..\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite% - copy "%QtPath%\..\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite% +) +if "%QtMainVersion%"=="5" ( + copy "%QtPath%\..\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtPath%\..\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite% ) @@ -196,7 +206,7 @@ if "%ParamTor%"=="1" ( ) rem pack files -title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% [pack files] "%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*" diff --git a/build_scripts/Windows/installer/retroshare-Qt5.nsi b/build_scripts/Windows/installer/retroshare-Qt5.nsi index c7a5b9554..511fec9d4 100644 --- a/build_scripts/Windows/installer/retroshare-Qt5.nsi +++ b/build_scripts/Windows/installer/retroshare-Qt5.nsi @@ -232,7 +232,7 @@ Section $(Section_Main) Section_Main ; Qt styles SetOutPath "$INSTDIR\styles" - File /NONFATAL "${QTDIR}\plugins\styles\qwindowsvistastyle.dll" + File "${QTDIR}\plugins\styles\qwindowsvistastyle.dll" ; MinGW binaries SetOutPath "$INSTDIR" diff --git a/build_scripts/Windows/installer/retroshare-Qt6.nsi b/build_scripts/Windows/installer/retroshare-Qt6.nsi new file mode 100644 index 000000000..2ef3fb54f --- /dev/null +++ b/build_scripts/Windows/installer/retroshare-Qt6.nsi @@ -0,0 +1,622 @@ +; Script generated with the Venis Install Wizard & modified by defnax +; Reworked by Thunder + +!include ifexist.nsh + +# Needed defines +;!define REVISION "" +;!define RELEASEDIR "" +;!define QTDIR "" +;!define MINGWDIR "" + +# Optional defines +;!define OUTDIR "" + +# Check needed defines +!ifndef RELEASEDIR +!error "RELEASEDIR is not defined" +!endif +!ifndef QTDIR +!error "QTDIR is not defined" +!endif +!ifndef MINGWDIR +!error "MINGWDIR is not defined" +!endif +!ifndef ARCHITECTURE +!error "Architecture is not defined" +!endif + +# Check optional defines +!ifdef OUTDIR +!define OUTDIR_ "${OUTDIR}\" +!else +!define OUTDIR "" +!define OUTDIR_ "" +!endif + +!ifndef INSTALLERADD +!define INSTALLERADD "" +!endif + +# Source directory +!define SOURCEDIR "..\..\.." + +# Get version from executable +!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_ +!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3} +;!define REVISION ${VERSION_4} + +# Get version of Qt +!GetDllVersion "${QTDIR}\bin\Qt6Core.dll" QTVERSION_ +!define QTVERSION ${QTVERSION_1}.${QTVERSION_2}.${QTVERSION_3} + +# Check version +!ifndef REVISION +!error "REVISION is not defined" +!endif + +# Date +!ifndef DATE +!define /date DATE "%Y%m%d" +!endif + +# Service +${!defineifexist} SERVICE_EXISTS "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe" + +# Tor +!ifdef TORDIR +${!defineifexist} TOR_EXISTS "${TORDIR}\tor.exe" +!ifndef TOR_EXISTS +!error "tor.exe not found" +!endif +!endif + +# WebUI +!ifdef WEBUIDIR +${!defineifexist} WEBUI_EXISTS "${WEBUIDIR}\index.html" +!ifndef WEBUI_EXISTS +!error "WebUI files not found" +!endif +!endif + +# Friend Server +!ifdef TOR_EXISTS +# Add Friend Server with Tor only +#${!defineifexist} FRIENDSERVER_EXISTS "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe" +!endif + +# Application name and version +!define APPNAME "RetroShare" +!define APPNAMEANDVERSION "${APPNAME} ${VERSION}" +!define PUBLISHER "RetroShare Team" + +# Install path +!if ${ARCHITECTURE} == "x86" + !define INSTDIR_NORMAL "$ProgramFiles32\${APPNAME}" +!endif +!if ${ARCHITECTURE} == "x64" + !define INSTDIR_NORMAL "$ProgramFiles64\${APPNAME}" +!endif +!define INSTDIR_PORTABLE "$Desktop\${APPNAME}" + +!define DATADIR_NORMAL "$APPDATA\${APPNAME}" +!define DATADIR_PORTABLE "$INSTDIR\Data" + +# Main Install settings +Name "${APPNAMEANDVERSION}" +InstallDirRegKey HKLM "Software\${APPNAME}" "" +OutFile "${OUTDIR_}RetroShare-${VERSION}-${DATE}-${REVISION}-Qt-${QTVERSION}-${ARCHITECTURE}${INSTALLERADD}-setup.exe" +BrandingText "${APPNAMEANDVERSION}" +RequestExecutionlevel highest +# Use compression +SetCompressor /SOLID LZMA + +# Global variables +Var PortableMode +Var InstDirNormal +Var InstDirPortable +Var DataDir +Var StyleSheetDir + +# Modern interface settings +!include Sections.nsh +!include nsDialogs.nsh +!include "MUI.nsh" + +# Interface Settings +!define MUI_ABORTWARNING +!define MUI_HEADERIMAGE +!define MUI_HEADERIMAGE_BITMAP "${SOURCEDIR}\build_scripts\Windows\installer\HeaderImage.bmp" +;!define MUI_WELCOMEFINISHPAGE_BITMAP "...bmp" + +# MUI defines +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico" +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_LICENSEPAGE_RADIOBUTTONS +!define MUI_COMPONENTSPAGE_SMALLDESC +!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support" +!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/" +!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe" +!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt +!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt +;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico" +!define MUI_UNFINISHPAGE_NOAUTOCLOSE +;!define MUI_LANGDLL_REGISTRY_ROOT HKLM +;!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY} +;!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage + +# Defines the un-/installer logo of RetroShare +!insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp" +!insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp" + +# Installer pages +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)" +Page Custom PortableModePageCreate PortableModePageLeave +!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_COMPONENTS +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES + +# Set languages (first is default language) +!insertmacro MUI_RESERVEFILE_LANGDLL + +# Installer languages +!define MUI_LANGDLL_ALLLANGUAGES + +# Translations +!macro LANG_LOAD LANGUAGE LANGCODE LANGID LICENCEFILE + !insertmacro MUI_LANGUAGE "${LANGUAGE}" +; !verbose off + !define LANG "${LANGUAGE}" + !include "lang\${LANGCODE}.nsh" + LangString LANGUAGEID "${LANG_${LANG}}" "1031" + LicenseLangString myLicenseData ${LANGCODE} ${LICENCEFILE} +; !verbose on + !undef LANG +!macroend + +!macro LANG_STRING NAME VALUE + LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}" +!macroend + +!insertmacro LANG_LOAD "English" "en" "1033" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "French" "fr" "1036" "${SOURCEDIR}\retroshare-gui\src\license\license-FR.txt" +!insertmacro LANG_LOAD "German" "de" "1031" "${SOURCEDIR}\retroshare-gui\src\license\license-GER.txt" +!insertmacro LANG_LOAD "Turkish" "tr" "1055" "${SOURCEDIR}\retroshare-gui\src\license\license-TR.txt" +!insertmacro LANG_LOAD "SimpChinese" "zh_CN" "2052" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Polish" "pl" "1045" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Spanish" "es" "1034" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Russian" "ru" "1049" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" +!insertmacro LANG_LOAD "Catalan" "ca_ES" "1027" "${SOURCEDIR}\retroshare-gui\src\license\license.txt" + +LicenseData $(myLicenseData) + +# Main binaries +Section $(Section_Main) Section_Main + ;Set Section required + SectionIn RO + + ; Set Section properties + SetOverwrite on + + ; Clears previous error logs +; Delete "$INSTDIR\*.log" + + ; Main binaries + SetOutPath "$INSTDIR" + File "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" + File /nonfatal "${RELEASEDIR}\libretroshare\src\lib\retroshare.dll" + + ; Qt binaries + File "${QTDIR}\bin\Qt6Core.dll" + File "${QTDIR}\bin\Qt6Core5Compat.dll" + File "${QTDIR}\bin\Qt6Gui.dll" + File "${QTDIR}\bin\Qt6Multimedia.dll" + File "${QTDIR}\bin\Qt6Network.dll" + File "${QTDIR}\bin\Qt6PrintSupport.dll" + File "${QTDIR}\bin\Qt6Svg.dll" + File "${QTDIR}\bin\Qt6Widgets.dll" + File "${QTDIR}\bin\Qt6Xml.dll" + + ; Qt platforms + SetOutPath "$INSTDIR\platforms" + File "${QTDIR}\plugins\platforms\qwindows.dll" + + ; Qt styles + SetOutPath "$INSTDIR\styles" + File "${QTDIR}\plugins\styles\qmodernwindowsstyle.dll" + + ; MinGW binaries + SetOutPath "$INSTDIR" + File "${MINGWDIR}\bin\libstdc++-6.dll" + !if ${ARCHITECTURE} == "x86" + File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll" + !endif + !if ${ARCHITECTURE} == "x64" + File "${MINGWDIR}\bin\libgcc_s_seh-1.dll" + !endif + File "${MINGWDIR}\bin\libwinpthread-1.dll" + + ; External binaries + File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll" + File "${RELEASEDIR}\supportlibs\librnp\Build\src\lib\librnp.dll" + !if ${ARCHITECTURE} == "x86" + File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll" + File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll" + !endif + !if ${ARCHITECTURE} == "x64" + File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1-x64.dll" + File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1-x64.dll" + !endif + + ; Other files + File "${RELEASEDIR}\changelog.txt" + File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt" + + ; License + SetOutPath "$INSTDIR\license" + File "${SOURCEDIR}\retroshare-gui\src\license\*.*" + + ; Image formats + SetOutPath "$INSTDIR\imageformats" + File /r "${QTDIR}\plugins\imageformats\qgif.dll" + File /r "${QTDIR}\plugins\imageformats\qicns.dll" + File /r "${QTDIR}\plugins\imageformats\qico.dll" + File /r "${QTDIR}\plugins\imageformats\qjpeg.dll" + File /r "${QTDIR}\plugins\imageformats\qsvg.dll" + File /r "${QTDIR}\plugins\imageformats\qtga.dll" + File /r "${QTDIR}\plugins\imageformats\qtiff.dll" + File /r "${QTDIR}\plugins\imageformats\qwbmp.dll" + File /r "${QTDIR}\plugins\imageformats\qwebp.dll" + + ; Sounds + SetOutPath "$INSTDIR\sounds" + File /r "${SOURCEDIR}\retroshare-gui\src\sounds\*.*" + + ; Translations + SetOutPath "$INSTDIR\translations" + File /r "${SOURCEDIR}\retroshare-gui\src\translations\*.qm" + File /r "${QTDIR}\translations\qt_*.qm" + File /r "${QTDIR}\translations\qtbase_*.qm" + File /r "${QTDIR}\translations\qtmultimedia_*.qm" + + ; WebUI +; SetOutPath "$INSTDIR\webui" +; File /r "${SOURCEDIR}\libresapi\src\webui\*.*" + + ; License + SetOutPath "$INSTDIR\license" + File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*" +SectionEnd + +# Service +!ifdef SERVICE_EXISTS + Section /o $(Section_Service) Section_Service + SetOutPath "$INSTDIR" + File "${RELEASEDIR}\retroshare-service\src\release\retroshare-service.exe" + SectionEnd +!endif + +# Friend Server +!ifdef FRIENDSERVER_EXISTS + Section /o $(Section_FriendServer) Section_FriendServer + SetOutPath "$INSTDIR" + File "${RELEASEDIR}\retroshare-friendserver\src\release\retroshare-friendserver.exe" + SectionEnd +!endif + +# Tor +!ifdef TOR_EXISTS + Section /o $(Section_Tor) Section_Tor + SetOutPath "$INSTDIR\tor" + File "${TORDIR}\*" + SectionEnd +!endif + +# WebUI +!ifdef WEBUI_EXISTS + Section /o $(Section_WebUI) Section_WebUI + SetOutPath "$INSTDIR\webui" + File /r "${WEBUIDIR}\*" + SectionEnd +!endif + +# Plugins +${!defineifexist} PLUGIN_FEEDREADER_EXISTS "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll" +${!defineifexist} PLUGIN_VOIP_EXISTS "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll" + +!ifdef PLUGIN_FEEDREADER_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif +!ifdef PLUGIN_VOIP_EXISTS +!define /ifndef PLUGIN_EXISTS +!endif + +!ifdef PLUGIN_EXISTS + SectionGroup $(Section_Plugins) Section_Plugins + !ifdef PLUGIN_FEEDREADER_EXISTS + Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader + SetOutPath "$DataDir\extensions6" + File "${RELEASEDIR}\plugins\FeedReader\lib\FeedReader.dll" + SectionEnd + !endif + + !ifdef PLUGIN_VOIP_EXISTS + Section $(Section_Plugin_VOIP) Section_Plugin_VOIP + SetOutPath "$DataDir\extensions6" + File "${RELEASEDIR}\plugins\VOIP\lib\VOIP.dll" + SetOutPath "$INSTDIR\sounds" + File /r "${SOURCEDIR}\plugins\VOIP\gui\sounds\*.*" + SectionEnd + !endif + SectionGroupEnd +!endif + +# Data (Styles) +Section $(Section_Data) Section_Data + ; Set Section properties + SetOverwrite on + + ; Chat style + SetOutPath "$StyleSheetDir\stylesheets\Bubble" + File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble\*.*" + SetOutPath "$StyleSheetDir\stylesheets\Bubble_Compact" + File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble_Compact\*.*" + + ; Stylesheets + SetOutPath "$INSTDIR\qss" + File /nonfatal /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*" +SectionEnd + +;Section $(Section_Link) Section_Link + ; Delete any existing keys + + ; Write the file association +; WriteRegStr HKCR .pqi "" retroshare +; WriteRegStr HKCR retroshare "" "PQI File" +; WriteRegBin HKCR retroshare EditFlags 00000100 +; WriteRegStr HKCR "retroshare\shell" "" open +; WriteRegStr HKCR "retroshare\shell\open\command" "" `"$INSTDIR\retroshare.exe" "%1"` +;SectionEnd + +# Shortcuts +SectionGroup $(Section_Shortcuts) Section_Shortcuts +Section $(Section_StartMenu) Section_StartMenu + SetOutPath "$INSTDIR" + CreateDirectory "$SMPROGRAMS\${APPNAME}" + CreateShortCut "$SMPROGRAMS\${APPNAME}\$(Link_Uninstall).lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 + +!ifdef SERVICE_EXISTS + SectionGetFlags ${Section_Service} $0 + IntOp $0 $0 & ${SF_SELECTED} + ${If} $0 == ${SF_SELECTED} + CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Service.lnk" "$INSTDIR\retroshare-service.exe" "" "$INSTDIR\retroshare-service.exe" 0 + ${EndIf} +!endif + +!ifdef FRIENDSERVER_EXISTS + SectionGetFlags ${Section_FriendServer} $0 + IntOp $0 $0 & ${SF_SELECTED} + ${If} $0 == ${SF_SELECTED} + CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME} Friend Server.lnk" "$INSTDIR\retroshare-friendserver.exe" "" "$INSTDIR\retroshare-friendserver.exe" 0 + ${EndIf} +!endif +SectionEnd + +Section $(Section_Desktop) Section_Desktop + CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 +SectionEnd + +Section $(Section_QuickLaunch) Section_QuickLaunch + CreateShortCut "$QUICKLAUNCH\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0 +SectionEnd +SectionGroupEnd + +Section $(Section_AutoStart) Section_AutoStart + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\retroshare.exe -m" +SectionEnd + +;Section $(Section_AutoStart) Section_AutoStart +; CreateShortCut "$SMSTARTUP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe -m" 0 +;SectionEnd + +Section -FinishSection + ${If} $PortableMode = 0 + WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR" + WriteRegStr HKLM "Software\${APPNAME}" "Version" "${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\retroshare.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" "1" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" "1" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe" + WriteUninstaller "$INSTDIR\uninstall.exe" + ${Else} + ; Create the file the application uses to detect portable mode + FileOpen $0 "$INSTDIR\portable" w + FileClose $0 + ${EndIf} +SectionEnd + +# Descriptions +!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Main} $(Section_Main_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Data} $(Section_Data_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Shortcuts} $(Section_Shortcuts_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_StartMenu} $(Section_StartMenu_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Desktop} $(Section_Desktop_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_QuickLaunch} $(Section_QuickLaunch_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugins} $(Section_Plugins_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_FeedReader} $(Section_Plugin_FeedReader_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc) +; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Tor} $(Section_Tor_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_WebUI} $(Section_WebUI_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_Service} $(Section_Service_Desc) + !insertmacro MUI_DESCRIPTION_TEXT ${Section_FriendServer} $(Section_FriendServer_Desc) +!insertmacro MUI_FUNCTION_DESCRIPTION_END + +# Uninstall +Section "Uninstall" + ; Remove file association registry keys +; DeleteRegKey HKCR .pqi + DeleteRegKey HKCR RetroShare + + ; Remove program/uninstall regsitry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" + DeleteRegKey HKLM SOFTWARE\${APPNAME} + + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" + + ; Remove shortcuts, if any + Delete "$SMPROGRAMS\${APPNAME}\*.*" + + ; Remove desktop shortcut + Delete "$DESKTOP\${APPNAME}.lnk" + + ; Remove Quicklaunch shortcut + Delete "$QUICKLAUNCH\${APPNAME}.lnk" + + ; Remove Autstart + Delete "$SMSTARTUP\${APPNAME}.lnk" + + ; Remove directories used + RMDir "$SMPROGRAMS\${APPNAME}" + RMDir /r "$INSTDIR" + + ; Don't remove the directory, otherwise + ; we lose the XPGP keys. + ; Should make this an option though... + RMDir /r "${DATADIR_NORMAL}\extensions6" + RMDir /r "${DATADIR_NORMAL}\stylesheets" +SectionEnd + +Function .onInit + StrCpy $InstDirNormal "${INSTDIR_NORMAL}" + StrCpy $InstDirPortable "${INSTDIR_PORTABLE}" + + StrCpy $PortableMode 0 + StrCpy $INSTDIR "$InstDirNormal" + StrCpy $DataDir "${DATADIR_NORMAL}" + + InitPluginsDir + Push $R1 + File /oname=$PLUGINSDIR\spltmp.bmp "${SOURCEDIR}\retroshare-gui\src\gui\images\logo\logo_splash.png" + advsplash::show 1200 1000 1000 -1 $PLUGINSDIR\spltmp + Pop $R1 + Pop $R1 + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +!ifdef FRIENDSERVER_EXISTS +Function .onSelChange + SectionGetFlags ${Section_FriendServer} $0 + IntOp $0 $0 & ${SF_SELECTED} + ${If} $0 == ${SF_SELECTED} + # Activate Tor and set readonly + SectionGetFlags ${Section_Tor} $1 + IntOp $1 $1 | ${SF_SELECTED} + IntOp $1 $1 | ${SF_RO} + SectionSetFlags ${Section_Tor} $1 + ${Else} + # Remove readonly from Tor + SectionGetFlags ${Section_Tor} $1 + IntOp $2 ${SF_RO} ~ + IntOp $1 $1 & $2 + SectionSetFlags ${Section_Tor} $1 + ${EndIf} +FunctionEnd +!endif + +# Installation mode + +Function RequireAdmin + UserInfo::GetAccountType + Pop $8 + ${If} $8 != "admin" + MessageBox MB_ICONSTOP "You need administrator rights to install ${APPNAME}" + SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + Abort + ${EndIf} +FunctionEnd + +Function SetModeDestinationFromInstdir + ${If} $PortableMode = 0 + StrCpy $InstDirNormal $INSTDIR + ${Else} + StrCpy $InstDirPortable $INSTDIR + ${EndIf} +FunctionEnd + +Function PortableModePageCreate + Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory + !insertmacro MUI_HEADER_TEXT $(Page_InstallMode) $(Page_InstallMode_Desc) + nsDialogs::Create 1018 + Pop $0 + ${NSD_CreateRadioButton} 5u 25u -10u 8u $(Page_InstallMode_Standard) + Pop $1 + ${NSD_CreateLabel} 18u 40u -10u 24u $(Page_InstallMode_Standard_Desc) + Pop $0 + ${NSD_CreateRadioButton} 5u 75u -10u 8u $(Page_InstallMode_Portable) + Pop $2 + ${NSD_CreateLabel} 18u 90u -10u 24u $(Page_InstallMode_Portable_Desc) + Pop $0 + ${If} $PortableMode = 0 + SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${Else} + SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0 + ${EndIf} + nsDialogs::Show +FunctionEnd + +Function PortableModePageLeave + ${NSD_GetState} $1 $0 + ${If} $0 <> ${BST_UNCHECKED} + StrCpy $PortableMode 0 + StrCpy $INSTDIR $InstDirNormal + Call RequireAdmin + ; Enable sections + SectionSetText ${Section_Shortcuts} $(Section_Shortcuts) + SectionSetText ${Section_StartMenu} $(Section_StartMenu) + SectionSetText ${Section_Desktop} $(Section_Desktop) + SectionSetText ${Section_QuickLaunch} $(Section_QuickLaunch) + SectionSetText ${Section_AutoStart} $(Section_AutoStart) + !insertmacro SelectSection ${Section_Shortcuts} + !insertmacro SelectSection ${Section_AutoStart} + !insertmacro SelectSection ${Section_StartMenu} + !insertmacro SelectSection ${Section_Desktop} + !insertmacro SelectSection ${Section_QuickLaunch} + ${Else} + StrCpy $PortableMode 1 + StrCpy $INSTDIR $InstDirPortable + ; Disable sections + !insertmacro UnselectSection ${Section_Shortcuts} + !insertmacro UnselectSection ${Section_AutoStart} + !insertmacro UnselectSection ${Section_StartMenu} + !insertmacro UnselectSection ${Section_Desktop} + !insertmacro UnselectSection ${Section_QuickLaunch} + SectionSetText ${Section_Shortcuts} "" + SectionSetText ${Section_StartMenu} "" + SectionSetText ${Section_Desktop} "" + SectionSetText ${Section_QuickLaunch} "" + SectionSetText ${Section_AutoStart} "" + ${EndIf} +FunctionEnd + +Function dir_leave + ${If} $PortableMode = 0 + StrCpy $DataDir "${DATADIR_NORMAL}" + StrCpy $StyleSheetDir $DataDir + ${Else} + StrCpy $DataDir "${DATADIR_PORTABLE}" + StrCpy $StyleSheetDir $INSTDIR + ${EndIf} +FunctionEnd From 52fdbd531bdc1dc3e72621b1bda37a701d86c927 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 24 Jul 2025 14:05:31 +0200 Subject: [PATCH 082/147] Added build with Qt 6 for Windows msys2 --- .../Windows-msys2/build/build-installer.bat | 6 +++- build_scripts/Windows-msys2/build/build.bat | 14 +++++---- .../Windows-msys2/build/env-base.bat | 21 ++++++++++++- build_scripts/Windows-msys2/build/env.bat | 10 +++++-- build_scripts/Windows-msys2/build/pack.bat | 30 ++++++++++++------- .../{retroshare-Qt5.nsi => retroshare.nsi} | 2 +- build_scripts/Windows-msys2/readme.md | 3 +- .../Windows-msys2/tools/get-qt-version.bat | 11 +++++-- 8 files changed, 73 insertions(+), 24 deletions(-) rename build_scripts/Windows-msys2/installer/{retroshare-Qt5.nsi => retroshare.nsi} (99%) diff --git a/build_scripts/Windows-msys2/build/build-installer.bat b/build_scripts/Windows-msys2/build/build-installer.bat index da404f273..1840d7202 100644 --- a/build_scripts/Windows-msys2/build/build-installer.bat +++ b/build_scripts/Windows-msys2/build/build-installer.bat @@ -45,6 +45,7 @@ set NSIS_PARAM=%NSIS_PARAM% /DINSTALLERADD="%RsArchiveAdd%" set NSIS_PARAM=%NSIS_PARAM% /DARCHITECTURE="%RsArchitecture%" set NSIS_PARAM=%NSIS_PARAM% /DTOOLCHAIN="%RsToolchain%" set NSIS_PARAM=%NSIS_PARAM% /DREVISION=%RsVersion.Extra% +set NSIS_PARAM=%NSIS_PARAM% /DQTVERSION=%QtVersion% set QtMainVersion=%QtVersion:~0,1% @@ -54,7 +55,10 @@ rem makensis %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\re rem pushd "%SourcePath%\build_scripts\Windows-msys2\installer" rem %EnvMSYS2Cmd% "makensis $0 retroshare-Qt%QtMainVersion%.nsi" "%NSIS_PARAM%" rem popd -"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi" + +rem Currently no need for separate nsi files +rem "%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare-Qt%QtMainVersion%.nsi" +"%RsMinGWPath%\bin\makensis" %NSIS_PARAM% "%SourcePath%\build_scripts\Windows-msys2\installer\retroshare.nsi" exit /B %ERRORLEVEL% diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index fc5632293..c2341d301 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -15,9 +15,11 @@ call "%~dp0env-base.bat" %* if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [Prerequisites] + if not "%ParamNoupdate%"=="1" ( :: Install needed things - %EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson" + %EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt%ParamQtVersion% mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson" :: rnp %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-json-c mingw-w64-%RsMSYS2Architecture%-libbotan" @@ -53,7 +55,7 @@ echo. echo === Version echo. -title Build - %SourceName%-%RsBuildConfig% [Version] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [Version] pushd "%SourcePath%\retroshare-gui\src\gui\images" :: Touch resource file @@ -67,7 +69,7 @@ echo. echo === qmake echo. -title Build - %SourceName%-%RsBuildConfig% [qmake] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [qmake] set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=%RsBuildConfig%" if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% "CONFIG+=rs_autologin" @@ -83,9 +85,9 @@ echo %RsToolchain% >> buildinfo.txt call "%ToolsPath%\msys2-path.bat" "%SourcePath%" MSYS2SourcePath call "%ToolsPath%\msys2-path.bat" "%EnvMSYS2Path%" MSYS2EnvMSYS2Path if "%ClangCompiler%"=="1" ( - %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%" + %EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-clang-g++ %RS_QMAKE_CONFIG%" ) else ( - %EnvMSYS2Cmd% "qmake "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%" + %EnvMSYS2Cmd% "%QMakeCmd% "%MSYS2SourcePath%/RetroShare.pro" -r -spec win32-g++ %RS_QMAKE_CONFIG%" ) if errorlevel 1 goto error @@ -93,7 +95,7 @@ echo. echo === make echo. -title Build - %SourceName%-%RsBuildConfig% [make] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [make] %EnvMSYS2Cmd% "make -j %CoreCount%" if errorlevel 1 goto error diff --git a/build_scripts/Windows-msys2/build/env-base.bat b/build_scripts/Windows-msys2/build/env-base.bat index 6e5c8480f..2269e1294 100644 --- a/build_scripts/Windows-msys2/build/env-base.bat +++ b/build_scripts/Windows-msys2/build/env-base.bat @@ -12,7 +12,9 @@ set ParamNoupdate=0 set CoreCount=%NUMBER_OF_PROCESSORS% set RS_QMAKE_CONFIG= set RsToolchain= +set ParamQtVersion=5 set tcc=0 +set QtVersionCount=0 :parameter_loop if "%~1" NEQ "" ( @@ -43,6 +45,12 @@ if "%~1" NEQ "" ( set /A tcc=tcc+1 ) else if "%%~a"=="release" ( set ParamRelease=1 + ) else if "%%~a"=="qt5" ( + set ParamQtVersion=5 + set /A QtVersionCount+=1 + ) else if "%%~a"=="qt6" ( + set ParamQtVersion=6 + set /A QtVersionCount+=1 ) else if "%%~a"=="debug" ( set ParamDebug=1 ) else if "%%~a"=="autologin" ( @@ -78,6 +86,16 @@ if %tcc% NEQ 1 ( goto :usage ) +if %QtVersionCount% GTR 1 ( + echo Multiple Qt versions specified + goto :usage +) + +if "%ParamQtVersion%" NEQ "5" if "%ParamQtVersion%" NEQ "6" ( + echo Wrong Qt version specified + goto :usage +) + if "%RsToolchain%"=="mingw32" ( set RsArchitecture=x86 set RsMSYS2Architecture=i686 @@ -140,7 +158,7 @@ exit /B 0 :usage echo. -echo Usage: 32^|64^|other release^|debug [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."] +echo Usage: 32^|64^|other release^|debug qt5^|qt6 [autologin plugins webui singlethread clang indexing friendserver noupdate] ["CONFIG+=..."] echo. echo Mandatory parameter echo 32^|64 32-bit or 64-bit version (same as mingw32 or mingw64) @@ -148,6 +166,7 @@ echo Or you can specify any other toolchain supported by msys echo mingw32^|mingw64^|clang32^|clang64^|ucrt64^|clangarm64 echo More info: https://www.msys2.org/docs/environments echo release^|debug Build release or debug version +echo qt5^|qt6 Build with Qt 5 (default) or Qt 6 echo. echo Optional parameter (need clean when changed) echo autologin Build with autologin diff --git a/build_scripts/Windows-msys2/build/env.bat b/build_scripts/Windows-msys2/build/env.bat index 38ceeaee3..e760179e3 100644 --- a/build_scripts/Windows-msys2/build/env.bat +++ b/build_scripts/Windows-msys2/build/env.bat @@ -1,6 +1,6 @@ call "%~dp0env-base.bat" %* if errorlevel 2 exit /B 2 -if errorlevel 1 goto error_env +if errorlevel 1 exit /B 1 set BuildPath=%EnvRootPath%\builds set DeployPath=%EnvRootPath%\deploy @@ -8,8 +8,14 @@ set DeployPath=%EnvRootPath%\deploy if not exist "%BuildPath%" mkdir "%BuildPath%" if not exist "%DeployPath%" mkdir "%DeployPath%" +set QMakeCmd= +if "%ParamQtVersion%"=="5" set QMakeCmd=qmake +if "%ParamQtVersion%"=="6" set QMakeCmd=qmake6 +if "%QMakeCmd%"=="" %cecho% error "Unknown Qt version %ParamQtVersion%." & exit /B 1 + :: Get Qt version -call "%ToolsPath%\get-qt-version.bat" QtVersion +call "%ToolsPath%\get-qt-version.bat" QtVersion %QMakeCmd% +if errorlevel 1 %cecho% error "Cannot get Qt version." & exit /B 1 if "%QtVersion%"=="" %cecho% error "Cannot get Qt version." & exit /B 1 set RsMinGWPath=%EnvMSYS2BasePath%\%RsToolchain% diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index dfa3827f5..bf1533a05 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -66,15 +66,17 @@ set QtSharePath=%RsMinGWPath%\share\qt%QtMainVersion%\ rem Qt 4 = QtSvg4.dll rem Qt 5 = Qt5Svg.dll +rem Qt 6 = Qt6Svg.dll set QtMainVersion1= set QtMainVersion2= if "%QtMainVersion%"=="4" set QtMainVersion2=4 if "%QtMainVersion%"=="5" set QtMainVersion1=5 +if "%QtMainVersion%"=="6" set QtMainVersion1=6 if "%RsBuildConfig%" NEQ "release" ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%-%RsBuildConfig%.7z ) else ( - set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z + set Archive=%RsPackPath%\RetroShare-%RsVersion%-Windows-Portable-%RsDate%-%RsVersion.Extra%-Qt-%QtVersion%-%RsToolchain%-msys2%RsType%%RsArchiveAdd%.7z ) if exist "%Archive%" del /Q "%Archive%" @@ -82,7 +84,7 @@ if exist "%Archive%" del /Q "%Archive%" :: Create deploy path mkdir "%RsDeployPath%" -title Pack - %SourceName%%RsType%-%RsBuildConfig% [copy files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [copy files] set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc set Extensions= @@ -119,18 +121,24 @@ for /D %%D in ("%RsBuildPath%\plugins\*") do ( echo copy Qt DLL's copy "%RsMinGWPath%\bin\Qt%QtMainVersion1%Svg%QtMainVersion2%.dll" "%RsDeployPath%" %Quite% -if "%QtMainVersion%"=="5" ( +if %QtMainVersion% GEQ 5 ( mkdir "%RsDeployPath%\platforms" copy "%QtSharePath%\plugins\platforms\qwindows.dll" "%RsDeployPath%\platforms" %Quite% +) + +if "%QtMainVersion%"=="5" ( mkdir "%RsDeployPath%\audio" copy "%QtSharePath%\plugins\audio\qtaudio_windows.dll" "%RsDeployPath%\audio" %Quite% ) -if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" ( - echo copy styles - mkdir "%RsDeployPath%\styles" %Quite% +echo copy styles +mkdir "%RsDeployPath%\styles" %Quite% +if "%QtMainVersion%"=="5" ( copy "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" "%RsDeployPath%\styles" %Quite% ) +if "%QtMainVersion%"=="6" ( + copy "%QtSharePath%\plugins\styles\qmodernwindowsstyle.dll" "%RsDeployPath%\styles" %Quite% +) copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite% del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite% @@ -171,11 +179,13 @@ xcopy /S "%SourcePath%\retroshare-gui\src\license" "%RsDeployPath%\license" %Qui echo copy translation copy "%SourcePath%\retroshare-gui\src\translations\qt_tr.qm" "%RsDeployPath%\translations" %Quite% copy "%QtSharePath%\translations\qt_*.qm" "%RsDeployPath%\translations" %Quite% -if "%QtMainVersion%"=="5" ( +if "%QtMainVersion%"=="6" ( copy "%QtSharePath%\translations\qtbase_*.qm" "%RsDeployPath%\translations" %Quite% - copy "%QtSharePath%\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtSharePath%\translations\qtquick1_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtSharePath%\translations\qtmultimedia_*.qm" "%RsDeployPath%\translations" %Quite% +) +if "%QtMainVersion%"=="5" ( + copy "%QtSharePath%\translations\qtscript_*.qm" "%RsDeployPath%\translations" %Quite% copy "%QtSharePath%\translations\qtxmlpatterns_*.qm" "%RsDeployPath%\translations" %Quite% ) @@ -200,7 +210,7 @@ if "%ParamWebui%"=="1" ( ) rem pack files -title Pack - %SourceName%%RsType%-%RsBuildConfig% [pack files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% %RsToolchain% [pack files] "%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*" diff --git a/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi b/build_scripts/Windows-msys2/installer/retroshare.nsi similarity index 99% rename from build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi rename to build_scripts/Windows-msys2/installer/retroshare.nsi index f37f33cf8..dcbe1b808 100644 --- a/build_scripts/Windows-msys2/installer/retroshare-Qt5.nsi +++ b/build_scripts/Windows-msys2/installer/retroshare.nsi @@ -76,7 +76,7 @@ ${!defineifexist} TOR_EXISTS "${DEPLOYDIR}\tor.exe" # Main Install settings Name "${APPNAMEANDVERSION}" InstallDirRegKey HKLM "Software\${APPNAME}" "" -OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe" +OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}-${TOOLCHAIN}-msys2${RSTYPE}${INSTALLERADD}-setup.exe" BrandingText "${APPNAMEANDVERSION}" RequestExecutionlevel highest # Use compression diff --git a/build_scripts/Windows-msys2/readme.md b/build_scripts/Windows-msys2/readme.md index f5e214ee7..e140cf0fa 100644 --- a/build_scripts/Windows-msys2/readme.md +++ b/build_scripts/Windows-msys2/readme.md @@ -44,8 +44,9 @@ Run the scripts in this order: **Always delete the build artifacts folder if you enable or disable extra features after the build command: <sourcefolder>-msys2\deploy\builds** * Mandatory - * 32 or 64: 32 or 64 bit version + * 32, 64, mingw32, mingw64, ucrt64, clang32, clang64 or clangarm64: It sets the msys2 build environment to the selected value. 32 is a shortcut for mingw32, 64 is a shortcut for mingw64. Default in build.bat and buil-tor.bat is 64. * release or debug: normally you would like to use the release option + * qt5 or qt6: build with Qt 5 (default) or Qt 6 * Extra features (optional) * autologin: enable autologin * plugins: build plugins diff --git a/build_scripts/Windows-msys2/tools/get-qt-version.bat b/build_scripts/Windows-msys2/tools/get-qt-version.bat index 4124770ee..99607211b 100644 --- a/build_scripts/Windows-msys2/tools/get-qt-version.bat +++ b/build_scripts/Windows-msys2/tools/get-qt-version.bat @@ -1,5 +1,5 @@ :: Usage: -:: call get-qt-version.bat variable +:: call get-qt-version.bat variable qmake setlocal @@ -10,9 +10,16 @@ if "%Var%"=="" ( exit /B 1 ) +set QMakeCmd=%~2 +if "%QMakeCmd%"=="" ( + echo. + echo Parameter error. + exit /B 1 +) + set QtVersion= -%EnvMSYS2Cmd% "qmake -version" >"%~dp0qtversion.tmp" +%EnvMSYS2Cmd% "%QMakeCmd% -version" >"%~dp0qtversion.tmp" for /F "tokens=1,2,3,4" %%A in (%~sdp0qtversion.tmp) do ( if "%%A"=="Using" ( set QtVersion=%%D From a6cf325db525926a5397e42e9c072c1393273b36 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 29 Jul 2025 14:52:33 +0200 Subject: [PATCH 083/147] Fixed converting char* to QString for Qt 6.4 --- retroshare-gui/src/gui/chat/ChatStyle.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/retroshare-gui/src/gui/chat/ChatStyle.cpp b/retroshare-gui/src/gui/chat/ChatStyle.cpp index dab12f082..d6e380f40 100644 --- a/retroshare-gui/src/gui/chat/ChatStyle.cpp +++ b/retroshare-gui/src/gui/chat/ChatStyle.cpp @@ -426,8 +426,8 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle while (reader.atEnd() == false) { reader.readNext(); if (reader.isStartElement()) { - if (reader.name() == "RetroShare_Style") { - if (reader.attributes().value("version") == "1.0") { + if (reader.name() == QString("RetroShare_Style")) { + if (reader.attributes().value("version") == QString("1.0")) { info.stylePath = stylePathRelative; continue; } @@ -439,22 +439,22 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle continue; } - if (reader.name() == "style") { + if (reader.name() == QString("style")) { // read style information while (reader.atEnd() == false) { reader.readNext(); if (reader.isEndElement()) { - if (reader.name() == "style") { + if (reader.name() == QString("style")) { break; } continue; } if (reader.isStartElement()) { - if (reader.name() == "name") { + if (reader.name() == QString("name")) { info.styleName = reader.readElementText(); continue; } - if (reader.name() == "description") { + if (reader.name() == QString("description")) { info.styleDescription = reader.readElementText(); continue; } @@ -464,22 +464,22 @@ static bool getStyleInfo(QString stylePath, QString stylePathRelative, ChatStyle continue; } - if (reader.name() == "author") { + if (reader.name() == QString("author")) { // read author information while (reader.atEnd() == false) { reader.readNext(); if (reader.isEndElement()) { - if (reader.name() == "author") { + if (reader.name() == QString("author")) { break; } continue; } if (reader.isStartElement()) { - if (reader.name() == "name") { + if (reader.name() == QString("name")) { info.authorName = reader.readElementText(); continue; } - if (reader.name() == "email") { + if (reader.name() == QString("email")) { info.authorEmail = reader.readElementText(); continue; } From 9ec24f826fed2d42adc5675d39b15701aa51c5af Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Wed, 30 Jul 2025 21:55:38 +0200 Subject: [PATCH 084/147] Added Qt5 workflow --- .github/workflows/ci-mingw64.yml | 70 ++++++++++++++++++++++++++++++++ .github/workflows/ci-ucrt64.yml | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+) create mode 100644 .github/workflows/ci-mingw64.yml create mode 100644 .github/workflows/ci-ucrt64.yml diff --git a/.github/workflows/ci-mingw64.yml b/.github/workflows/ci-mingw64.yml new file mode 100644 index 000000000..aaf1989dc --- /dev/null +++ b/.github/workflows/ci-mingw64.yml @@ -0,0 +1,70 @@ +name: MINGW64 Qt5 Build + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow}}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: windows-latest + permissions: + actions: write + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup MSYS2 + uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0 + with: + msystem: MINGW64 + update: true + install: >- + base-devel + git + wget + p7zip + gcc + perl + ruby + doxygen + cmake + mingw-w64-x86_64-toolchain + mingw-w64-x86_64-miniupnpc + mingw-w64-x86_64-libxslt + mingw-w64-x86_64-xapian-core + mingw-w64-x86_64-sqlcipher + mingw-w64-x86_64-qt5-base + mingw-w64-x86_64-qt5-multimedia + mingw-w64-x86_64-ccmake + mingw-w64-x86_64-rapidjson + mingw-w64-x86_64-json-c + mingw-w64-x86_64-libbotan + mingw-w64-x86_64-asio + + - name: Checkout submodules + run: | + env + git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/ + git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed + + - name: CI-Build + run: | + qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + mingw32-make -j3 diff --git a/.github/workflows/ci-ucrt64.yml b/.github/workflows/ci-ucrt64.yml new file mode 100644 index 000000000..97432fd71 --- /dev/null +++ b/.github/workflows/ci-ucrt64.yml @@ -0,0 +1,70 @@ +name: UCRT64 Qt5 Build + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow}}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: windows-latest + permissions: + actions: write + defaults: + run: + shell: msys2 {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup MSYS2 + uses: msys2/setup-msys2@40677d36a502eb2cf0fb808cc9dec31bf6152638 # v2.28.0 + with: + msystem: UCRT64 + update: true + install: >- + base-devel + git + wget + p7zip + gcc + perl + ruby + doxygen + cmake + mingw-w64-ucrt-x86_64-toolchain + mingw-w64-ucrt-x86_64-miniupnpc + mingw-w64-ucrt-x86_64-libxslt + mingw-w64-ucrt-x86_64-xapian-core + mingw-w64-ucrt-x86_64-sqlcipher + mingw-w64-ucrt-x86_64-qt5-base + mingw-w64-ucrt-x86_64-qt5-multimedia + mingw-w64-ucrt-x86_64-ccmake + mingw-w64-ucrt-x86_64-rapidjson + mingw-w64-ucrt-x86_64-json-c + mingw-w64-ucrt-x86_64-libbotan + mingw-w64-ucrt-x86_64-asio + + - name: Checkout submodules + run: | + env + git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/ + git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed + + - name: CI-Build + run: | + qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + mingw32-make -j3 From 6899b1548cbe6be5a5ce47fdf3a5eedc2a5a7eb1 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Wed, 30 Jul 2025 22:07:26 +0200 Subject: [PATCH 085/147] update changes --- .github/workflows/ci-mingw64-Qt6.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-mingw64-Qt6.yml b/.github/workflows/ci-mingw64-Qt6.yml index b23a537f3..2517bccc5 100644 --- a/.github/workflows/ci-mingw64-Qt6.yml +++ b/.github/workflows/ci-mingw64-Qt6.yml @@ -63,9 +63,9 @@ jobs: run: | env git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/ - git submodule update --init supportlibs/librnp supportlibs/rapidjson + git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed - name: Build run: | - qmake6 ../RetroShare -spec win32-g++ "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + qmake6 . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" mingw32-make -j3 \ No newline at end of file From 14fab2f6c5db605395edb049488b65d1a83037ed Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 2 Aug 2025 22:46:42 +0200 Subject: [PATCH 086/147] updated submodule libretroshare --- libretroshare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare b/libretroshare index ac83e00ea..da6b849a4 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit ac83e00ea7a26cd6cf57cefef745d6dcfd07e5da +Subproject commit da6b849a41f3cf6e60f6f76e1f3c4463876a8741 From e26ed4c3c3750940eabb9f24b920e41bd7fc97ed Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 3 Aug 2025 00:29:06 +0200 Subject: [PATCH 087/147] Removed jsonapi & webui config from workflow --- .github/workflows/ci-mingw64.yml | 2 +- .github/workflows/ci-ucrt64.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-mingw64.yml b/.github/workflows/ci-mingw64.yml index aaf1989dc..d562938b3 100644 --- a/.github/workflows/ci-mingw64.yml +++ b/.github/workflows/ci-mingw64.yml @@ -66,5 +66,5 @@ jobs: - name: CI-Build run: | - qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" mingw32-make -j3 diff --git a/.github/workflows/ci-ucrt64.yml b/.github/workflows/ci-ucrt64.yml index 97432fd71..df569b8bf 100644 --- a/.github/workflows/ci-ucrt64.yml +++ b/.github/workflows/ci-ucrt64.yml @@ -66,5 +66,5 @@ jobs: - name: CI-Build run: | - qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + qmake . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" mingw32-make -j3 From a5076d34d82423aad36386d5198de7007334c86c Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 3 Aug 2025 13:45:45 +0200 Subject: [PATCH 088/147] Removed appveyor configuration --- appveyor.yml | 312 --------------------------------------------------- 1 file changed, 312 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 5bc004fa1..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,312 +0,0 @@ -# SPDX-FileCopyrightText: (C) 2004-2019 Retroshare Team -# SPDX-License-Identifier: CC0-1.0 - -# Notes: -# - Minimal appveyor.yml file is an empty file. All sections are optional. -# - Indent each level of configuration with 2 spaces. Do not use tabs! -# - All section names are case-sensitive. -# - Section names should be unique on each level. -# from example: -# https://github.com/Phonations/Joker/blob/master/appveyor.yml -# https://github.com/unicorn-engine/autobuild/blob/master/.appveyor.yml - -#---------------------------------# -# general configuration # -#---------------------------------# - -# version format -version: RetroShare-git-{branch}-{build} -image: Visual Studio 2019 - -# you can use {branch} name in version format too -# version: 1.0.{build}-{branch} - -# branches to build -branches: - # whitelist - #only: - # - master - - # blacklist - except: - - /^skipthisbranch$/ - -# Do not build on tags (GitHub only) -skip_tags: true - -# Skipping commits with particular message or from user -skip_commits: - message: /Created.*\.(png|jpg|jpeg|bmp|gif)/ # Regex for matching commit message - #author: Anonymous # Commit author's username, name, email or regexp maching one of these. - -#---------------------------------# -# environment configuration # -#---------------------------------# - -# Operating system (build VM template) -#os: Windows Server 2012 - -# scripts that are called at very beginning, before repo cloning -init: - - git config --global core.autocrlf input - #To get RDP while compiling - - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) -on_finish: - #To get RDP running after compiling - #- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) - -# clone directory -clone_folder: C:\projects\RetroShare - -# fetch repository as zip archive -#shallow_clone: true # default is "false" - -# set clone depth -clone_depth: 2000 # clone entire repository history if not defined - -environment: - global: -## Qt: https://www.appveyor.com/docs/installed-software#qt -# QTDIR: C:\Qt\5.10.1\mingw53_32 - MSYS2_ARCH: i686 - TARGET: i686_32-pc-msys - MINGW_PREFIX: C:\msys64\mingw32 - RS_DEPLOY: RetroShare_deploy - - -# build cache to preserve files/folders between builds -#cache: -# Disabled because it's bigger then supported by appveyor free plan -# - C:\msys64\var\cache\pacman\pkg - -# scripts that run after cloning repository -#install: -# # by default, all script lines are interpreted as batch -# - echo This is batch -# # to run script as a PowerShell command prepend it with ps: -# - ps: Write-Host 'This is PowerShell' -# # batch commands start from cmd: -# - cmd: echo This is batch again -# - cmd: set MY_VAR=12345 -install: - # We cannot get OBS submodule as it use illegal folder name for windows. - #- git submodule update --init - # Configuring MSys2 - - set PATH=C:\msys64\usr\bin;%PATH% - - set PATH=C:\msys64\mingw32\bin;%PATH% - - > - pacman --noconfirm -Sy - mingw-w64-i686-qt5 mingw-w64-i686-miniupnpc mingw-w64-i686-rapidjson - mingw-w64-i686-sqlcipher mingw-w64-i686-xapian-core mingw-w64-i686-cmark - #- set PATH=C:\msys64\mingw32\qt5-static\bin\;%PATH% - - # Configuring Qt -# - set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw491_32\bin;%PATH% - - # Hack for new MSys2 - - copy C:\msys64\mingw32\i686-w64-mingw32\bin\ar.exe C:\msys64\mingw32\bin\i686-w64-mingw32-ar.exe - - copy C:\msys64\mingw32\i686-w64-mingw32\bin\ranlib.exe C:\msys64\mingw32\bin\i686-w64-mingw32-ranlib.exe - - copy C:\msys64\mingw32\bin\windres.exe C:\msys64\mingw32\bin\i686-w64-mingw32-windres.exe - - copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ar.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ar.exe - - copy C:\msys64\mingw64\x86_64-w64-mingw32\bin\ranlib.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-ranlib.exe - - copy C:\msys64\mingw64\bin\windres.exe C:\msys64\mingw64\bin\x86_64-w64-mingw32-windres.exe - - # Work-around linker looking for Qt dll in wrong place - - copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll C:\msys64\mingw32\lib\Qt5PrintSupport.dll - - copy C:\msys64\mingw32\bin\Qt5Widgets.dll C:\msys64\mingw32\lib\Qt5Widgets.dll - - copy C:\msys64\mingw32\bin\Qt5Multimedia.dll C:\msys64\mingw32\lib\Qt5Multimedia.dll - - copy C:\msys64\mingw32\bin\Qt5Gui.dll C:\msys64\mingw32\lib\Qt5Gui.dll - - copy C:\msys64\mingw32\bin\Qt5Network.dll C:\msys64\mingw32\lib\Qt5Network.dll - - copy C:\msys64\mingw32\bin\Qt5Xml.dll C:\msys64\mingw32\lib\Qt5Xml.dll - - copy C:\msys64\mingw32\bin\Qt5Core.dll C:\msys64\mingw32\lib\Qt5Core.dll - - -#---------------------------------# -# build configuration # -#---------------------------------# - -# build platform, i.e. x86, x64, Any CPU. This setting is optional. -platform: x86 - -# to add several platforms to build matrix: -#platform: -# - x86 -# - Any CPU - -# build Configuration, i.e. Debug, Release, etc. -configuration: Release - -# to add several configurations to build matrix: -#configuration: -# - Debug -# - Release - -# scripts to run before build -before_build: - - cd C:\projects\RetroShare - - git submodule update --init - - cd C:\projects\ - - mkdir RetroShare-build - - cd RetroShare-build -# - find C:\ > filelist.txt - -# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services) -before_package: - -# to run your custom scripts instead of automatic MSBuild -build_script: - - env - - qmake ../RetroShare -spec win32-g++ "CONFIG+=debug" - - mingw32-make -j3 - -# scripts to run after build -after_build: - - find . - - - mkdir %RS_DEPLOY% - - copy retroshare-gui\src\debug\retroshare.exe %RS_DEPLOY%\ - - copy retroshare-service\src\debug\retroshare-service.exe %RS_DEPLOY%\ -# - copy retroshare-service\src\retroshare-service.exe %RS_DEPLOY%\ -# - copy retroshare-gui\src\retroshare.exe %RS_DEPLOY%\ - -## In Debug build winedeplyqt forget the non debug Qt libs - - copy C:\msys64\mingw32\bin\Qt5Svg.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Core.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Multimedia.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Widgets.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Xml.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5PrintSupport.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Gui.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\Qt5Network.dll %RS_DEPLOY%\ - - - mkdir %RS_DEPLOY%\playlistformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\playlistformats\qtmultimedia_m3u.dll %RS_DEPLOY%\playlistformats - - - mkdir %RS_DEPLOY%\printsupport\ - - copy C:\msys64\mingw32\share\qt5\plugins\printsupport\windowsprintersupport.dll %RS_DEPLOY%\printsupport\ - - - mkdir %RS_DEPLOY%\iconengines\ - - copy C:\msys64\mingw32\share\qt5\plugins\iconengines\qsvgicon.dll %RS_DEPLOY%\iconengines\ - - - mkdir %RS_DEPLOY%\bearer\ - - copy C:\msys64\mingw32\share\qt5\plugins\bearer\qgenericbearer.dll %RS_DEPLOY%\bearer\ - - - mkdir %RS_DEPLOY%\mediaservice\ - - copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\qtmedia_audioengine.dll %RS_DEPLOY%\mediaservice\ - - copy C:\msys64\mingw32\share\qt5\plugins\mediaservice\dsengine.dll %RS_DEPLOY%\mediaservice\ - - - mkdir %RS_DEPLOY%\styles\ - - copy C:\msys64\mingw32\share\qt5\plugins\styles\qwindowsvistastyle.dll %RS_DEPLOY%\styles\ - - - mkdir %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwebp.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjpeg.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtiff.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qtga.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qjp2.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qico.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qwbmp.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qicns.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qgif.dll %RS_DEPLOY%\imageformats\ - - copy C:\msys64\mingw32\share\qt5\plugins\imageformats\qsvg.dll %RS_DEPLOY%\imageformats\ - - - mkdir %RS_DEPLOY%\platforms\ - - copy C:\msys64\mingw32\share\qt5\plugins\platforms\qwindows.dll %RS_DEPLOY%\platforms\ - - - mkdir %RS_DEPLOY%\audio\ - - copy C:\msys64\mingw32\share\qt5\plugins\audio\qtaudio_windows.dll %RS_DEPLOY%\audio\ - - - windeployqt %RS_DEPLOY%\retroshare.exe - - - copy C:\msys64\mingw32\bin\libbz2*.dll %RS_DEPLOY%\ - #- copy C:\msys64\mingw32\bin\libeay32.dll %RS_DEPLOY%\ - - copy C:\OpenSSL-Win32\libeay32.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libminiupnpc.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libsqlcipher*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libsqlite3*.dll %RS_DEPLOY%\ - #- copy C:\msys64\mingw32\bin\ssleay32.dll %RS_DEPLOY%\ - - copy C:\OpenSSL-Win32\ssleay32.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\zlib*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libgcc_s_dw2*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libstdc*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libwinpthread*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libicu*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libpcre*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libharfbuzz*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libpng*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libfreetype*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libglib*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libgraphite2.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libintl*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libiconv*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libjasper*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libjpeg*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libtiff*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libwebp*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libwebpdemux*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\liblzma*.dll %RS_DEPLOY%\ - -## Needed for cmark - - copy C:\msys64\mingw32\bin\libcmark*.dll %RS_DEPLOY%\ - - copy C:\msys64\mingw32\bin\libdouble-conversion*.dll %RS_DEPLOY%\ - -# to disable automatic builds -#build: off - -#---------------------------------# -# artifacts configuration # -#---------------------------------# - -artifacts: - - path: '**\*.exe' - - path: filelist.txt - - path: $(RS_DEPLOY) - -# -# # pushing a single file -# - path: test.zip -# -# # pushing a single file with environment variable in path and "Deployment name" specified -# - path: MyProject\bin\$(configuration) -# name: myapp -# -# # pushing entire folder as a zip archive -# - path: logs - - -#---------------------------------# -# deployment configuration # -#---------------------------------# -#No deployment under unknown computer!!! - -#---------------------------------# -# global handlers # -#---------------------------------# - -# on successful build -#on_success: -# - do something - -# on build failure -#on_failure: -# - do something - -# after build failure or success -#on_finish: -# - do something - - -#---------------------------------# -# notifications # -#---------------------------------# - -notifications: - - # Email - - provider: Email - to: - - retrosharephenom@gmail.com - subject: 'Build {{status}}' # optional - message: "{{message}}, {{commitId}}, ..." # optional - on_build_status_changed: true From 5554e35e2163a4c675e491f3dd6cd9521e01fb9e Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 3 Aug 2025 13:46:39 +0200 Subject: [PATCH 089/147] Updated msys2 installation for Windows build --- build_scripts/Windows-msys2/env/tools/prepare-msys2.bat | 2 +- build_scripts/Windows/env/tools/prepare-msys2.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat index cea1df073..2f1b6b706 100644 --- a/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat @@ -16,7 +16,7 @@ if "%~1"=="clean" ( goto exit ) -set MSYS2Version=20241208 +set MSYS2Version=20250622 set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install% diff --git a/build_scripts/Windows/env/tools/prepare-msys2.bat b/build_scripts/Windows/env/tools/prepare-msys2.bat index ba2f12ce6..e4b90cd75 100644 --- a/build_scripts/Windows/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows/env/tools/prepare-msys2.bat @@ -16,7 +16,7 @@ if "%~1"=="clean" ( goto exit ) -set MSYS2Version=20241208 +set MSYS2Version=20250622 set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install% From a2cd31443cfdb2c9ae8a8c9c2564b0aae14e5c73 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 3 Aug 2025 14:23:13 +0200 Subject: [PATCH 090/147] Added Linux Guide --- .../Debian+Ubuntu/Linux_InstallGuide.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 build_scripts/Debian+Ubuntu/Linux_InstallGuide.md diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md new file mode 100644 index 000000000..5ecbe96a8 --- /dev/null +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -0,0 +1,140 @@ + +## Compilation on Linux + + +### Install package dependencies: +#### Debian/Ubuntu +```bash + sudo apt-get install g++ cmake qt5-qmake qtmultimedia5-dev \ + libqt5x11extras5-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \ + libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev libasio-dev +``` + +Additional dependencies for Qt6 compile +```bash + sudo apt-get install qt6-base-dev qt6-multimedia-dev qt6-5compat-dev +``` + +Additional dependencies for Feedreader plugin: +```bash + sudo apt-get install libxml2-dev libxslt1-dev +``` + +Additional dependencies for Voip plugin: +```bash + sudo apt-get install libavcodec-dev libcurl4-openssl-dev \ + libqt5multimedia5-plugins libspeexdsp-dev +``` + +#### openSUSE +```bash + sudo zypper install gcc-c++ cmake libqt5-qtbase-devel \ + libqt5-qtmultimedia-devel libqt5-qtx11extras-devel libbz2-devel \ + libopenssl-devel libupnp-devel libXss-devel sqlcipher-devel rapidjson-devel +``` + +Additional dependencies for plugins: +```bash + sudo zypper install ffmpeg-4-libavcodec-devel libcurl-devel libxml2-devel \ + libxslt-devel speex-devel speexdsp-devel +``` + +#### Linux Mint +```bash + sudo apt-get install git g++ cmake qt5-qmake qtmultimedia5-dev \ + libqt5x11extras5-dev libupnp-dev libxss-dev libssl-dev libsqlcipher-dev \ + rapidjson-dev doxygen libbz2-dev libjson-c-dev libbotan-2-dev libasio-dev +``` + +#### Arch Linux +```bash + pacman -S base-devel libgnome-keyring cmake qt5-tools qt5-multimedia qt5-x11extras \ + rapidjson libupnp libxslt libxss sqlcipher botan2 bzip2 json-c +``` + +### Checkout the source code +```bash + cd ~ + git clone https://github.com/RetroShare/RetroShare.git retroshare +``` + +### Checkout the submodules +```bash + cd retroshare + git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ + git submodule update --init --remote supportlibs/librnp supportlibs/restbed supportlibs/rapidjson +``` + +### Compile +```bash + qmake CONFIG+=release CONFIG+=rs_jsonapi CONFIG+=rs_webui + make +``` + +### Install +```bash + sudo make install +``` + +The executable produced will be: +```bash + - /usr/bin/RetroShare +``` + +### For packagers + +Packagers can use PREFIX and LIB\_DIR to customize the installation paths: +```bash + qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release" + make + make INSTALL_ROOT=${PKGDIR} install +``` + + +### libsqlcipher +If libsqlcipher is not available as a package + +You need to place sqlcipher so that the hierarchy is: + + retroshare + | + +--- trunk + | + +--- lib + | + +---- sqlcipher +```bash + mkdir lib + cd lib + git clone git://github.com/sqlcipher/sqlcipher.git + cd sqlcipher + ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" + make + cd .. +``` + +### Build options + +* Mandatory + * release or debug: normally you would like to use the release option +* Extra features (optional) + * rs_autologin: enable autologin + * retroshare_plugins: build plugins + * rs_webui: enable remoting features + * rs_jsonapi: enable json api interface + * gxsthewire enable Wire service + * wikipoos enable Wiki service + * rs_use_native_dialogs enable native dialogs + * rs_deep_channels_index build with deep channel indexing support + * rs_deep_files_index build with deep file indexing support + * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* + +Example: + +```batch +qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark +qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin +qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos +``` + + From 8c6d49158ef004ae7368700ce23607ef51fd33e8 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 3 Aug 2025 14:29:34 +0200 Subject: [PATCH 091/147] Added status badge from workflow --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 04f1e8c95..9f4c26f66 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ RetroShare provides file sharing, chat, messages, forums, channels, boards and m [![GitHub release](https://img.shields.io/github/release/retroshare/retroshare.svg?label=latest%20release)](https://github.com/retroshare/retroshare/releases/latest) [![Downloads](https://img.shields.io/github/downloads/retroshare/retroshare/total)](https://github.com/retroshare/retroshare/releases/latest) +[![MINGW64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml) +[![UCRT64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml) [![GNU/Linux (via Gitlab CI)](https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/RetroShare/-/commits/master) [![libretroshare GNU/Linux, Android (via Gitlab CI)](https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/libretroshare/-/commits/master) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/RetroShare/RetroShare) From dc1901b23640b70d96fa11d81eb254927fd7eda6 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 3 Aug 2025 15:53:47 +0200 Subject: [PATCH 092/147] fix to use em --- retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss | 2 +- retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss index e050115a8..f9343c3ea 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard_Dark.qss @@ -1243,7 +1243,7 @@ QComboBox { /* changed to 4px to fix #239 */ /* Fixes #103, #111 */ min-height: 1.5em; - min-width: 35px; + min-width: 2em; /* padding-top: 2px; removed to fix #132 */ /* padding-bottom: 2px; removed to fix #132 */ /* min-width: 75px; removed to fix #109 */ diff --git a/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss b/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss index d6a925428..a6698c637 100644 --- a/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss +++ b/retroshare-gui/src/gui/qss/stylesheet/Standard_Light.qss @@ -1243,7 +1243,7 @@ QComboBox { /* changed to 4px to fix #239 */ /* Fixes #103, #111 */ min-height: 1.5em; - min-width: 35px; + min-width: 2em; /* padding-top: 2px; removed to fix #132 */ /* padding-bottom: 2px; removed to fix #132 */ /* min-width: 75px; removed to fix #109 */ From 1b239c2f2a8fdf8884c2fa760c2f936908637292 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 3 Aug 2025 16:08:34 +0200 Subject: [PATCH 093/147] update instructions --- build_scripts/Debian+Ubuntu/Linux_InstallGuide.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 5ecbe96a8..fcb1549c0 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -10,14 +10,15 @@ libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev libasio-dev ``` -Additional dependencies for Qt6 compile +Additional packages to compile with Qt6: ```bash sudo apt-get install qt6-base-dev qt6-multimedia-dev qt6-5compat-dev ``` +To use only Qt6 the packages `qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev` are not needed. Additional dependencies for Feedreader plugin: ```bash - sudo apt-get install libxml2-dev libxslt1-dev + sudo apt-get install libxml2-dev libxslt1-dev libcurl4-openssl-dev ``` Additional dependencies for Voip plugin: @@ -26,6 +27,11 @@ Additional dependencies for Voip plugin: libqt5multimedia5-plugins libspeexdsp-dev ``` +Autologin: +```bash + sudo apt install libsecret-1-dev +``` + #### openSUSE ```bash sudo zypper install gcc-c++ cmake libqt5-qtbase-devel \ From b75a14fac5d963a4822f82e7ed4537e07b128c39 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 3 Aug 2025 19:33:35 +0200 Subject: [PATCH 094/147] uodate opensuse packages --- build_scripts/Debian+Ubuntu/Linux_InstallGuide.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index fcb1549c0..5621e6a18 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -34,9 +34,15 @@ Autologin: #### openSUSE ```bash - sudo zypper install gcc-c++ cmake libqt5-qtbase-devel \ + sudo zypper install git gcc-c++ cmake libqt5-qtbase-devel \ libqt5-qtmultimedia-devel libqt5-qtx11extras-devel libbz2-devel \ - libopenssl-devel libupnp-devel libXss-devel sqlcipher-devel rapidjson-devel + libopenssl-devel libupnp-devel libXss-devel sqlcipher-devel rapidjson-devel \ + json-c botan bzip2 +``` + +Additional packages to compile with Qt6: +```bash + sudo zypper install qt6-base-devel qt6-multimedia-devel qt6-qt5compat-devel ``` Additional dependencies for plugins: From 47c49ca534bb9214ec2f291b90a2ad013d5a339d Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 4 Aug 2025 10:38:29 +0200 Subject: [PATCH 095/147] Disable webui &jsonapi --- .github/workflows/ci-mingw64-Qt6.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-mingw64-Qt6.yml b/.github/workflows/ci-mingw64-Qt6.yml index 2517bccc5..946aa912e 100644 --- a/.github/workflows/ci-mingw64-Qt6.yml +++ b/.github/workflows/ci-mingw64-Qt6.yml @@ -67,5 +67,5 @@ jobs: - name: Build run: | - qmake6 . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_jsonapi" "CONFIG+=rs_webui" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" - mingw32-make -j3 \ No newline at end of file + qmake6 . -r -spec win32-g++ "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" + mingw32-make -j3 From e29b90776172ffe280d858d27bac5a30a1cbf969 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:18:21 +0200 Subject: [PATCH 096/147] update instructions --- .../Debian+Ubuntu/Linux_InstallGuide.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 5621e6a18..91526a9f9 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -14,7 +14,6 @@ Additional packages to compile with Qt6: ```bash sudo apt-get install qt6-base-dev qt6-multimedia-dev qt6-5compat-dev ``` -To use only Qt6 the packages `qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev` are not needed. Additional dependencies for Feedreader plugin: ```bash @@ -90,7 +89,7 @@ Additional dependencies for plugins: The executable produced will be: ```bash - - /usr/bin/RetroShare + ~/usr/bin/RetroShare ``` ### For packagers @@ -125,6 +124,20 @@ You need to place sqlcipher so that the hierarchy is: cd .. ``` +### Build infos + +When you use only Qt6 the packages `qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev` are not needed. + +For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`. +Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile. +Do not mix plugins compiled with Qt5 with those compiled with Qt6. They work only if they are compiled +with the same Qt version as RetroShare. + +Voip is outdated and is not compileable on the latest Debian. + +For `Autologin` it is required to append the config option `CONFIG+=rs_autologin`. + + ### Build options * Mandatory From 2369f5a916f456069e300f3bece2e2fcf023a483 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Tue, 5 Aug 2025 20:34:23 +0200 Subject: [PATCH 097/147] Update Linux_InstallGuide.md --- build_scripts/Debian+Ubuntu/Linux_InstallGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 91526a9f9..8b70c36c9 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -107,9 +107,9 @@ If libsqlcipher is not available as a package You need to place sqlcipher so that the hierarchy is: - retroshare + ~Home | - +--- trunk + +--- retroshare | +--- lib | From 7e8abe1aca027ae44d012b441e868116c029374a Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Tue, 5 Aug 2025 21:40:42 +0200 Subject: [PATCH 098/147] corrected sqlcipher repo --- build_scripts/Debian+Ubuntu/Linux_InstallGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 8b70c36c9..4703b9777 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -117,12 +117,12 @@ You need to place sqlcipher so that the hierarchy is: ```bash mkdir lib cd lib - git clone git://github.com/sqlcipher/sqlcipher.git + git clone https://github.com/sqlcipher/sqlcipher.git --depth=1 --branch v3.4.1 cd sqlcipher ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" make cd .. -``` +``` ### Build infos From 1dc1f4fd5653d1d7a854b6137c8ccbc47b487a14 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sat, 9 Aug 2025 12:06:14 +0200 Subject: [PATCH 099/147] fixed requested changes --- .../Debian+Ubuntu/Linux_InstallGuide.md | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 4703b9777..873c34d21 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -5,12 +5,16 @@ ### Install package dependencies: #### Debian/Ubuntu ```bash - sudo apt-get install g++ cmake qt5-qmake qtmultimedia5-dev \ - libqt5x11extras5-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \ + sudo apt-get install g++ cmake libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \ libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev libasio-dev ``` -Additional packages to compile with Qt6: +To compile with Qt5: +```bash + sudo apt-get install qt5-qmake qtmultimedia5-dev qt6-5compat-dev libqt5x11extras5-dev +``` + +To compile with Qt6: ```bash sudo apt-get install qt6-base-dev qt6-multimedia-dev qt6-5compat-dev ``` @@ -82,6 +86,11 @@ Additional dependencies for plugins: make ``` +The executable produced will be: +```bash + ./retroshare-gui/src/retroshare +``` + ### Install ```bash sudo make install @@ -126,10 +135,9 @@ You need to place sqlcipher so that the hierarchy is: ### Build infos -When you use only Qt6 the packages `qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev` are not needed. - For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`. Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile. + Do not mix plugins compiled with Qt5 with those compiled with Qt6. They work only if they are compiled with the same Qt version as RetroShare. @@ -145,13 +153,13 @@ For `Autologin` it is required to append the config option `CONFIG+=rs_autologin * Extra features (optional) * rs_autologin: enable autologin * retroshare_plugins: build plugins - * rs_webui: enable remoting features - * rs_jsonapi: enable json api interface - * gxsthewire enable Wire service - * wikipoos enable Wiki service - * rs_use_native_dialogs enable native dialogs - * rs_deep_channels_index build with deep channel indexing support - * rs_deep_files_index build with deep file indexing support + * rs_webui: enable Web interface + * rs_jsonapi: enable json api interface, required by rs_webui + * gxsthewire: enable Wire service (experimental) + * wikipoos: enable Wiki service (experimental) + * rs_use_native_dialogs: enable native dialogs (may cause crashes with some versions of Gtk) + * rs_deep_channels_index: build with deep channel indexing support + * rs_deep_files_index: build with deep file indexing support * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* Example: @@ -160,6 +168,4 @@ Example: qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos -``` - - +``` \ No newline at end of file From f6f0f243adb46d4c50bd66f3442f7f9924a567d4 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sat, 9 Aug 2025 13:21:37 +0200 Subject: [PATCH 100/147] Added fedora guide --- .../Linux_RedHat_InstallGuide.md | 128 ++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md diff --git a/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md b/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md new file mode 100644 index 000000000..757b94a2f --- /dev/null +++ b/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md @@ -0,0 +1,128 @@ + +## Compilation on Red Hat-based Linux + + +### Install package dependencies: +#### RedHat/Fedora +```bash + sudo dnf install mesa-libGL-devel gcc cmake rapidjson-devel \ + libupnp openssl sqlcipher sqlcipher-devel \ + botan2 botan2-devel json-c-devel bzip2-devel asio-devel libsecret libXScrnSaver-devel +``` + +To compile with Qt5: +```bash + sudo dnf install qt5-qtbase-devel qt5-qtmultimedia qt5-qtx11extras +``` + +To compile with Qt6: +```bash + sudo dnf install qt6-qtbase-devel qt6-qtmultimedia-devel qt6-qt5compat-devel +``` + +Additional dependencies for Feedreader plugin: +```bash + sudo dnf install libxml2-devel libxslt-devel libcurl-devel +``` + +### Checkout the source code +```bash + cd ~ + git clone https://github.com/RetroShare/RetroShare.git retroshare +``` + +### Checkout the submodules +```bash + cd retroshare + git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ + git submodule update --init --remote supportlibs/librnp supportlibs/restbed supportlibs/rapidjson +``` + +### Compile +```bash + qmake CONFIG+=release CONFIG+=rs_jsonapi CONFIG+=rs_webui + make +``` + +The executable produced will be: +```bash + ./retroshare-gui/src/retroshare +``` + +### Install +```bash + sudo make install +``` + +The executable produced will be: +```bash + ~/usr/bin/RetroShare +``` + +### For packagers + +Packagers can use PREFIX and LIB\_DIR to customize the installation paths: +```bash + qmake PREFIX=/usr LIB_DIR=/usr/lib64 "CONFIG-=debug" "CONFIG+=release" + make + make INSTALL_ROOT=${PKGDIR} install +``` + +### SQLCipher +If libsqlcipher is not available as a package + +You need to place sqlcipher so that the hierarchy is: + + ~Home + | + +--- retroshare + | + +--- lib + | + +---- sqlcipher +```bash + mkdir lib + cd lib + git clone https://github.com/sqlcipher/sqlcipher.git --depth=1 --branch v3.4.1 + cd sqlcipher + ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" + make + cd .. +``` + +### Build infos + +For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`. +Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile. + +Do not mix plugins compiled with Qt5 with those compiled with Qt6. They work only if they are compiled +with the same Qt version as RetroShare. + +Voip is outdated and is not compileable on the latest Debian. + +For `Autologin` it is required to append the config option `CONFIG+=rs_autologin`. + + +### Build options + +* Mandatory + * release or debug: normally you would like to use the release option +* Extra features (optional) + * rs_autologin: enable autologin + * retroshare_plugins: build plugins + * rs_webui: enable Web interface + * rs_jsonapi: enable json api interface, required by rs_webui + * gxsthewire: enable Wire service (experimental) + * wikipoos: enable Wiki service (experimental) + * rs_use_native_dialogs: enable native dialogs (may cause crashes with some versions of Gtk) + * rs_deep_channels_index: build with deep channel indexing support + * rs_deep_files_index: build with deep file indexing support + * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* + +Example: + +```batch +qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark +qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin +qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos +``` \ No newline at end of file From fcefd4972521286ecd4caeee9fd3e30f3223969d Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sat, 9 Aug 2025 18:47:48 +0200 Subject: [PATCH 101/147] Added Linux Install Guide to Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 9f4c26f66..de73bf985 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,10 @@ Follow this file : [WindowsMSys2_InstallGuide.md](https://github.com/RetroShare/ Follow this file : [MacOS_X_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/OSX/MacOS_X_InstallGuide.md) +## Compilation on Linux + +Follow this file : [Linux_InstallGuide](https://github.com/defnax/RetroShare/blob/master/build_scripts/Debian%2BUbuntu/Linux_InstallGuide.md) + ## Releases Latest release [here](https://github.com/RetroShare/RetroShare/releases) From e7ece32ab0738cfd493ab3fc34053d15814180dd Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 10 Aug 2025 01:44:40 +0200 Subject: [PATCH 102/147] Fixed link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index de73bf985..4b296ab6c 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Follow this file : [MacOS_X_InstallGuide](https://github.com/RetroShare/RetroSha ## Compilation on Linux -Follow this file : [Linux_InstallGuide](https://github.com/defnax/RetroShare/blob/master/build_scripts/Debian%2BUbuntu/Linux_InstallGuide.md) +Follow this file : [Linux_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md) ## Releases From aca1c314902ac7dff62daea60d172bc4061a822f Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 10 Aug 2025 10:35:39 +0200 Subject: [PATCH 103/147] Added qt6 badge to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4b296ab6c..ccbfb54f8 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ RetroShare provides file sharing, chat, messages, forums, channels, boards and m [![Downloads](https://img.shields.io/github/downloads/retroshare/retroshare/total)](https://github.com/retroshare/retroshare/releases/latest) [![MINGW64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64.yml) [![UCRT64 Qt5 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-ucrt64.yml) +[![MINGW64 Qt6 Build](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64-Qt6.yml/badge.svg)](https://github.com/RetroShare/RetroShare/actions/workflows/ci-mingw64-Qt6.yml) [![GNU/Linux (via Gitlab CI)](https://gitlab.com/RetroShare/RetroShare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/RetroShare/-/commits/master) [![libretroshare GNU/Linux, Android (via Gitlab CI)](https://gitlab.com/RetroShare/libretroshare/badges/master/pipeline.svg)](https://gitlab.com/RetroShare/libretroshare/-/commits/master) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/RetroShare/RetroShare) From 5f5639391a68495c6c85f66da7538546f8764d2f Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sun, 10 Aug 2025 11:53:13 +0200 Subject: [PATCH 104/147] Windows native build: Added architecture in console title during build and pack --- build_scripts/Windows/build/build.bat | 8 ++++---- build_scripts/Windows/build/pack.bat | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build_scripts/Windows/build/build.bat b/build_scripts/Windows/build/build.bat index 591510580..4685d3a5e 100644 --- a/build_scripts/Windows/build/build.bat +++ b/build_scripts/Windows/build/build.bat @@ -33,7 +33,7 @@ echo. echo === Version echo. -title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [Version] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [Version] pushd "%SourcePath%\retroshare-gui\src\gui\images" :: Touch resource file @@ -47,7 +47,7 @@ echo. echo === qmake echo. -title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [qmake] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [qmake] set RS_QMAKE_CONFIG=%RsBuildConfig% if "%ParamAutologin%"=="1" set RS_QMAKE_CONFIG=%RS_QMAKE_CONFIG% rs_autologin @@ -66,7 +66,7 @@ echo. echo === make echo. -title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [make] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [make] mingw32-make -j %CoreCount% if errorlevel 1 goto error @@ -75,7 +75,7 @@ echo. echo === Changelog echo. -title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion% [changelog] +title Build - %SourceName%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [changelog] call "%ToolsPath%\generate-changelog.bat" "%SourcePath%" "%RsBuildPath%\changelog.txt" :error diff --git a/build_scripts/Windows/build/pack.bat b/build_scripts/Windows/build/pack.bat index d2259106d..3fb3c540a 100644 --- a/build_scripts/Windows/build/pack.bat +++ b/build_scripts/Windows/build/pack.bat @@ -77,7 +77,7 @@ if exist "%Archive%" del /Q "%Archive%" :: Create deploy path mkdir "%RsDeployPath%" -title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% [copy files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [copy files] set ExtensionsFile=%SourcePath%\libretroshare\src\rsserver\rsinit.cc set Extensions= @@ -206,7 +206,7 @@ if "%ParamTor%"=="1" ( ) rem pack files -title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion% [pack files] +title Pack - %SourceName%%RsType%-%RsBuildConfig% Qt-%QtVersion%-%GCCArchitecture% [pack files] "%EnvSevenZipExe%" a -mx=9 -t7z "%Archive%" "%RsDeployPath%\*" From fd48b6b1ba36df9f471986348576b2648b2df4f4 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 10 Aug 2025 17:08:49 +0200 Subject: [PATCH 105/147] ADD: ubuntu workflow files --- .github/workflows/ubuntu-qt5_c-cpp.yml | 38 ++++++++++++++++++++++++++ .github/workflows/ubuntu-qt6_c-cpp.yml | 38 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/ubuntu-qt5_c-cpp.yml create mode 100644 .github/workflows/ubuntu-qt6_c-cpp.yml diff --git a/.github/workflows/ubuntu-qt5_c-cpp.yml b/.github/workflows/ubuntu-qt5_c-cpp.yml new file mode 100644 index 000000000..ecd26e44d --- /dev/null +++ b/.github/workflows/ubuntu-qt5_c-cpp.yml @@ -0,0 +1,38 @@ +name: Ubuntu Qt 5 C/C++ CI + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +jobs: + build: + + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - name: git init + run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1 + - name: git submodule supportlibs + run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson + - name: apt install + run: sudo apt-get install g++ cmake qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev + - name: print working directory + run: pwd && ls -la + - name: qmake + run: | + qmake CONFIG+=debug \ + CONFIG+=rs_autologin \ + CONFIG+=rs_webui \ + CONFIG+=rs_jsonapi \ + CONFIG+=wikipoos \ + CONFIG+=gxsthewire \ + CONFIG+=retroshare_plugins + - name: make + run: make + - name: make check + run: make check diff --git a/.github/workflows/ubuntu-qt6_c-cpp.yml b/.github/workflows/ubuntu-qt6_c-cpp.yml new file mode 100644 index 000000000..4bc5aa483 --- /dev/null +++ b/.github/workflows/ubuntu-qt6_c-cpp.yml @@ -0,0 +1,38 @@ +name: Ubuntu Qt 6 C/C++ CI + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +jobs: + build: + + runs-on: ubuntu-24.04 + + steps: + - uses: actions/checkout@v4 + - name: git init + run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1 + - name: git submodule supportlibs + run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson + - name: apt install + run: sudo apt-get install g++ cmake qt6-base-dev qt6-multimedia-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen qt6-5compat-dev libqt6core5compat6-dev libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev + - name: print working directory + run: pwd && ls -la + - name: qmake + run: | + qmake6 CONFIG+=debug \ + CONFIG+=rs_autologin \ + CONFIG+=rs_webui \ + CONFIG+=rs_jsonapi \ + CONFIG+=wikipoos \ + CONFIG+=gxsthewire \ + CONFIG+=retroshare_plugins + - name: make + run: make + - name: make check + run: make check From e0087ea8eea39981bfbdadde8460a433c8b0cea0 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 10 Aug 2025 17:14:12 +0200 Subject: [PATCH 106/147] ADD: apt update --- .github/workflows/ubuntu-qt5_c-cpp.yml | 2 ++ .github/workflows/ubuntu-qt6_c-cpp.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ubuntu-qt5_c-cpp.yml b/.github/workflows/ubuntu-qt5_c-cpp.yml index ecd26e44d..4e2fa5a80 100644 --- a/.github/workflows/ubuntu-qt5_c-cpp.yml +++ b/.github/workflows/ubuntu-qt5_c-cpp.yml @@ -19,6 +19,8 @@ jobs: run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1 - name: git submodule supportlibs run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson + - name: run apt update + run: sudo apt-get update - name: apt install run: sudo apt-get install g++ cmake qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev - name: print working directory diff --git a/.github/workflows/ubuntu-qt6_c-cpp.yml b/.github/workflows/ubuntu-qt6_c-cpp.yml index 4bc5aa483..dd2fdb0e7 100644 --- a/.github/workflows/ubuntu-qt6_c-cpp.yml +++ b/.github/workflows/ubuntu-qt6_c-cpp.yml @@ -19,6 +19,8 @@ jobs: run: git submodule update --init --remote libbitdht/ libretroshare/ openpgpsdk/ retroshare-webui/ && git --no-pager log --max-count 1 - name: git submodule supportlibs run: git submodule update --init supportlibs/librnp supportlibs/restbed #supportlibs/rapidjson + - name: run apt update + run: sudo apt-get update - name: apt install run: sudo apt-get install g++ cmake qt6-base-dev qt6-multimedia-dev libasio-dev libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev doxygen qt6-5compat-dev libqt6core5compat6-dev libsecret-1-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev - name: print working directory From dae748ca2ed771e2c8616ad7ce36853374b63000 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 15 Jul 2025 21:50:27 +0200 Subject: [PATCH 107/147] FIX MSYS2: Disabled VOIP for msys2 and Qt 6 --- plugins/plugins.pro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/plugins.pro b/plugins/plugins.pro index 7ecbc32c7..692f3c766 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -18,6 +18,10 @@ TEMPLATE = subdirs +win32-g++:isEmpty(QMAKE_SH):lessThan(QT_MAJOR_VERSION,6) { + # Qt 5 Windows native build SUBDIRS += \ VOIP \ +} +SUBDIRS += \ FeedReader From 28653ad92c8b8f7401e0ee0c8bac3648721029e3 Mon Sep 17 00:00:00 2001 From: redDwarf03 Date: Fri, 25 Apr 2025 21:07:38 +0200 Subject: [PATCH 108/147] Updates for macos sequoia to run retroshare-service origin redDwarf03 --- retroshare-service/CMakeLists.txt | 45 +++++++++++++++++++ retroshare-service/src/retroshare-service.pro | 7 +++ 2 files changed, 52 insertions(+) diff --git a/retroshare-service/CMakeLists.txt b/retroshare-service/CMakeLists.txt index 97562c91e..261158923 100644 --- a/retroshare-service/CMakeLists.txt +++ b/retroshare-service/CMakeLists.txt @@ -61,6 +61,21 @@ cmake_dependent_option( set(FETCHCONTENT_QUIET OFF) include(FetchContent) +# Find required dependencies +# find_package for Botan and json-c failed to populate variables, remove them. +# find_package(Botan 3 REQUIRED) +# message(STATUS "Botan_FOUND=${Botan_FOUND}") +# message(STATUS "BOTAN_LIBRARIES=${BOTAN_LIBRARIES}") +# message(STATUS "BOTAN_INCLUDE_DIRS=${BOTAN_INCLUDE_DIRS}") +# +# find_package(json-c REQUIRED) +# message(STATUS "json-c_FOUND=${json-c_FOUND}") +# message(STATUS "JSON-C_LIBRARIES=${JSON-C_LIBRARIES}") +# message(STATUS "JSON-C_INCLUDE_DIRS=${JSON-C_INCLUDE_DIRS}") + +find_package(ZLIB REQUIRED) +find_package(BZip2 REQUIRED) + find_package(Git REQUIRED) ################################################################################ @@ -113,6 +128,36 @@ target_link_libraries(${PROJECT_NAME} PRIVATE retroshare) ################################################################################ +# Add RNP build directories to linker search path +target_link_directories(${PROJECT_NAME} PRIVATE + ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/lib + ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/libsexpp +) + +# Link libraries by name, including RNP libs and dependencies first +target_link_libraries(${PROJECT_NAME} PRIVATE + rnp # Link by name + sexpp + botan-3 + json-c + bz2 + z + retroshare +) + +################################################################################ + +# Add include directories from found packages +# target_include_directories(${PROJECT_NAME} PRIVATE +# ${Botan_INCLUDE_DIRS} +# ${JSONC_INCLUDE_DIRS} +# ) + +# Link only libretroshare, it should handle its own dependencies now +target_link_libraries(${PROJECT_NAME} PRIVATE retroshare) + +################################################################################ + if(RS_SERVICE_DESKTOP) if(UNIX AND NOT APPLE) install( diff --git a/retroshare-service/src/retroshare-service.pro b/retroshare-service/src/retroshare-service.pro index 275f868cc..95589673e 100644 --- a/retroshare-service/src/retroshare-service.pro +++ b/retroshare-service/src/retroshare-service.pro @@ -67,6 +67,7 @@ unix { macx { # ENABLE THIS OPTION FOR Univeral Binary BUILD. #CONFIG += ppc x86 + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 #QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 LIBS += -lz #LIBS += -lssl -lcrypto -lz -lgpgme -lgpg-error -lassuan @@ -81,6 +82,12 @@ macx { LIBS += -framework Security LIBS += -framework Carbon + # Explicitly add RNP libs here for the service target + LIBRNP_BUILD_PATH = $$clean_path($${OUT_PWD}/../../supportlibs/librnp/Build) + LIBS += -L$$clean_path($${LIBRNP_BUILD_PATH}/src/lib) -lrnp + LIBS += -L$$clean_path($${LIBRNP_BUILD_PATH}/src/libsexpp) -lsexpp + LIBS += -lbz2 -lz -ljson-c -lbotan-3 + for(lib, LIB_DIR):LIBS += -L"$$lib" for(bin, BIN_DIR):LIBS += -L"$$bin" From 4fd67b276d974e041efe9af8b93cb1ece43cc4b5 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 3 Aug 2025 22:57:23 +0200 Subject: [PATCH 109/147] retroshare.pri add macos targets --- retroshare.pri | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/retroshare.pri b/retroshare.pri index 98226c686..9db02d144 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -132,7 +132,7 @@ use_dht_stunner_ext_ip:CONFIG -= no_use_dht_stunner_ext_ip # To select your MacOsX version append the following assignation to qmake # command line "CONFIG+=rs_macos10.11" where 10.11 depends your version -macx:CONFIG *= rs_macos11.1 +macx:CONFIG *= rs_macos10.11 rs_macos10.8:CONFIG -= rs_macos10.11 rs_macos10.9:CONFIG -= rs_macos10.11 rs_macos10.10:CONFIG -= rs_macos10.11 @@ -141,6 +141,9 @@ rs_macos10.13:CONFIG -= rs_macos10.11 rs_macos10.14:CONFIG -= rs_macos10.11 rs_macos10.15:CONFIG -= rs_macos10.11 rs_macos11.1:CONFIG -= rs_macos10.11 +rs_macos14.5:CONFIG -= rs_macos10.11 +rs_macos15.2:CONFIG -= rs_macos10.11 +rs_macos15.5:CONFIG -= rs_macos10.11 # To enable JSON API append the following assignation to qmake command line # "CONFIG+=rs_jsonapi" @@ -855,6 +858,27 @@ macx-* { QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } + rs_macos14.5 { + message(***retroshare.pri: Set Target and SDK to MacOS 14.5 ) + QMAKE_MACOSX_DEPLOYMENT_TARGET=14.5 + QMAKE_MAC_SDK = macosx10.13 + QMAKE_CXXFLAGS += -Wno-nullability-completeness + QMAKE_CFLAGS += -Wno-nullability-completeness + } + rs_macos15.2 { + message(***retroshare.pri: Set Target and SDK to MacOS 15.2 ) + QMAKE_MACOSX_DEPLOYMENT_TARGET=15.2 + QMAKE_MAC_SDK = macosx10.13 + QMAKE_CXXFLAGS += -Wno-nullability-completeness + QMAKE_CFLAGS += -Wno-nullability-completeness + } + rs_macos15.5 { + message(***retroshare.pri: Set Target and SDK to MacOS 15.5 ) + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 + QMAKE_MAC_SDK = macosx15.5 + QMAKE_CXXFLAGS += -Wno-nullability-completeness + QMAKE_CFLAGS += -Wno-nullability-completeness + } From be39fd075c6bebe1c1030bb957ef6c7c4f4f65bf Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Mon, 4 Aug 2025 13:53:09 +0200 Subject: [PATCH 110/147] set QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 --- retroshare.pri | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index 9db02d144..1a4c5955e 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -860,14 +860,14 @@ macx-* { } rs_macos14.5 { message(***retroshare.pri: Set Target and SDK to MacOS 14.5 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=14.5 + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 QMAKE_MAC_SDK = macosx10.13 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } rs_macos15.2 { message(***retroshare.pri: Set Target and SDK to MacOS 15.2 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=15.2 + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 QMAKE_MAC_SDK = macosx10.13 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness From 7d0aa67b970b97c8324fecf85ebd349fe7a1cc6b Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Mon, 4 Aug 2025 13:58:49 +0200 Subject: [PATCH 111/147] fix QMAKE_MAC_SDK --- retroshare.pri | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index 1a4c5955e..fb4759049 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -861,14 +861,14 @@ macx-* { rs_macos14.5 { message(***retroshare.pri: Set Target and SDK to MacOS 14.5 ) QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 - QMAKE_MAC_SDK = macosx10.13 + QMAKE_MAC_SDK = macosx14.5 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } rs_macos15.2 { message(***retroshare.pri: Set Target and SDK to MacOS 15.2 ) QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 - QMAKE_MAC_SDK = macosx10.13 + QMAKE_MAC_SDK = macosx15.2 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } From 14b758cb02abbcb2172bcf3aae50bf73173c95ab Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Mon, 4 Aug 2025 18:20:38 +0200 Subject: [PATCH 112/147] botan-2 instead of botan-3 --- retroshare-service/src/retroshare-service.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-service/src/retroshare-service.pro b/retroshare-service/src/retroshare-service.pro index 95589673e..c514ef607 100644 --- a/retroshare-service/src/retroshare-service.pro +++ b/retroshare-service/src/retroshare-service.pro @@ -86,7 +86,7 @@ macx { LIBRNP_BUILD_PATH = $$clean_path($${OUT_PWD}/../../supportlibs/librnp/Build) LIBS += -L$$clean_path($${LIBRNP_BUILD_PATH}/src/lib) -lrnp LIBS += -L$$clean_path($${LIBRNP_BUILD_PATH}/src/libsexpp) -lsexpp - LIBS += -lbz2 -lz -ljson-c -lbotan-3 + LIBS += -lbz2 -lz -ljson-c -lbotan-2 for(lib, LIB_DIR):LIBS += -L"$$lib" for(bin, BIN_DIR):LIBS += -L"$$bin" From 71a61666b7966a4613ed36e782432920dc9e9b4b Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 10 Aug 2025 12:40:36 +0200 Subject: [PATCH 113/147] remove unsupported macos < 10.13 --- retroshare.pri | 45 +++++---------------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index fb4759049..9e13e8044 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -131,12 +131,8 @@ CONFIG *= no_use_dht_stunner_ext_ip use_dht_stunner_ext_ip:CONFIG -= no_use_dht_stunner_ext_ip # To select your MacOsX version append the following assignation to qmake -# command line "CONFIG+=rs_macos10.11" where 10.11 depends your version -macx:CONFIG *= rs_macos10.11 -rs_macos10.8:CONFIG -= rs_macos10.11 -rs_macos10.9:CONFIG -= rs_macos10.11 -rs_macos10.10:CONFIG -= rs_macos10.11 -rs_macos10.12:CONFIG -= rs_macos10.11 +# command line "CONFIG+=rs_macos10.13" where 10.13 depends your version +macx:CONFIG *= rs_macos10.13 rs_macos10.13:CONFIG -= rs_macos10.11 rs_macos10.14:CONFIG -= rs_macos10.11 rs_macos10.15:CONFIG -= rs_macos10.11 @@ -799,37 +795,6 @@ win32-clang-g++ { } macx-* { - rs_macos10.8 { - message(***retroshare.pri: Set Target and SDK to MacOS 10.8 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.8 - QMAKE_MAC_SDK = macosx10.8 - } - - rs_macos10.9 { - message(***retroshare.pri: Set Target and SDK to MacOS 10.9 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.9 - QMAKE_MAC_SDK = macosx10.9 - } - - rs_macos10.10 { - message(***retroshare.pri: Set Target and SDK to MacOS 10.10 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.10 - QMAKE_MAC_SDK = macosx10.10 - } - - rs_macos10.11 { - message(***retroshare.pri: Set Target and SDK to MacOS 10.11 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.11 - QMAKE_MAC_SDK = macosx10.11 - } - - rs_macos10.12 { - message(***retroshare.pri: Set Target and SDK to MacOS 10.12 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.12 - QMAKE_MAC_SDK = macosx10.12 - QMAKE_CXXFLAGS += -Wno-nullability-completeness - QMAKE_CFLAGS += -Wno-nullability-completeness - } rs_macos10.13 { message(***retroshare.pri: Set Target and SDK to MacOS 10.13 ) QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 @@ -839,21 +804,21 @@ macx-* { } rs_macos10.14 { message(***retroshare.pri: Set Target and SDK to MacOS 10.14 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.14 + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 QMAKE_MAC_SDK = macosx10.14 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } rs_macos10.15 { message(***retroshare.pri: Set Target and SDK to MacOS 10.15 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=10.15 + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 QMAKE_MAC_SDK = macosx10.15 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } rs_macos11.1 { message(***retroshare.pri: Set Target and SDK to MacOS 11.1 ) - QMAKE_MACOSX_DEPLOYMENT_TARGET=11.1 + QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 QMAKE_MAC_SDK = macosx11.1 QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness From 361fc39f7c5543660e769e8abc9009c1fb10361e Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Thu, 17 Jul 2025 13:07:38 +0200 Subject: [PATCH 114/147] ADD: storage and sync time 3 and 5 years --- .../gui/Posted/PostedListWidgetWithModel.cpp | 16 ++++++---- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 32 +++++++++++-------- .../GxsChannelPostsWidgetWithModel.cpp | 2 ++ .../gui/gxsforums/GxsForumThreadWidget.cpp | 16 ++++++---- 4 files changed, 38 insertions(+), 28 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 2284e66ed..1cd7884c5 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -877,13 +877,15 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group) QString sync_string; switch(current_sync_time) { - case 5: sync_string = tr("5 days"); break; - case 15: sync_string = tr("2 weeks"); break; - case 30: sync_string = tr("1 month"); break; - case 90: sync_string = tr("3 months"); break; - case 180: sync_string = tr("6 months"); break; - case 365: sync_string = tr("1 year"); break; - case 0: sync_string = tr("indefinitly"); break; + case 5: sync_string = tr("5 days"); break; + case 15: sync_string = tr("2 weeks"); break; + case 30: sync_string = tr("1 month"); break; + case 90: sync_string = tr("3 months"); break; + case 180: sync_string = tr("6 months"); break; + case 365: sync_string = tr("1 year"); break; + case 1095: sync_string = tr("3 years"); break; + case 1825: sync_string = tr("5 years"); break; + case 0: sync_string = tr("indefinitly"); break; default: sync_string = tr("Unknown"); } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 622725140..9098675f9 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -473,23 +473,27 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) QAction *actnn = NULL; QMenu *ctxMenu2 = contextMnu.addMenu(tr("Synchronise posts of last...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_sync_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_sync_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_sync_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_sync_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_sync_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 years " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_sync_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 years " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_store_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); ctxMenu2 = contextMnu.addMenu(tr("Store posts for at most...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(180)) ; if(current_store_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(365)) ; if(current_store_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_store_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_store_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 3 years " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_store_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" 5 years " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_store_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); if (shareKeyType()) { diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp index a0d3ed95e..13a189fb1 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp @@ -1297,6 +1297,8 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou case 90: sync_string = tr("3 months"); break; case 180: sync_string = tr("6 months"); break; case 365: sync_string = tr("1 year"); break; + case 1095: sync_string = tr("3 years") ; break; + case 1825: sync_string = tr("5 years") ; break; case 0: sync_string = tr("indefinitly"); break; default: sync_string = tr("Unknown"); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index c6e6339a5..b8545b077 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -970,13 +970,15 @@ static QString getDurationString(uint32_t days) { switch(days) { - case 0: return QObject::tr("Indefinitely") ; - case 5: return QObject::tr("5 days") ; - case 15: return QObject::tr("2 weeks") ; - case 30: return QObject::tr("1 month") ; - case 60: return QObject::tr("2 month") ; - case 180: return QObject::tr("6 month") ; - case 365: return QObject::tr("1 year") ; + case 0: return QObject::tr("Indefinitely") ; break; + case 5: return QObject::tr("5 days") ; break; + case 15: return QObject::tr("2 weeks") ; break; + case 30: return QObject::tr("1 month") ; break; + case 60: return QObject::tr("2 month") ; break; + case 180: return QObject::tr("6 month") ; break; + case 365: return QObject::tr("1 year") ; break; + case 1095: return QObject::tr("3 years") ; break; + case 1825: return QObject::tr("5 years") ; break; default: return QString::number(days)+" " + QObject::tr("days") ; } From 9f34b871af05c2dd355d07e5d960560b81af3540 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Thu, 17 Jul 2025 13:46:22 +0200 Subject: [PATCH 115/147] CHANGE: remove spaces in tr string; use correct function --- .../src/gui/gxs/GxsGroupFrameDialog.cpp | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 9098675f9..bfa7b63b3 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -473,27 +473,27 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) QAction *actnn = NULL; QMenu *ctxMenu2 = contextMnu.addMenu(tr("Synchronise posts of last...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_sync_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_sync_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 years " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_sync_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 5 years " ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_store_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("5 days" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_sync_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("2 weeks" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_sync_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("1 month" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_sync_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("3 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_sync_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("6 months" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_sync_time == 180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("1 year" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_sync_time == 365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("3 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_sync_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("5 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_sync_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setStorePostsDelay())); actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); ctxMenu2 = contextMnu.addMenu(tr("Store posts for at most...")) ; - actnn = ctxMenu2->addAction(tr(" 5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_store_time ==180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 1 year " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_store_time ==365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 3 years " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_store_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" 5 years " ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_store_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr(" Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("5 days" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 5)) ; if(current_store_time == 5) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("2 weeks" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 15)) ; if(current_store_time == 15) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("1 month" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 30)) ; if(current_store_time == 30) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("3 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 90)) ; if(current_store_time == 90) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("6 months" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 180)) ; if(current_store_time == 180) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("1 year" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_store_time == 365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("3 years" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_store_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("5 years" ),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_store_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setStorePostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); if (shareKeyType()) { From 1cb21fd2ae01a84ac5d7d55e40adda7b6dfdd9f8 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Thu, 17 Jul 2025 14:45:17 +0200 Subject: [PATCH 116/147] ADD: new values to checkDeleay() --- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index bfa7b63b3..eb0b15010 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -404,8 +404,11 @@ uint32_t GxsGroupFrameDialog::checkDelay(uint32_t time_in_secs) return 90 * 86400; if(time_in_secs <= 250 * 86400) return 180 * 86400; - - return 365 * 86400; + if(time_in_secs <= 400 * 86400) + return 365 * 86400; + if(time_in_secs <= 1200 * 86400) + return 1095 * 86400; + return 1825 * 86400; } void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) From dc84b7c1d6ef19ff1bad2185022024a277260055 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Sun, 1 Jun 2025 17:04:27 +0200 Subject: [PATCH 117/147] .desktop file remove absolute path for icons; fixes #2925 --- build_scripts/RedHat+Fedora/data/retroshare.desktop | 2 +- data/retroshare.desktop | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/RedHat+Fedora/data/retroshare.desktop b/build_scripts/RedHat+Fedora/data/retroshare.desktop index 95056d54a..fa590dba3 100644 --- a/build_scripts/RedHat+Fedora/data/retroshare.desktop +++ b/build_scripts/RedHat+Fedora/data/retroshare.desktop @@ -4,7 +4,7 @@ Version=1.0 Name=RetroShare Comment=Securely communicate with your friends Exec=/usr/bin/retroshare %U -Icon=/usr/share/pixmaps/retroshare.xpm +Icon=retroshare.xpm Terminal=false Type=Application Categories=Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P diff --git a/data/retroshare.desktop b/data/retroshare.desktop index 95056d54a..fa590dba3 100644 --- a/data/retroshare.desktop +++ b/data/retroshare.desktop @@ -4,7 +4,7 @@ Version=1.0 Name=RetroShare Comment=Securely communicate with your friends Exec=/usr/bin/retroshare %U -Icon=/usr/share/pixmaps/retroshare.xpm +Icon=retroshare.xpm Terminal=false Type=Application Categories=Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P From bc34ef1ac8762dbd8676e1fdb93f90cafd6ea0f3 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 6 Sep 2025 21:47:15 +0200 Subject: [PATCH 118/147] Added macos workflow --- .github/workflows/ci-macOS.yml | 83 ++++++++++++++++++++++++++++++++++ retroshare.pri | 9 +++- 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci-macOS.yml diff --git a/.github/workflows/ci-macOS.yml b/.github/workflows/ci-macOS.yml new file mode 100644 index 000000000..dd119fc2f --- /dev/null +++ b/.github/workflows/ci-macOS.yml @@ -0,0 +1,83 @@ +name: macOS Build + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +concurrency: + group: ${{ github.workflow}}-${{ github.head_ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: macos-14 + permissions: + actions: write + defaults: + run: + shell: bash + + steps: + - name: Setup XCode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: 15.0.1 + + - name: Show current version of Xcode + run: xcodebuild -version + + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Setup Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@main + + - name: Show OpenSSL version + run: pkg-config --cflags libcrypto + + - name: Install Packages + run: brew install openssl + miniupnpc + rapidjson + sqlcipher + bzip2 + zlib + botan@2 + libxslt + libxml2 + qt + + - name: Checkout submodules + run: | + env + git submodule update --init --remote libbitdht/ libretroshare/ retroshare-webui/ + git submodule update --init supportlibs/librnp supportlibs/rapidjson supportlibs/restbed openpgpsdk/ + + - name: CI-Build + run: | + qmake6 . -r "CONFIG+=rs_macos14.0" "CONFIG+=release" "CONFIG+=rs_autologin" "CONFIG+=no_rs_sam3" "CONFIG+=no_rs_sam3_libsam3" "CONFIG+=rs_no_rnplib" \ + INCLUDEPATH+="/opt/homebrew/opt/openssl@3/include" \ + INCLUDEPATH+="/opt/homebrew/opt/rapidjson/include" \ + INCLUDEPATH+="/opt/homebrew/opt/sqlcipher/include" \ + INCLUDEPATH+="/opt/homebrew/opt/miniupnpc/include" \ + INCLUDEPATH+="/opt/homebrew/opt/libxslt/include" \ + INCLUDEPATH+="/opt/homebrew/opt/libxml2/include" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/openssl@3/lib" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/rapidjson/lib" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/sqlcipher/lib" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/miniupnpc/lib" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/libxslt/lib" \ + QMAKE_LIBDIR+="/opt/homebrew/opt/libxml2/lib" \ + CONFIG+=no_retroshare_service \ + CONFIG+=no_retroshare_friendserver + make diff --git a/retroshare.pri b/retroshare.pri index 9e13e8044..4e950b0e2 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -823,6 +823,13 @@ macx-* { QMAKE_CXXFLAGS += -Wno-nullability-completeness QMAKE_CFLAGS += -Wno-nullability-completeness } + rs_macos14.0 { + message(***retroshare.pri: Set Target and SDK to MacOS 14.0 ) + QMAKE_MACOSX_DEPLOYMENT_TARGET=14.0 + QMAKE_MAC_SDK = macosx14.0 + QMAKE_CXXFLAGS += -Wno-nullability-completeness + QMAKE_CFLAGS += -Wno-nullability-completeness + } rs_macos14.5 { message(***retroshare.pri: Set Target and SDK to MacOS 14.5 ) QMAKE_MACOSX_DEPLOYMENT_TARGET=10.13 @@ -851,7 +858,7 @@ macx-* { BIN_DIR += "/Applications/Xcode.app/Contents/Developer/usr/bin" INCLUDEPATH += "/usr/local/include" RS_UPNP_LIB = miniupnpc - QT += macextras + lessThan(QT_MAJOR_VERSION, 6): QT += macextras INCLUDEPATH += "/usr/local/opt/openssl/include" QMAKE_LIBDIR += "/usr/local/opt/openssl/lib" QMAKE_LIBDIR += "/usr/local/opt/sqlcipher/lib" From 772069a4a678ce295f1d0d81da7124332fec1fd5 Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 6 Sep 2025 22:17:03 +0200 Subject: [PATCH 119/147] Added rnp define --- retroshare-service/CMakeLists.txt | 37 ++++++++++++++++++------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/retroshare-service/CMakeLists.txt b/retroshare-service/CMakeLists.txt index 261158923..2c8bb2e80 100644 --- a/retroshare-service/CMakeLists.txt +++ b/retroshare-service/CMakeLists.txt @@ -27,6 +27,11 @@ option( just for development purposes, not suitable for library usage" OFF ) +option( + RS_RNPLIB + "Enable use RNP lib for PGP" + OFF ) + option( RS_JSON_API "Use restbed to expose libretroshare as JSON API via HTTP" @@ -128,22 +133,24 @@ target_link_libraries(${PROJECT_NAME} PRIVATE retroshare) ################################################################################ -# Add RNP build directories to linker search path -target_link_directories(${PROJECT_NAME} PRIVATE - ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/lib - ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/libsexpp -) +if(RS_RNPLIB) + # Add RNP build directories to linker search path + target_link_directories(${PROJECT_NAME} PRIVATE + ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/lib + ${PROJECT_SOURCE_DIR}/../../supportlibs/librnp/Build/src/libsexpp + ) -# Link libraries by name, including RNP libs and dependencies first -target_link_libraries(${PROJECT_NAME} PRIVATE - rnp # Link by name - sexpp - botan-3 - json-c - bz2 - z - retroshare -) + # Link libraries by name, including RNP libs and dependencies first + target_link_libraries(${PROJECT_NAME} PRIVATE + rnp # Link by name + sexpp + botan-3 + json-c + bz2 + z + retroshare + ) +endif(RS_RNPLIB) ################################################################################ From 82931d3ce24857f162bee8d8859745bba5f04d17 Mon Sep 17 00:00:00 2001 From: defnax Date: Sun, 7 Sep 2025 12:26:59 +0200 Subject: [PATCH 120/147] fix mac configs --- retroshare.pri | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index 4e950b0e2..f856e2b93 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -133,13 +133,14 @@ use_dht_stunner_ext_ip:CONFIG -= no_use_dht_stunner_ext_ip # To select your MacOsX version append the following assignation to qmake # command line "CONFIG+=rs_macos10.13" where 10.13 depends your version macx:CONFIG *= rs_macos10.13 -rs_macos10.13:CONFIG -= rs_macos10.11 -rs_macos10.14:CONFIG -= rs_macos10.11 -rs_macos10.15:CONFIG -= rs_macos10.11 -rs_macos11.1:CONFIG -= rs_macos10.11 -rs_macos14.5:CONFIG -= rs_macos10.11 -rs_macos15.2:CONFIG -= rs_macos10.11 -rs_macos15.5:CONFIG -= rs_macos10.11 +rs_macos10.13:CONFIG -= rs_macos10.13 +rs_macos10.14:CONFIG -= rs_macos10.13 +rs_macos10.15:CONFIG -= rs_macos10.13 +rs_macos11.1:CONFIG -= rs_macos10.13 +rs_macos14.0:CONFIG -= rs_macos10.13 +rs_macos14.5:CONFIG -= rs_macos10.13 +rs_macos15.2:CONFIG -= rs_macos10.13 +rs_macos15.5:CONFIG -= rs_macos10.13 # To enable JSON API append the following assignation to qmake command line # "CONFIG+=rs_jsonapi" From 138b40a375a156ffe446608754225845907aa912 Mon Sep 17 00:00:00 2001 From: defnax Date: Tue, 9 Sep 2025 21:03:23 +0200 Subject: [PATCH 121/147] fix --- retroshare.pri | 1 - 1 file changed, 1 deletion(-) diff --git a/retroshare.pri b/retroshare.pri index f856e2b93..7eeeec39c 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -133,7 +133,6 @@ use_dht_stunner_ext_ip:CONFIG -= no_use_dht_stunner_ext_ip # To select your MacOsX version append the following assignation to qmake # command line "CONFIG+=rs_macos10.13" where 10.13 depends your version macx:CONFIG *= rs_macos10.13 -rs_macos10.13:CONFIG -= rs_macos10.13 rs_macos10.14:CONFIG -= rs_macos10.13 rs_macos10.15:CONFIG -= rs_macos10.13 rs_macos11.1:CONFIG -= rs_macos10.13 From 228483de52c3b0d5bd0a6ee145b8762c114f1fc6 Mon Sep 17 00:00:00 2001 From: Christoph Johannes Kleine Date: Thu, 11 Sep 2025 21:53:48 +0200 Subject: [PATCH 122/147] go back to old function --- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index eb0b15010..67f9d55df 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -484,7 +484,7 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) actnn = ctxMenu2->addAction(tr("1 year" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_sync_time == 365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} actnn = ctxMenu2->addAction(tr("3 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_sync_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} actnn = ctxMenu2->addAction(tr("5 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_sync_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setStorePostsDelay())); actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setSyncPostsDelay())); actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); ctxMenu2 = contextMnu.addMenu(tr("Store posts for at most...")) ; From ad481bbbc07c0edadd433a2f4dccb8e2bf52573b Mon Sep 17 00:00:00 2001 From: defnax Date: Wed, 17 Sep 2025 21:43:51 +0200 Subject: [PATCH 123/147] Fix & improve guide --- README.md | 4 ++- .../Debian+Ubuntu/Linux_InstallGuide.md | 31 +++++++++---------- .../Linux_RedHat_InstallGuide.md | 15 ++++----- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index ccbfb54f8..217121af3 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,9 @@ in the aim of creating packages for the supported platforms (and more) in the [build_scripts](https://github.com/RetroShare/RetroShare/tree/master/build_scripts) directory of this repository. ## Compilation on Windows -Follow this file : [WindowsMSys2_InstallGuide.md](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md) +Follow this file : [WindowsMSys2_InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md) + +With QtCreator : [Windows-QtCreator-InstallGuide](https://github.com/RetroShare/RetroShare/blob/master/build_scripts/Windows/Windows-QtCreator-InstallGuide.md) ## Compilation on MacOSX diff --git a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md index 873c34d21..b1591d9e9 100644 --- a/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md +++ b/build_scripts/Debian+Ubuntu/Linux_InstallGuide.md @@ -3,15 +3,15 @@ ### Install package dependencies: -#### Debian/Ubuntu +#### Debian / Ubuntu / Linux Mint ```bash - sudo apt-get install g++ cmake libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \ - libupnp-dev libxss-dev rapidjson-dev libbotan-2-dev libasio-dev + sudo apt-get install git g++ cmake libbz2-dev libjson-c-dev libssl-dev libsqlcipher-dev \ + libupnp-dev doxygen libxss-dev rapidjson-dev libbotan-2-dev libasio-dev ``` To compile with Qt5: ```bash - sudo apt-get install qt5-qmake qtmultimedia5-dev qt6-5compat-dev libqt5x11extras5-dev + sudo apt-get install qt5-qmake qtmultimedia5-dev libqt5x11extras5-dev ``` To compile with Qt6: @@ -54,17 +54,15 @@ Additional dependencies for plugins: libxslt-devel speex-devel speexdsp-devel ``` -#### Linux Mint +#### Arch Linux / Manjaro / EndeavourOS ```bash - sudo apt-get install git g++ cmake qt5-qmake qtmultimedia5-dev \ - libqt5x11extras5-dev libupnp-dev libxss-dev libssl-dev libsqlcipher-dev \ - rapidjson-dev doxygen libbz2-dev libjson-c-dev libbotan-2-dev libasio-dev + sudo pacman -S base-devel libgnome-keyring cmake qt5-tools qt5-multimedia qt5-x11extras \ + rapidjson doxygen libupnp libxslt libxss sqlcipher botan2 bzip2 json-c ``` -#### Arch Linux +To compile with Qt6: ```bash - pacman -S base-devel libgnome-keyring cmake qt5-tools qt5-multimedia qt5-x11extras \ - rapidjson libupnp libxslt libxss sqlcipher botan2 bzip2 json-c + sudo pacman -S qt6-base qt6-multimedia qt6-5compat ``` ### Checkout the source code @@ -88,7 +86,7 @@ Additional dependencies for plugins: The executable produced will be: ```bash - ./retroshare-gui/src/retroshare + ./retroshare-gui/src/retroshare ``` ### Install @@ -98,7 +96,7 @@ The executable produced will be: The executable produced will be: ```bash - ~/usr/bin/RetroShare + ~/usr/bin/RetroShare ``` ### For packagers @@ -135,6 +133,8 @@ You need to place sqlcipher so that the hierarchy is: ### Build infos +Note: If you installed Qt6 you need to use `qmake6` on the command line. + For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`. Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile. @@ -162,10 +162,9 @@ For `Autologin` it is required to append the config option `CONFIG+=rs_autologin * rs_deep_files_index: build with deep file indexing support * "CONFIG+=..." enable other extra compile time features, you can find the almost complete list in file *<sourcefolder>\retroshare.pri* -Example: +### Examples: ```batch -qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark +qmake CONFIG+=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin -qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos ``` \ No newline at end of file diff --git a/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md b/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md index 757b94a2f..12c365804 100644 --- a/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md +++ b/build_scripts/RedHat+Fedora/Linux_RedHat_InstallGuide.md @@ -5,9 +5,9 @@ ### Install package dependencies: #### RedHat/Fedora ```bash - sudo dnf install mesa-libGL-devel gcc cmake rapidjson-devel \ - libupnp openssl sqlcipher sqlcipher-devel \ - botan2 botan2-devel json-c-devel bzip2-devel asio-devel libsecret libXScrnSaver-devel + sudo dnf install mesa-libGL-devel gcc cmake rapidjson-devel \ + libupnp openssl sqlcipher sqlcipher-devel \ + botan2 botan2-devel json-c-devel bzip2-devel asio-devel libsecret libXScrnSaver-devel ``` To compile with Qt5: @@ -46,7 +46,7 @@ Additional dependencies for Feedreader plugin: The executable produced will be: ```bash - ./retroshare-gui/src/retroshare + ./retroshare-gui/src/retroshare ``` ### Install @@ -56,7 +56,7 @@ The executable produced will be: The executable produced will be: ```bash - ~/usr/bin/RetroShare + ~/usr/bin/RetroShare ``` ### For packagers @@ -92,6 +92,8 @@ You need to place sqlcipher so that the hierarchy is: ### Build infos +Note: If you installed Qt6 you need to use `qmake6` on the command line. + For the `FeedReader` it is required to append the config option `CONFIG+=retroshare_plugins`. Make sure `plugins/plugins.pro` contains `FeedReader` in the list of plugins to compile. @@ -122,7 +124,6 @@ For `Autologin` it is required to append the config option `CONFIG+=rs_autologin Example: ```batch -qmake CONFIG-=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark +qmake CONFIG+=debug CONFIG+=release CONFIG+=rs_use_native_dialog CONFIG+=rs_gui_cmark qmake CONFIG+=rs_jsonapi CONFIG+=rs_webui CONFIG+=rs_autologin -qmake CONFIG+=rs_deep_channels_index CONFIG += gxsthewire CONFIG += wikipoos ``` \ No newline at end of file From 9dd24a6bb10396203bccce997e075b4a9a39f803 Mon Sep 17 00:00:00 2001 From: David Bears Date: Thu, 16 Oct 2025 14:45:44 -0400 Subject: [PATCH 124/147] fix regular expression syntax for forum quote highlighting fixes #3033 --- retroshare-gui/src/util/RsSyntaxHighlighter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/RsSyntaxHighlighter.cpp b/retroshare-gui/src/util/RsSyntaxHighlighter.cpp index c204932a7..6a191ca2f 100644 --- a/retroshare-gui/src/util/RsSyntaxHighlighter.cpp +++ b/retroshare-gui/src/util/RsSyntaxHighlighter.cpp @@ -67,7 +67,7 @@ void RsSyntaxHighlighter::highlightBlock(const QString &text) { if (text == "") return; - QRegularExpression endl("[\\r\\n\\x2028]"); //Usually 0x2028 character is used for newline, no idea why + QRegularExpression endl("[\\r\\n\\N{U+2028}]"); //Usually 0x2028 character is used for newline, no idea why int index = 0; QStringList lines = text.split(endl); foreach (const QString &cLine, lines) { From 0103acb8074fd8cca2b8b4dcb95a2cafa19cb692 Mon Sep 17 00:00:00 2001 From: David Bears Date: Fri, 17 Oct 2025 10:31:04 -0400 Subject: [PATCH 125/147] fix "enable custom font size" checkbox --- retroshare-gui/src/gui/settings/ChatPage.cpp | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ChatPage.cpp b/retroshare-gui/src/gui/settings/ChatPage.cpp index 2fc22a13d..f9ef34137 100644 --- a/retroshare-gui/src/gui/settings/ChatPage.cpp +++ b/retroshare-gui/src/gui/settings/ChatPage.cpp @@ -116,7 +116,7 @@ void ChatPage::updateFontsAndEmotes() Settings->setValue("Emoteicons_GroupChat", ui.checkBox_emotegroupchat->isChecked()); Settings->setValue("EnableCustomFonts", ui.checkBox_enableCustomFonts->isChecked()); Settings->setValue("EnableCustomFontSize", ui.checkBox_enableCustomFontSize->isChecked()); - Settings->setValue("MinimumFontSize", ui.minimumFontSize->value()); + Settings->setValue("MinimumFontSize", ui.minimumFontSize->value()); Settings->setValue("EnableBold", ui.checkBox_enableBold->isChecked()); Settings->setValue("EnableItalics", ui.checkBox_enableItalics->isChecked()); Settings->setValue("MinimumContrast", ui.minimumContrast->value()); @@ -234,13 +234,14 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(distantChatComboBoxChanged(int))); - connect(ui.checkBox_emoteprivchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); - connect(ui.checkBox_emotegroupchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); - connect(ui.checkBox_enableCustomFonts, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); - connect(ui.minimumFontSize, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes())); - connect(ui.checkBox_enableBold, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); - connect(ui.checkBox_enableItalics, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); - connect(ui.minimumContrast, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_emoteprivchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_emotegroupchat, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_enableCustomFonts, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_enableCustomFontSize, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.minimumFontSize, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_enableBold, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.checkBox_enableItalics, SIGNAL(toggled(bool)), this, SLOT(updateFontsAndEmotes())); + connect(ui.minimumContrast, SIGNAL(valueChanged(int)), this, SLOT(updateFontsAndEmotes())); connect(ui.distantChatComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(updateChatParams())); connect(ui.sendMessageWithCtrlReturn, SIGNAL(toggled(bool)), this, SLOT(updateChatParams())); @@ -262,12 +263,12 @@ ChatPage::ChatPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.privateChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.distantChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatLoadCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); - + connect(ui.publicChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.privateChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.distantChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatEnable, SIGNAL(toggled(bool)), this, SLOT(updateHistoryParams())); - + connect(ui.publicChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.privateChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); connect(ui.lobbyChatSaveCount, SIGNAL(valueChanged(int)), this, SLOT(updateHistoryParams())); @@ -387,7 +388,7 @@ ChatPage::load() whileBlocking(ui.checkBox_emotegroupchat)->setChecked(Settings->value("Emoteicons_GroupChat", true).toBool()); whileBlocking(ui.checkBox_enableCustomFonts)->setChecked(Settings->value("EnableCustomFonts", true).toBool()); whileBlocking(ui.checkBox_enableCustomFontSize)->setChecked(Settings->value("EnableCustomFontSize", true).toBool()); - whileBlocking(ui.minimumFontSize)->setValue(Settings->value("MinimumFontSize", 10).toInt()); + whileBlocking(ui.minimumFontSize)->setValue(Settings->value("MinimumFontSize", 10).toInt()); whileBlocking(ui.checkBox_enableBold)->setChecked(Settings->value("EnableBold", true).toBool()); whileBlocking(ui.checkBox_enableItalics)->setChecked(Settings->value("EnableItalics", true).toBool()); whileBlocking(ui.minimumContrast)->setValue(Settings->value("MinimumContrast", 4.5).toDouble()); @@ -451,7 +452,7 @@ ChatPage::load() whileBlocking(ui.lobbyChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_LOBBY)); whileBlocking(ui.distantChatSaveCount)->setValue(rsHistory->getSaveCount(RS_HISTORY_TYPE_DISTANT)); - + // using fontTempChat.rawname() does not always work! // see http://doc.qt.digia.com/qt-maemo/qfont.html#rawName QStringList fontname = fontTempChat.toString().split(","); @@ -711,4 +712,3 @@ void ChatPage::distantChatComboBoxChanged(int i) } } - From 2eed6603275ed152711818cd4868db490c425d62 Mon Sep 17 00:00:00 2001 From: David Bears Date: Fri, 17 Oct 2025 15:25:35 -0400 Subject: [PATCH 126/147] revert addition of `saveAddresses()` call from #841 fixes a bug where the i2p local port is occasionally reset to 10 --- retroshare-gui/src/gui/settings/ServerPage.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index be2404bc8..7b1a9cf0a 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -1771,8 +1771,6 @@ void ServerPage::updateStatusSam() ui.leBobB32Addr->hide(); ui.pbBobGenAddr->hide(); } - - saveAddresses(); } samStatus ss; From e1906a9819d6cafed9f23008c3634937f0472009 Mon Sep 17 00:00:00 2001 From: David Bears Date: Sat, 18 Oct 2025 15:03:37 -0400 Subject: [PATCH 127/147] fix permissions matrix GUI freeze --- .../gui/settings/RSPermissionMatrixWidget.cpp | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp index 079545b89..bfa05d4f5 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp @@ -250,7 +250,7 @@ void RSPermissionMatrixWidget::paintEvent(QPaintEvent *) /* Fill in the background */ //_painter->fillRect(_rec, QBrush(BACK_COLOR)); _painter->drawRect(_rec); - + if (Settings->getSheetName() == ":Standard_Dark"){ brushColor = Qt::gray ; } else { @@ -612,20 +612,24 @@ bool RSPermissionMatrixWidget::computeServiceAndPeer(int x,int y,uint32_t& servi x -= matrix_start_x ; y -= S*fMATRIX_START_Y ; + float fi = x / (S*fCOL_SIZE); + float fj = y / (S*fROW_SIZE); + int i = (int)fi; + int j = (int)fj; + const float icoFracX = fICON_SIZE_X/fCOL_SIZE; + const float icoFracY = fICON_SIZE_Y/fROW_SIZE; - if(x < 0 || x >= service_ids.size() * S*fCOL_SIZE) return false ; - if(y < 0 || y >= peer_ids.size() * S*fROW_SIZE) return false ; - - if( (x % (int)(S*fCOL_SIZE)) < (S*fCOL_SIZE - S*fICON_SIZE_X)/2) return false ; - if( (x % (int)(S*fCOL_SIZE)) > (S*fCOL_SIZE + S*fICON_SIZE_X)/2) return false ; - - if( (y % (int)(S*fROW_SIZE)) < (S*fROW_SIZE - S*fICON_SIZE_Y)/2) return false ; - if( (y % (int)(S*fROW_SIZE)) > (S*fROW_SIZE + S*fICON_SIZE_Y)/2) return false ; + if( + i < 0 || i >= service_ids.size() || + j < 0 || j >= peer_ids.size() || + std::fmod(fi + icoFracX/2 + .5f, 1.f) >= icoFracX || + std::fmod(fj + icoFracY/2 + .5f, 1.f) >= icoFracY + ) return false; // 2 - find which widget, by looking into the service perm matrix - service_id = service_ids[x / (int)(S*fCOL_SIZE)] ; - peer_id = peer_ids[y / (int)(S*fCOL_SIZE)] ; + service_id = service_ids[i]; + peer_id = peer_ids[j]; return true ; } @@ -636,22 +640,23 @@ bool RSPermissionMatrixWidget::computeServiceGlobalSwitch(int x,int y,uint32_t& float S = QFontMetricsF(font()).height(); - x -= matrix_start_x ; - y -= S*fMATRIX_START_Y ; + x -= matrix_start_x; + y -= S*fMATRIX_START_Y; + float fi = x / (S*fCOL_SIZE); + int i = (int)fi; + const float icoFracX = fICON_SIZE_X/fCOL_SIZE; - if(x < 0 || x >= service_ids.size() * S*fCOL_SIZE) return false ; - - if( (x % (int)(S*fCOL_SIZE)) < (S*fCOL_SIZE - S*fICON_SIZE_X)/2) return false ; - if( (x % (int)(S*fCOL_SIZE)) > (S*fCOL_SIZE + S*fICON_SIZE_X)/2) return false ; - - if( y < -S*fROW_SIZE ) return false ; - if( y > 0 ) return false ; + if( + i < 0 || i >= service_ids.size() || + y < -S*fROW_SIZE || y > 0 || + std::fmod(fi + icoFracX/2 + .5f, 1.f) >= icoFracX + ) return false; // 2 - find which widget, by looking into the service perm matrix - service_id = service_ids[x / (int)(S*fCOL_SIZE)] ; + service_id = service_ids[i]; - return true ; + return true; } void RSPermissionMatrixWidget::defaultPermissionSwitched(uint32_t /* ServiceId */,bool /* b */) From f73b25c81a48d55fa261d5e6a674221deeecc855 Mon Sep 17 00:00:00 2001 From: David Bears Date: Wed, 22 Oct 2025 15:41:17 -0400 Subject: [PATCH 128/147] fix the permission matrix global switch --- .../src/gui/settings/RSPermissionMatrixWidget.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp index bfa05d4f5..9286f4020 100644 --- a/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp +++ b/retroshare-gui/src/gui/settings/RSPermissionMatrixWidget.cpp @@ -620,8 +620,8 @@ bool RSPermissionMatrixWidget::computeServiceAndPeer(int x,int y,uint32_t& servi const float icoFracY = fICON_SIZE_Y/fROW_SIZE; if( - i < 0 || i >= service_ids.size() || - j < 0 || j >= peer_ids.size() || + fi < 0.f || i >= service_ids.size() || + fj < 0.f || j >= peer_ids.size() || std::fmod(fi + icoFracX/2 + .5f, 1.f) >= icoFracX || std::fmod(fj + icoFracY/2 + .5f, 1.f) >= icoFracY ) return false; @@ -647,8 +647,8 @@ bool RSPermissionMatrixWidget::computeServiceGlobalSwitch(int x,int y,uint32_t& const float icoFracX = fICON_SIZE_X/fCOL_SIZE; if( - i < 0 || i >= service_ids.size() || - y < -S*fROW_SIZE || y > 0 || + fi < 0.f || i >= service_ids.size() || + y >= 0.f || y < -S*fROW_SIZE || std::fmod(fi + icoFracX/2 + .5f, 1.f) >= icoFracX ) return false; From c3fb087f92b55c3084ea860b54240e7ae1632490 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 27 Oct 2025 14:48:30 +0100 Subject: [PATCH 129/147] improved code consistency in feed item loading/killing --- .../src/gui/feeds/BoardsCommentsItem.cpp | 4 +- .../src/gui/feeds/ChannelsCommentsItem.cpp | 49 ++++++++++--------- .../src/gui/feeds/GxsChannelGroupItem.cpp | 21 ++++++-- .../src/gui/feeds/GxsChannelGroupItem.h | 2 + .../src/gui/feeds/GxsChannelPostItem.cpp | 27 +++++----- .../src/gui/feeds/GxsForumGroupItem.cpp | 23 +++++++-- .../src/gui/feeds/GxsForumGroupItem.h | 2 + .../src/gui/feeds/GxsForumMsgItem.cpp | 20 +++++--- .../src/gui/feeds/PostedGroupItem.cpp | 25 ++++++++-- .../src/gui/feeds/PostedGroupItem.h | 1 + .../src/gui/gxs/GxsGroupFeedItem.cpp | 2 + retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h | 1 + 12 files changed, 119 insertions(+), 58 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp index 57adbb39d..8081c0e99 100644 --- a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp @@ -78,7 +78,8 @@ BaseBoardsCommentsItem::BaseBoardsCommentsItem( FeedHolder *feedHolder, uint32_t BaseBoardsCommentsItem::~BaseBoardsCommentsItem() { - auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(200); + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); + while( (mIsLoadingGroup || mIsLoadingMessage || mIsLoadingComment) && std::chrono::steady_clock::now() < timeout) { @@ -126,6 +127,7 @@ bool BaseBoardsCommentsItem::setPost(const RsPostedPost &post, bool doFill) void BaseBoardsCommentsItem::loadGroup() { mIsLoadingGroup = true; + RsThread::async([this]() { // 1 - get group data diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp index 5b0e0b264..ed2ce468f 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp @@ -102,7 +102,7 @@ void ChannelsCommentsItem::paintEvent(QPaintEvent *e) ChannelsCommentsItem::~ChannelsCommentsItem() { - auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(300); + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); while( mLoading && std::chrono::steady_clock::now() < timeout ) { @@ -293,12 +293,14 @@ void ChannelsCommentsItem::load() if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) // would be better to call channel Summaries for a single group { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; + mLoading= false; return; } if (groups.size() != 1) { std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items" << std::endl; + mLoading= false; return; } RsGxsChannelGroup group(groups[0]); @@ -312,7 +314,8 @@ void ChannelsCommentsItem::load() if(! rsGxsChannels->getChannelContent( groupId(), std::set( { messageId(),mThreadId } ),posts,comments,votes)) { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mLoading= false; + return; } // now that everything is in place, update the UI @@ -325,33 +328,31 @@ void ChannelsCommentsItem::load() mGroupMeta = group.mMeta; - if(comments.size()==1) - { - RsGxsComment cmt(comments[0]); - - uint32_t autorized_lines = (int)floor( (ui->avatarLabel->height() - ui->button_HL->sizeHint().height()) - / QFontMetricsF(ui->subjectLabel->font()).height()); - - ui->commLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(cmt.mComment.c_str()), autorized_lines), RSHTML_FORMATTEXT_EMBED_LINKS)); - ui->nameLabel->setId(cmt.mMeta.mAuthorId); - ui->datetimeLabel->setText(DateTime::formatLongDateTime(cmt.mMeta.mPublishTs)); - - RsIdentityDetails idDetails ; - rsIdentity->getIdDetails(cmt.mMeta.mAuthorId,idDetails); - QPixmap pixmap ; - - if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) - pixmap = GxsIdDetails::makeDefaultIcon(cmt.mMeta.mAuthorId,GxsIdDetails::LARGE); - ui->avatarLabel->setPixmap(pixmap); - - //Change this item to be uploaded with thread element. This is really bad practice. - } - else + if(comments.size()!=1) { mLoading=false; removeItem(); } + RsGxsComment cmt(comments[0]); + + uint32_t autorized_lines = (int)floor( (ui->avatarLabel->height() - ui->button_HL->sizeHint().height()) + / QFontMetricsF(ui->subjectLabel->font()).height()); + + ui->commLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(cmt.mComment.c_str()), autorized_lines), RSHTML_FORMATTEXT_EMBED_LINKS)); + ui->nameLabel->setId(cmt.mMeta.mAuthorId); + ui->datetimeLabel->setText(DateTime::formatLongDateTime(cmt.mMeta.mPublishTs)); + + RsIdentityDetails idDetails ; + rsIdentity->getIdDetails(cmt.mMeta.mAuthorId,idDetails); + QPixmap pixmap ; + + if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) + pixmap = GxsIdDetails::makeDefaultIcon(cmt.mMeta.mAuthorId,GxsIdDetails::LARGE); + ui->avatarLabel->setPixmap(pixmap); + + //Change this item to be uploaded with thread element. This is really bad practice. + if (posts.size() == 1) setPost(posts[0]); else diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index a6213e740..4c63fc030 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -36,7 +36,8 @@ GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsChannels, autoUpdate) { - setup(); + mIsLoading = false; + setup(); requestGroup(); addEventHandler(); } @@ -44,6 +45,7 @@ GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsGxsChannels, autoUpdate) { + mIsLoading = false; setup(); setGroup(group); addEventHandler(); @@ -77,6 +79,14 @@ void GxsChannelGroupItem::addEventHandler() GxsChannelGroupItem::~GxsChannelGroupItem() { + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); + + while( mIsLoading && std::chrono::steady_clock::now() < timeout ) + { + RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " << std::endl; + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + rsEvents->unregisterEventsHandler(mEventHandlerId); delete(ui); } @@ -121,6 +131,8 @@ bool GxsChannelGroupItem::setGroup(const RsGxsChannelGroup &group) void GxsChannelGroupItem::loadGroup() { + mIsLoading = true; + RsThread::async([this]() { // 1 - get group data @@ -131,14 +143,16 @@ void GxsChannelGroupItem::loadGroup() if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) { RsErr() << "PostedItem::loadGroup() ERROR getting data" << std::endl; - return; + mIsLoading = false; + return; } if (groups.size() != 1) { std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - return; + mIsLoading = false; + return; } RsGxsChannelGroup group(groups[0]); @@ -149,6 +163,7 @@ void GxsChannelGroupItem::loadGroup() * after a blocking call to RetroShare API complete */ setGroup(group); + mIsLoading = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h index b0366bc98..27d8d7480 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h @@ -62,6 +62,8 @@ private: void setup(); void addEventHandler(); + bool mIsLoading; + private: RsGxsChannelGroup mGroup; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 17036a15e..a50a0c46e 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -140,7 +140,7 @@ void GxsChannelPostItem::paintEvent(QPaintEvent *e) GxsChannelPostItem::~GxsChannelPostItem() { - auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(300); + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); while( (mLoadingGroup || mLoadingMessage || mLoadingComment) && std::chrono::steady_clock::now() < timeout) @@ -306,14 +306,16 @@ void GxsChannelPostItem::loadGroup() if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) // would be better to call channel Summaries for a single group { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mLoadingGroup = false; + return; } if (groups.size() != 1) { std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - return; + mLoadingGroup = false; + return; } RsGxsChannelGroup group(groups[0]); @@ -348,7 +350,8 @@ void GxsChannelPostItem::loadMessage() if(! rsGxsChannels->getChannelContent( groupId(), std::set( { messageId() } ),posts,comments,votes)) { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mLoadingMessage = false; + return; } if (posts.size() == 1) @@ -377,11 +380,11 @@ void GxsChannelPostItem::loadMessage() ui->commLabel->show(); ui->commLabel->setText(QString::fromUtf8(cmt.mComment.c_str())); - //Change this item to be uploaded with thread element. + // Change this item to be uploaded with thread element. Note: this is terrible coding. setMessageId(cmt.mMeta.mThreadId); - requestMessage(); - mLoadingMessage = false; + + requestMessage(); }, this ); } @@ -424,7 +427,8 @@ void GxsChannelPostItem::loadComment() if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments)) { RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mLoadingComment = false; + return; } int comNb = comments.size(); @@ -446,13 +450,6 @@ void GxsChannelPostItem::loadComment() void GxsChannelPostItem::fill() { - /* fill in */ - -// if (isLoading()) { - // /* Wait for all requests */ - //return; -// } - #ifdef DEBUG_ITEM std::cerr << "GxsChannelPostItem::fill()"; std::cerr << std::endl; diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index 663951a6c..a392137dc 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -34,7 +34,8 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsForums, autoUpdate) { - setup(); + mIsLoading = false; + setup(); requestGroup(); addEventHandler(); } @@ -44,7 +45,8 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, co mAddedModerators(added_moderators), mRemovedModerators(removed_moderators) { - setup(); + mIsLoading = false; + setup(); requestGroup(); addEventHandler(); } @@ -85,6 +87,14 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, co GxsForumGroupItem::~GxsForumGroupItem() { + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); + + while( mIsLoading && std::chrono::steady_clock::now() < timeout ) + { + RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " << std::endl; + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } + rsEvents->unregisterEventsHandler(mEventHandlerId); delete(ui); } @@ -129,6 +139,8 @@ bool GxsForumGroupItem::setGroup(const RsGxsForumGroup &group) void GxsForumGroupItem::loadGroup() { + mIsLoading = true; + RsThread::async([this]() { // 1 - get group data @@ -143,14 +155,16 @@ void GxsForumGroupItem::loadGroup() if(!rsGxsForums->getForumsInfo(forumIds,groups)) { RsErr() << "GxsForumGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mIsLoading = false; + return; } if (groups.size() != 1) { std::cerr << "GxsForumGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - return; + mIsLoading = false; + return; } RsGxsForumGroup group(groups[0]);// no reference to teporary accross threads! @@ -161,6 +175,7 @@ void GxsForumGroupItem::loadGroup() * after a blocking call to RetroShare API complete */ setGroup(group); + mIsLoading = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h index d80671e5a..823b698cf 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h @@ -69,6 +69,8 @@ private: /** Qt Designer generated object */ Ui::GxsForumGroupItem *ui; + bool mIsLoading; + std::list mAddedModerators; std::list mRemovedModerators; diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index f4d091179..2b56e9ba6 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -89,7 +89,7 @@ GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const GxsForumMsgItem::~GxsForumMsgItem() { - auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(300); + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); while( (mLoadingGroup || mLoadingMessage || mLoadingSetAsRead || mLoadingParentMessage) && std::chrono::steady_clock::now() < timeout) @@ -202,14 +202,16 @@ void GxsForumMsgItem::loadGroup() if(!rsGxsForums->getForumsInfo(forumIds,groups)) { RsErr() << "GxsForumGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mLoadingGroup = false; + return; } if (groups.size() != 1) { std::cerr << "GxsForumGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - return; + mLoadingGroup = false; + return; } RsGxsForumGroup group(groups[0]); @@ -249,14 +251,16 @@ void GxsForumMsgItem::loadMessage() { std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting data"; std::cerr << std::endl; - return; + mLoadingMessage = false; + return; } if (msgs.size() != 1) { std::cerr << "GxsForumMsgItem::loadMessage() Wrong number of Items"; std::cerr << std::endl; - return; + mLoadingMessage = false; + return; } RsGxsForumMsg msg(msgs[0]); @@ -296,14 +300,16 @@ void GxsForumMsgItem::loadParentMessage(const RsGxsMessageId& parent_msg) { std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting data"; std::cerr << std::endl; - return; + mLoadingParentMessage = false; + return; } if (msgs.size() != 1) { std::cerr << "GxsForumMsgItem::loadMessage() Wrong number of Items"; std::cerr << std::endl; - return; + mLoadingParentMessage = false; + return; } RsGxsForumMsg msg(msgs[0]); diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index f4abafb08..34fd378f2 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -35,7 +35,8 @@ PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsPosted, autoUpdate) { - setup(); + mIsLoadingGroup = false; + setup(); requestGroup(); } @@ -43,13 +44,24 @@ PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsPostedGroup &group, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsPosted, autoUpdate) { - setup(); + mIsLoadingGroup = false; + setup(); setGroup(group); } PostedGroupItem::~PostedGroupItem() { + auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); + + while( mIsLoadingGroup && std::chrono::steady_clock::now() < timeout) + { + RsDbg() << __PRETTY_FUNCTION__ << " is Waiting " + << (mIsLoadingGroup ? "Group " : "") + << "loading finished." << std::endl; + + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } delete(ui); } @@ -95,6 +107,8 @@ bool PostedGroupItem::setGroup(const RsPostedGroup &group) void PostedGroupItem::loadGroup() { + mIsLoadingGroup = true; + RsThread::async([this]() { // 1 - get group data @@ -109,14 +123,16 @@ void PostedGroupItem::loadGroup() if(!rsPosted->getBoardsInfo(groupIds,groups)) { RsErr() << "GxsPostedGroupItem::loadGroup() ERROR getting data" << std::endl; - return; + mIsLoadingGroup = false; + return; } if (groups.size() != 1) { std::cerr << "GxsPostedGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - return; + mIsLoadingGroup = false; + return; } RsPostedGroup group(groups[0]); @@ -127,6 +143,7 @@ void PostedGroupItem::loadGroup() * after a blocking call to RetroShare API complete */ setGroup(group); + mIsLoadingGroup = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.h b/retroshare-gui/src/gui/feeds/PostedGroupItem.h index 642dc4be0..fa8fe65d6 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.h +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.h @@ -63,6 +63,7 @@ private: private: RsPostedGroup mGroup; + bool mIsLoadingGroup; /** Qt Designer generated object */ Ui::PostedGroupItem *ui; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp index b4fe2273f..72f08ae8e 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.cpp @@ -31,6 +31,8 @@ * #define DEBUG_ITEM 1 **/ +const uint GxsGroupFeedItem::GROUP_ITEM_LOADING_TIMEOUT_ms = 2000; + GxsGroupFeedItem::GxsGroupFeedItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, RsGxsIfaceHelper *iface, bool /*autoUpdate*/) : FeedItem(feedHolder,feedId,NULL) { diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h index 653d62bb1..63e5907d6 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h @@ -60,6 +60,7 @@ protected slots: protected: bool mIsHome; RsGxsIfaceHelper *mGxsIface; + static const uint GROUP_ITEM_LOADING_TIMEOUT_ms ; private slots: /* RsGxsUpdateBroadcastBase */ From b9cd766707a59586b5c306e989c2a9cb28fe4634 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 30 Oct 2025 19:53:55 +0100 Subject: [PATCH 130/147] removed unused code --- .../gui/Posted/PostedListWidgetWithModel.cpp | 186 ------------------ 1 file changed, 186 deletions(-) diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp index 1cd7884c5..aec3c7bdb 100644 --- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp @@ -942,196 +942,10 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group) } ui->infoDistribution->setText(distrib_string); -#ifdef TODO - ui->infoWidget->show(); - ui->feedWidget->hide(); - ui->fileWidget->hide(); - - //ui->feedToolButton->setEnabled(false); - //ui->fileToolButton->setEnabled(false); -#endif } -#ifdef TODO -int PostedListWidgetWithModel::viewMode() -{ - if (ui->feedToolButton->isChecked()) { - return VIEW_MODE_FEEDS; - } else if (ui->fileToolButton->isChecked()) { - return VIEW_MODE_FILES; - } - - /* Default */ - return VIEW_MODE_FEEDS; -} -#endif - -#ifdef TODO -/*static*/ bool PostedListWidgetWithModel::filterItem(FeedItem *feedItem, const QString &text, int filter) -{ - GxsChannelPostItem *item = dynamic_cast(feedItem); - if (!item) { - return true; - } - - bool bVisible = text.isEmpty(); - - if (!bVisible) - { - switch(filter) - { - case FILTER_TITLE: - bVisible = item->getTitleLabel().contains(text,Qt::CaseInsensitive); - break; - case FILTER_MSG: - bVisible = item->getMsgLabel().contains(text,Qt::CaseInsensitive); - break; - case FILTER_FILE_NAME: - { - std::list fileItems = item->getFileItems(); - std::list::iterator lit; - for(lit = fileItems.begin(); lit != fileItems.end(); ++lit) - { - SubFileItem *fi = *lit; - QString fileName = QString::fromUtf8(fi->FileName().c_str()); - bVisible = (bVisible || fileName.contains(text,Qt::CaseInsensitive)); - } - break; - } - default: - bVisible = true; - break; - } - } - - return bVisible; -} - -void PostedListWidget::createPostItemFromMetaData(const RsGxsMsgMetaData& meta,bool related) -{ - GxsChannelPostItem *item = NULL; - RsGxsChannelPost post; - - if(!meta.mOrigMsgId.isNull()) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mOrigMsgId)) ; - item = dynamic_cast(feedItem); - - if(item) - { - post = feedItem->post(); - ui->feedWidget->removeFeedItem(item) ; - - post.mOlderVersions.insert(post.mMeta.mMsgId); - - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, post, true, false,post.mOlderVersions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs)); - - return ; - } - } - - if (related) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mMsgId)) ; - item = dynamic_cast(feedItem); - } - if (item) - { - item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); - } - else - { - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, meta.mGroupId,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(post.mMeta.mPublishTs)); - } -#ifdef TODO - ui->fileWidget->addFiles(post, related); -#endif -} - -void PostedListWidget::createPostItem(const RsGxsChannelPost& post, bool related) -{ - GxsChannelPostItem *item = NULL; - - const RsMsgMetaData& meta(post.mMeta); - - if(!meta.mOrigMsgId.isNull()) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mOrigMsgId)) ; - item = dynamic_cast(feedItem); - - if(item) - { - std::set older_versions(item->olderVersions()); // we make a copy because the item will be deleted - ui->feedWidget->removeFeedItem(item) ; - - older_versions.insert(meta.mMsgId); - - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, false,older_versions); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); - - return ; - } - } - - if (related) - { - FeedItem *feedItem = ui->feedWidget->findFeedItem(GxsChannelPostItem::computeIdentifier(meta.mMsgId)) ; - item = dynamic_cast(feedItem); - } - if (item) - { - item->setPost(post); - ui->feedWidget->setSort(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); - } - else - { - GxsChannelPostItem *item = new GxsChannelPostItem(this, 0, mGroup.mMeta,meta.mMsgId, true, true); - ui->feedWidget->addFeedItem(item, ROLE_PUBLISH, DateTime::DateTimeFromTime_t(meta.mPublishTs)); - } - - ui->fileWidget->addFiles(post, related); -} - -void PostedListWidget::fillThreadCreatePost(const QVariant &post, bool related, int current, int count) -{ - /* show fill progress */ - if (count) { - ui->progressBar->setValue(current * ui->progressBar->maximum() / count); - } - - if (!post.canConvert()) { - return; - } - - createPostItem(post.value(), related); -} -#endif - void PostedListWidgetWithModel::blank() { -#ifdef TODO - ui->postButton->setEnabled(false); - ui->subscribeToolButton->setEnabled(false); - - ui->channelName_LB->setText(tr("No Channel Selected")); - ui->logoLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/channels.png")); - ui->infoPosts->setText(""); - ui->infoLastPost->setText(""); - ui->infoAdministrator->setText(""); - ui->infoDistribution->setText(""); - ui->infoCreated->setText(""); - ui->infoDescription->setText(""); - - mChannelPostsModel->clear(); - mChannelPostFilesModel->clear(); - ui->postDetails_TE->clear(); - ui->postLogo_LB->hide(); - ui->postName_LB->hide(); - ui->postTime_LB->hide(); -#endif groupNameChanged(QString()); } From c8a93d75f22e412cfc2e7d7b8d2c51939a1f4a71 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 30 Oct 2025 19:55:44 +0100 Subject: [PATCH 131/147] fixed deferred loading of GxsChannelPostItem --- .../src/gui/feeds/GxsChannelPostItem.cpp | 220 +++--------------- .../src/gui/feeds/GxsChannelPostItem.h | 35 +-- 2 files changed, 53 insertions(+), 202 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index a50a0c46e..51772f125 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -45,37 +45,9 @@ * #define DEBUG_ITEM 1 ****/ -GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGroupMetaData& group_meta, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate,const std::set& older_versions) : - GxsFeedItem(feedHolder, feedId, group_meta.mGroupId, messageId, isHome, rsGxsChannels, autoUpdate), - mGroupMeta(group_meta) -{ - mLoadingGroup = false; - mLoadingMessage = false; - mLoadingComment = false; - - mPost.mMeta.mMsgId = messageId; // useful for uniqueIdentifer() before the post is loaded - mPost.mMeta.mGroupId = mGroupMeta.mGroupId; - - QVector v; - //bool self = false; - - for(std::set::const_iterator it(older_versions.begin());it!=older_versions.end();++it) - v.push_back(*it) ; - - if(older_versions.find(messageId) == older_versions.end()) - v.push_back(messageId); - - setMessageVersions(v) ; - setup(); - - // no call to loadGroup() here because we have it already. -} - GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate,const std::set& older_versions) : GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsGxsChannels, autoUpdate) // this one should be in GxsFeedItem { - mPost.mMeta.mMsgId = messageId; // useful for uniqueIdentifer() before the post is loaded - QVector v; //bool self = false; @@ -85,55 +57,38 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, if(older_versions.find(messageId) == older_versions.end()) v.push_back(messageId); - setMessageVersions(v) ; + mLoadingStatus = NO_DATA; + + setMessageVersions(v) ; setup(); - - loadGroup(); } -// GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost& post, bool isHome, bool autoUpdate,const std::set& older_versions) : -// GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsChannels, autoUpdate) -// { -// mPost.mMeta.mMsgId.clear(); // security -// init(post.mMeta.mMsgId,older_versions) ; -// mPost = post ; -// } - -// void GxsChannelPostItem::init(const RsGxsMessageId& messageId,const std::set& older_versions) -// { -// QVector v; -// //bool self = false; -// -// for(std::set::const_iterator it(older_versions.begin());it!=older_versions.end();++it) -// v.push_back(*it) ; -// -// if(older_versions.find(messageId) == older_versions.end()) -// v.push_back(messageId); -// -// setMessageVersions(v) ; -// -// setup(); -// -// mLoaded = false ; -// } - void GxsChannelPostItem::paintEvent(QPaintEvent *e) { /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(!mLoaded) - { - mLoaded = true ; + if(mLoadingStatus != FILLED && !mGroupMeta.mGroupId.isNull() && !mPost.mMeta.mMsgId.isNull() ) + mLoadingStatus = HAS_DATA; - std::set older_versions; // not so nice. We need to use std::set everywhere - for(auto& m:messageVersions()) - older_versions.insert(m); + if(mGroupMeta.mGroupId.isNull() && !mLoadingGroup) + requestGroup(); - fill(); - requestMessage(); - requestComment(); - } + if(mPost.mMeta.mMsgId.isNull() && !mLoadingMessage) + requestMessage(); + + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; + + case HAS_DATA: + fill(); + mLoadingStatus = FILLED; + break; + } GxsFeedItem::paintEvent(e) ; } @@ -142,13 +97,12 @@ GxsChannelPostItem::~GxsChannelPostItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( (mLoadingGroup || mLoadingMessage || mLoadingComment) + while( (mLoadingGroup || mLoadingMessage) && std::chrono::steady_clock::now() < timeout) { RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for " << (mLoadingGroup ? "Group " : "") << (mLoadingMessage ? "Message " : "") - << (mLoadingComment ? "Comment " : "") << "loading." << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -188,9 +142,7 @@ void GxsChannelPostItem::setup() setAttribute(Qt::WA_DeleteOnClose, true); - mInFill = false; mCloseOnRead = false; - mLoaded = false; /* clear ui */ ui->titleLabel->setText(tr("Loading...")); @@ -210,7 +162,7 @@ void GxsChannelPostItem::setup() connect(ui->downloadButton, SIGNAL(clicked()), this, SLOT(download())); // HACK FOR NOW. ui->commentButton->hide();// hidden until properly enabled. - connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments())); +// connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments())); connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play(void))); //connect(ui->editButton, SIGNAL(clicked()), this, SLOT(edit(void))); @@ -246,22 +198,9 @@ void GxsChannelPostItem::setup() } -bool GxsChannelPostItem::setPost(const RsGxsChannelPost &post, bool doFill) +bool GxsChannelPostItem::setPost(const RsGxsChannelPost &post) { - if (groupId() != post.mMeta.mGroupId || messageId() != post.mMeta.mMsgId) { - std::cerr << "GxsChannelPostItem::setPost() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - mPost = post; - - if (doFill) { - fill(); - } - - updateItem(); - return true; } @@ -282,18 +221,10 @@ QString GxsChannelPostItem::groupName() return QString::fromUtf8(mGroupMeta.mGroupName.c_str()); } -void GxsChannelPostItem::loadComments() -{ - QString title = QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); - comments(title); -} - void GxsChannelPostItem::loadGroup() { -#ifdef DEBUG_ITEM - std::cerr << "GxsChannelGroupItem::loadGroup()"; - std::cerr << std::endl; -#endif + std::cerr << "GxsChannelGroupItem::loadGroup()" << std::endl; + mLoadingGroup = true; RsThread::async([this]() @@ -305,14 +236,14 @@ void GxsChannelPostItem::loadGroup() if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) // would be better to call channel Summaries for a single group { - RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; + RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data for group " << groupId() << std::endl; mLoadingGroup = false; return; } if (groups.size() != 1) { - std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items"; + std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items for group " << groupId() ; std::cerr << std::endl; mLoadingGroup = false; return; @@ -328,6 +259,8 @@ void GxsChannelPostItem::loadGroup() mGroupMeta = group.mMeta; mLoadingGroup = false; + update(); // this triggers a paintEvent if needed. + }, this ); }); } @@ -365,28 +298,9 @@ void GxsChannelPostItem::loadMessage() { setPost(post); mLoadingMessage = false; + update(); // this triggers a paintEvent if needed. + }, this ); - } - else if(comments.size() == 1) - { - const RsGxsComment& cmt = comments[0]; -#ifdef DEBUG_ITEM - std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl; -#endif - - RsQThreadUtils::postToObject( [cmt,this]() - { - ui->newCommentLabel->show(); - ui->commLabel->show(); - ui->commLabel->setText(QString::fromUtf8(cmt.mComment.c_str())); - - // Change this item to be uploaded with thread element. Note: this is terrible coding. - setMessageId(cmt.mMeta.mThreadId); - mLoadingMessage = false; - - requestMessage(); - }, this ); - } else { @@ -399,55 +313,12 @@ void GxsChannelPostItem::loadMessage() { removeItem(); mLoadingMessage = false; + update(); // this triggers a paintEvent if needed. }, this ); } }); } -void GxsChannelPostItem::loadComment() -{ -#ifdef DEBUG_ITEM - std::cerr << "GxsChannelPostItem::loadComment()"; - std::cerr << std::endl; -#endif - mLoadingComment = true; - - RsThread::async([this]() - { - // 1 - get group data - - std::set msgIds; - - for(auto MsgId: messageVersions()) - msgIds.insert(MsgId); - - std::vector posts; - std::vector comments; - - if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments)) - { - RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - mLoadingComment = false; - return; - } - - int comNb = comments.size(); - - RsQThreadUtils::postToObject( [comNb,this]() - { - QString sComButText = tr("Comment"); - if (comNb == 1) - sComButText = sComButText.append("(1)"); - else if(comNb > 1) - sComButText = tr("Comments ").append("(%1)").arg(comNb); - - ui->commentButton->setText(sComButText); - mLoadingComment = false; - - }, this ); - }); -} - void GxsChannelPostItem::fill() { #ifdef DEBUG_ITEM @@ -455,8 +326,6 @@ void GxsChannelPostItem::fill() std::cerr << std::endl; #endif - mInFill = true; - QString title; QString msgText; //float f = QFontMetricsF(font()).height()/14.0 ; @@ -559,21 +428,6 @@ void GxsChannelPostItem::fill() ui->commentButton->hide(); } -// THIS CODE IS doesn't compile - disabling until fixed. -#if 0 - if (post.mComments) - { - QString commentText = QString::number(post.mComments); - commentText += " "; - commentText += tr("Comments"); - ui->commentButton->setText(commentText); - } - else - { - ui->commentButton->setText(tr("Comment")); - } -#endif - } else { @@ -639,8 +493,6 @@ void GxsChannelPostItem::fill() QLayout *layout = ui->expandFrame->layout(); layout->addWidget(fi); } - - mInFill = false; } void GxsChannelPostItem::fillExpandFrame() @@ -871,10 +723,6 @@ void GxsChannelPostItem::play() void GxsChannelPostItem::readToggled(bool /*checked*/) { - if (mInFill) { - return; - } - mCloseOnRead = false; RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId()); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index b3e7843c0..de2a50559 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -44,17 +44,25 @@ public: GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate, const std::set& older_versions = std::set()); +#ifdef UNUSED // This one is used in channel thread widget. We don't want the group data to reload at every post, so we load it in the hosting // GxsChannelsPostsWidget and pass it to created items. GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGroupMetaData& group, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate, const std::set& older_versions = std::set()); +#endif virtual ~GxsChannelPostItem(); uint64_t uniqueIdentifier() const override { return hash_64bits("GxsChannelPostItem " + messageId().toStdString()) ; } - bool setGroup(const RsGxsChannelGroup& group, bool doFill = true); - bool setPost(const RsGxsChannelPost& post, bool doFill = true); +protected: + enum LoadingStatus { + NO_DATA = 0x00, + HAS_DATA = 0x01, + FILLED = 0x02 + }; + + bool setPost(const RsGxsChannelPost& post); //void setFileCleanUpWarning(uint32_t time_left); @@ -62,19 +70,17 @@ public: QString getMsgLabel(); const std::list &getFileItems() {return mFileItems; } - bool isLoaded() const {return mLoaded;}; bool isUnread() const ; void setReadStatus(bool isNew, bool isUnread); const std::set& olderVersions() const { return mPost.mOlderVersions; } static uint64_t computeIdentifier(const RsGxsMessageId& msgid) { return hash64("GxsChannelPostItem " + msgid.toStdString()) ; } -protected: //void init(const RsGxsMessageId& messageId,const std::set& older_versions); /* FeedItem */ - virtual void doExpand(bool open); - virtual void expandFill(bool first); + virtual void doExpand(bool open) override; + virtual void expandFill(bool first) override; // This does nothing except triggering the loading of the post data and comments. This function is mainly used to detect // when the post is actually made visible. @@ -82,14 +88,14 @@ protected: virtual void paintEvent(QPaintEvent *) override; /* GxsGroupFeedItem */ - virtual QString groupName(); + virtual QString groupName() override; virtual void loadGroup() override; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; } + virtual RetroShareLink::enumType getLinkType() override{ return RetroShareLink::TYPE_CHANNEL; } /* GxsFeedItem */ - virtual QString messageName(); - virtual void loadMessage(); - virtual void loadComment(); + virtual QString messageName() override; + virtual void loadMessage() override; + virtual void loadComment() override {} private slots: /* default stuff */ @@ -98,7 +104,6 @@ private slots: void download(); void play(); void edit(); - void loadComments(); void readToggled(bool checked); @@ -117,14 +122,12 @@ private: void fillExpandFrame(); private: - bool mInFill; bool mCloseOnRead; - bool mLoaded; + + LoadingStatus mLoadingStatus; bool mLoadingMessage; bool mLoadingGroup; - bool mLoadingComment; - RsGroupMetaData mGroupMeta; RsGxsChannelPost mPost; From c8dbf34a141775a1c7c954f17788fce8cd864783 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 31 Oct 2025 19:49:39 +0100 Subject: [PATCH 132/147] fixed ChannelsCommentsItem --- .../src/gui/feeds/ChannelsCommentsItem.cpp | 347 ++++++++---------- .../src/gui/feeds/ChannelsCommentsItem.h | 49 ++- .../src/gui/feeds/GxsChannelPostItem.cpp | 45 +-- .../src/gui/feeds/GxsChannelPostItem.h | 4 - 4 files changed, 180 insertions(+), 265 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp index ed2ce468f..5c112689a 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp @@ -49,39 +49,14 @@ * #define DEBUG_ITEM 1 ****/ -// ChannelsCommentsItem::ChannelsCommentsItem(FeedHolder *feedHolder, uint32_t feedId, const RsGroupMetaData& group_meta, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate,const std::set& older_versions) : -// GxsFeedItem(feedHolder, feedId, group_meta.mGroupId, messageId, isHome, rsGxsChannels, autoUpdate), -// mGroupMeta(group_meta) -// { -// mLoadingGroup = false; -// mLoadingMessage = false; -// mLoadingComment = false; -// -// mPost.mMeta.mMsgId = messageId; // useful for uniqueIdentifer() before the post is loaded -// mPost.mMeta.mGroupId = mGroupMeta.mGroupId; -// -// QVector v; -// //bool self = false; -// -// for(std::set::const_iterator it(older_versions.begin());it!=older_versions.end();++it) -// v.push_back(*it) ; -// -// if(older_versions.find(messageId) == older_versions.end()) -// v.push_back(messageId); -// -// setMessageVersions(v) ; -// setup(); -// -// // no call to loadGroup() here because we have it already. -// } - ChannelsCommentsItem::ChannelsCommentsItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId& groupId, const RsGxsMessageId &commentId, const RsGxsMessageId &threadId, bool isHome, bool autoUpdate) : GxsFeedItem(feedHolder, feedId, groupId, commentId, isHome, rsGxsChannels, autoUpdate), // this one should be in GxsFeedItem mThreadId(threadId) { - mLoading= false; - - QVector v; + mLoadingStatus = NO_DATA; + mLoadingComment = false; + mLoadingGroup = false; + mLoadingMessage = false; setup(); } @@ -91,10 +66,28 @@ void ChannelsCommentsItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(!mLoaded) - { - mLoaded = true ; - load(); + if(mLoadingStatus != FILLED && !mGroupMeta.mGroupId.isNull() && !mComment.mMeta.mMsgId.isNull()) + mLoadingStatus = HAS_DATA; + + if(mGroupMeta.mGroupId.isNull() && !mLoadingGroup) + loadGroupData(); + + if(mComment.mMeta.mMsgId.isNull() && !mLoadingComment) + loadCommentData(); + + if(mPost.mMeta.mMsgId.isNull() && !mLoadingMessage) + loadMessageData(); + + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; + case HAS_DATA: + fill(); + mLoadingStatus = FILLED; + break; } GxsFeedItem::paintEvent(e) ; @@ -104,9 +97,14 @@ ChannelsCommentsItem::~ChannelsCommentsItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( mLoading && std::chrono::steady_clock::now() < timeout ) + while( (mLoadingGroup || mLoadingComment) + && std::chrono::steady_clock::now() < timeout ) { - RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " << std::endl; + RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " + << (mLoadingGroup ? "Group " : "") + << (mLoadingMessage ? "Message " : "") + << (mLoadingComment ? "Comment " : "") + << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); } @@ -115,7 +113,7 @@ ChannelsCommentsItem::~ChannelsCommentsItem() bool ChannelsCommentsItem::isUnread() const { - return IS_MSG_UNREAD(mPost.mMeta.mMsgStatus) ; + return IS_MSG_UNREAD(mComment.mMeta.mMsgStatus) ; } void ChannelsCommentsItem::setup() @@ -141,9 +139,7 @@ void ChannelsCommentsItem::setup() setAttribute(Qt::WA_DeleteOnClose, true); - mInFill = false; mCloseOnRead = false; - mLoaded = false; /* clear ui */ ui->datetimeLabel->clear(); @@ -178,33 +174,6 @@ void ChannelsCommentsItem::setup() ui->expandFrame->hide(); } -bool ChannelsCommentsItem::setPost(const RsGxsChannelPost& post, bool doFill) -{ - mPost = post; - - if (doFill) - fill(); - - return true; -} -bool ChannelsCommentsItem::setMissingPost() -{ - fill(true); - return true; -} - -QString ChannelsCommentsItem::getTitleLabel() -{ - return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); -} - -QString ChannelsCommentsItem::getMsgLabel() -{ - //return RsHtml().formatText(NULL, QString::fromUtf8(mPost.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS); - // Disabled, because emoticon replacement kills performance. - return QString::fromUtf8(mPost.mMsg.c_str()); -} - QString ChannelsCommentsItem::groupName() { return QString::fromUtf8(mGroupMeta.mGroupName.c_str()); @@ -219,93 +188,109 @@ void ChannelsCommentsItem::loadComments() return ; MainWindow::showWindow(MainWindow::Channels); - channelDialog->navigate(mPost.mMeta.mGroupId, mPost.mMeta.mMsgId); + channelDialog->navigate(mComment.mMeta.mGroupId, mComment.mMeta.mMsgId); } -void ChannelsCommentsItem::loadGroup() +void ChannelsCommentsItem::loadGroupData() { -//#ifdef DEBUG_ITEM -// std::cerr << "GxsChannelGroupItem::loadGroup()"; -// std::cerr << std::endl; -//#endif -// if(mLoading) -// return; -// -// mLoading= true; -// -// std::cerr << "Loading group" << std::endl; -// RsThread::async([this]() -// { -// // 1 - get group data -// -// std::vector groups; -// const std::list groupIds = { groupId() }; -// -// if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) // would be better to call channel Summaries for a single group -// { -// RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; -// return; -// } -// -// if (groups.size() != 1) -// { -// std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items"; -// std::cerr << std::endl; -// return; -// } -// RsGxsChannelGroup group(groups[0]); -// -// RsQThreadUtils::postToObject( [group,this]() -// { -// /* Here it goes any code you want to be executed on the Qt Gui -// * thread, for example to update the data model with new information -// * after a blocking call to RetroShare API complete */ -// -// mGroupMeta = group.mMeta; -// mLoading= false; -// -// std::cerr << "End loading group" << std::endl; -// }, this ); -// }); -} -void ChannelsCommentsItem::load() -{ - // This function loads everything that's needed: - // - the comment text - // - the comment parent message + std::cerr << "GxsChannelGroupItem::loadGroup()" << std::endl; -#ifdef DEBUG_ITEM - std::cerr << "ChannelsCommentsItem::loadMessage()"; - std::cerr << std::endl; -#endif - if(mLoading) - return; - - mLoading= true; + mLoadingGroup = true; RsThread::async([this]() - { - // 1 - get group meta data + { + // 1 - get group data std::vector groups; const std::list groupIds = { groupId() }; if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) // would be better to call channel Summaries for a single group { - RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - mLoading= false; + RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data for group " << groupId() << std::endl; + mLoadingGroup = false; return; } if (groups.size() != 1) { - std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items" << std::endl; - mLoading= false; + std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items for group " << groupId() ; + std::cerr << std::endl; + mLoadingGroup = false; return; } RsGxsChannelGroup group(groups[0]); - // 2 - get message and comment data + RsQThreadUtils::postToObject( [group,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete */ + + mGroupMeta = group.mMeta; + mLoadingGroup = false; + + update(); // this triggers a paintEvent if needed. + + }, this ); + }); +} +void ChannelsCommentsItem::loadMessageData() +{ +#ifdef DEBUG_ITEM + std::cerr << "ChannelsCommentsItem::loadCommentData()"; + std::cerr << std::endl; +#endif + mLoadingMessage = true; + + RsThread::async([this]() + { + // 1 - get message and comment data + + std::vector posts; + std::vector comments; + std::vector votes; + + if(! rsGxsChannels->getChannelContent( groupId(), std::set( { mThreadId } ),posts,comments,votes)) + { + RsErr() << "GxsGxsChannelGroupItem::loadMessage() ERROR getting data" << std::endl; + mLoadingMessage = false; + return; + } + + // now that everything is in place, update the UI + + RsQThreadUtils::postToObject( [posts,this]() + { + /* Here it goes any code you want to be executed on the Qt Gui + * thread, for example to update the data model with new information + * after a blocking call to RetroShare API complete */ + + if(posts.size()!=1) // the original post cannot be found. Removing the comment item. + { + mLoadingMessage = false; + removeItem(); + return; + } + + mPost = posts[0]; + mLoadingMessage = false; + + update(); + + }, this ); + }); +} +void ChannelsCommentsItem::loadCommentData() +{ +#ifdef DEBUG_ITEM + std::cerr << "ChannelsCommentsItem::loadCommentData()"; + std::cerr << std::endl; +#endif + mLoadingComment = true; + + RsThread::async([this]() + { + // 1 - get message and comment data std::vector posts; std::vector comments; @@ -313,53 +298,28 @@ void ChannelsCommentsItem::load() if(! rsGxsChannels->getChannelContent( groupId(), std::set( { messageId(),mThreadId } ),posts,comments,votes)) { - RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl; - mLoading= false; + RsErr() << "GxsGxsChannelGroupItem::loadComment() ERROR getting data" << std::endl; + mLoadingComment = false; return; } + if(comments.size()!=1) + { + mLoadingComment = false; + return; + } - // now that everything is in place, update the UI + // now that everything is in place, update the UI - RsQThreadUtils::postToObject( [group,posts,comments,this]() + RsQThreadUtils::postToObject( [comments,this]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - mGroupMeta = group.mMeta; + mComment = comments[0]; + mLoadingComment = false; - if(comments.size()!=1) - { - mLoading=false; - removeItem(); - } - - RsGxsComment cmt(comments[0]); - - uint32_t autorized_lines = (int)floor( (ui->avatarLabel->height() - ui->button_HL->sizeHint().height()) - / QFontMetricsF(ui->subjectLabel->font()).height()); - - ui->commLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(cmt.mComment.c_str()), autorized_lines), RSHTML_FORMATTEXT_EMBED_LINKS)); - ui->nameLabel->setId(cmt.mMeta.mAuthorId); - ui->datetimeLabel->setText(DateTime::formatLongDateTime(cmt.mMeta.mPublishTs)); - - RsIdentityDetails idDetails ; - rsIdentity->getIdDetails(cmt.mMeta.mAuthorId,idDetails); - QPixmap pixmap ; - - if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) - pixmap = GxsIdDetails::makeDefaultIcon(cmt.mMeta.mAuthorId,GxsIdDetails::LARGE); - ui->avatarLabel->setPixmap(pixmap); - - //Change this item to be uploaded with thread element. This is really bad practice. - - if (posts.size() == 1) - setPost(posts[0]); - else - setMissingPost(); - - emit sizeChanged(this); - mLoading=false; + update(); }, this ); }); @@ -372,11 +332,9 @@ void ChannelsCommentsItem::fill(bool missing_post) std::cerr << std::endl; #endif - mInFill = true; - if (!mIsHome) { - if (mCloseOnRead && !IS_MSG_NEW(mPost.mMeta.mMsgStatus)) { + if (mCloseOnRead && !IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { removeItem(); } @@ -393,13 +351,13 @@ void ChannelsCommentsItem::fill(bool missing_post) ui->readButton->hide(); - if (IS_MSG_NEW(mPost.mMeta.mMsgStatus)) { + if (IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { mCloseOnRead = true; } } else { - if(missing_post) + if(mPost.mMeta.mMsgId.isNull()) ui->subjectLabel->setText("[" + QObject::tr("Missing channel post")+"]"); else ui->subjectLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), 2)) ; @@ -415,7 +373,7 @@ void ChannelsCommentsItem::fill(bool missing_post) { ui->readButton->setVisible(true); - setReadStatus(IS_MSG_NEW(mPost.mMeta.mMsgStatus), IS_MSG_UNREAD(mPost.mMeta.mMsgStatus) || IS_MSG_NEW(mPost.mMeta.mMsgStatus)); + setReadStatus(IS_MSG_NEW(mComment.mMeta.mMsgStatus), IS_MSG_UNREAD(mComment.mMeta.mMsgStatus) || IS_MSG_NEW(mComment.mMeta.mMsgStatus)); } else { @@ -424,31 +382,44 @@ void ChannelsCommentsItem::fill(bool missing_post) mCloseOnRead = false; } - - mInFill = false; + uint32_t autorized_lines = (int)floor( (ui->avatarLabel->height() - ui->button_HL->sizeHint().height()) + / QFontMetricsF(ui->subjectLabel->font()).height()); + + ui->commLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(mComment.mComment.c_str()), autorized_lines), RSHTML_FORMATTEXT_EMBED_LINKS)); + ui->nameLabel->setId(mComment.mMeta.mAuthorId); + ui->datetimeLabel->setText(DateTime::formatLongDateTime(mComment.mMeta.mPublishTs)); + + RsIdentityDetails idDetails ; + rsIdentity->getIdDetails(mComment.mMeta.mAuthorId,idDetails); + QPixmap pixmap ; + + if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) + pixmap = GxsIdDetails::makeDefaultIcon(mComment.mMeta.mAuthorId,GxsIdDetails::LARGE); + ui->avatarLabel->setPixmap(pixmap); + } QString ChannelsCommentsItem::messageName() { - return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); + return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); } void ChannelsCommentsItem::setReadStatus(bool isNew, bool isUnread) { if (isNew) - mPost.mMeta.mMsgStatus |= GXS_SERV::GXS_MSG_STATUS_GUI_NEW; + mComment.mMeta.mMsgStatus |= GXS_SERV::GXS_MSG_STATUS_GUI_NEW; else - mPost.mMeta.mMsgStatus &= ~GXS_SERV::GXS_MSG_STATUS_GUI_NEW; + mComment.mMeta.mMsgStatus &= ~GXS_SERV::GXS_MSG_STATUS_GUI_NEW; if (isUnread) { - mPost.mMeta.mMsgStatus |= GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; + mComment.mMeta.mMsgStatus |= GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; whileBlocking(ui->readButton)->setChecked(true); ui->readButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-unread.png")); } else { - mPost.mMeta.mMsgStatus &= ~GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; + mComment.mMeta.mMsgStatus &= ~GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD; whileBlocking(ui->readButton)->setChecked(false); ui->readButton->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/message-state-read.png")); } @@ -522,24 +493,18 @@ void ChannelsCommentsItem::unsubscribeChannel() void ChannelsCommentsItem::readToggled(bool /*checked*/) { - if (mInFill) { - return; - } - mCloseOnRead = false; RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId()); rsGxsChannels->setCommentReadStatus(msgPair, isUnread()); - - //setReadStatus(false, checked); // Updated by events } void ChannelsCommentsItem::makeDownVote() { RsGxsGrpMsgIdPair msgId; - msgId.first = mPost.mMeta.mGroupId; - msgId.second = mPost.mMeta.mMsgId; + msgId.first = mComment.mMeta.mGroupId; + msgId.second = mComment.mMeta.mMsgId; ui->voteUpButton->setEnabled(false); ui->voteDownButton->setEnabled(false); @@ -550,8 +515,8 @@ void ChannelsCommentsItem::makeDownVote() void ChannelsCommentsItem::makeUpVote() { RsGxsGrpMsgIdPair msgId; - msgId.first = mPost.mMeta.mGroupId; - msgId.second = mPost.mMeta.mMsgId; + msgId.first = mComment.mMeta.mGroupId; + msgId.second = mComment.mMeta.mMsgId; ui->voteUpButton->setEnabled(false); ui->voteDownButton->setEnabled(false); diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h index c245cbca7..d8f38e1d4 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h @@ -50,34 +50,25 @@ public: bool isHome, bool autoUpdate); - // This one is used in channel thread widget. We don't want the group data to reload at every post, so we load it in the hosting - // GxsChannelsPostsWidget and pass it to created items. - // ChannelsCommentsItem(FeedHolder *feedHolder, uint32_t feedId, const RsGroupMetaData& group, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate, const std::set& older_versions = std::set()); - virtual ~ChannelsCommentsItem(); uint64_t uniqueIdentifier() const override { return hash_64bits("ChannelsCommentsItem " + messageId().toStdString()) ; } - bool setGroup(const RsGxsChannelGroup& group, bool doFill = true); - bool setPost(const RsGxsChannelPost& post, bool doFill = true); - bool setMissingPost(); +protected: + enum LoadingStatus { + NO_DATA = 0x00, + HAS_DATA = 0x01, + FILLED = 0x02 + }; - QString getTitleLabel(); - QString getMsgLabel(); - - bool isLoaded() const {return mLoaded;}; bool isUnread() const ; void setReadStatus(bool isNew, bool isUnread); - const std::set& olderVersions() const { return mPost.mOlderVersions; } - static uint64_t computeIdentifier(const RsGxsMessageId& msgid) { return hash64("ChannelsCommentsItem " + msgid.toStdString()) ; } -protected: - //void init(const RsGxsMessageId& messageId,const std::set& older_versions); /* FeedItem */ - virtual void doExpand(bool open); - virtual void expandFill(bool first); + virtual void doExpand(bool open) override; + virtual void expandFill(bool first) override; // This does nothing except triggering the loading of the post data and comments. This function is mainly used to detect // when the post is actually made visible. @@ -85,12 +76,12 @@ protected: virtual void paintEvent(QPaintEvent *) override; /* GxsGroupFeedItem */ - virtual QString groupName(); - virtual void loadGroup() override; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; } + virtual QString groupName() override; + virtual void loadGroup() override {} + virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_CHANNEL; } /* GxsFeedItem */ - virtual QString messageName(); + virtual QString messageName() override; virtual void loadMessage() override {} virtual void loadComment() override {} @@ -110,19 +101,23 @@ signals: void vote(const RsGxsGrpMsgIdPair& msgId, bool up); private: - void load(); void setup(); void fill(bool missing_post=false); + void loadGroupData(); + void loadMessageData(); + void loadCommentData(); -private: - bool mInFill; bool mCloseOnRead; - bool mLoaded; - bool mLoading; + LoadingStatus mLoadingStatus; + + bool mLoadingComment; + bool mLoadingGroup; + bool mLoadingMessage; RsGroupMetaData mGroupMeta; - RsGxsChannelPost mPost; + RsGxsComment mComment; + RsGxsChannelPost mPost; RsGxsMessageId mThreadId; /** Qt Designer generated object */ diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 51772f125..703d5e6b9 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -58,6 +58,8 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, v.push_back(messageId); mLoadingStatus = NO_DATA; + mLoadingMessage = false; + mLoadingGroup = false; setMessageVersions(v) ; setup(); @@ -173,8 +175,6 @@ void GxsChannelPostItem::setup() // hide voting buttons, backend is not implemented yet ui->voteUpButton->hide(); ui->voteDownButton->hide(); - //connect(ui-> voteUpButton, SIGNAL(clicked()), this, SLOT(makeUpVote())); - //connect(ui->voteDownButton, SIGNAL(clicked()), this, SLOT(makeDownVote())); ui->scoreLabel->hide(); @@ -533,22 +533,6 @@ void GxsChannelPostItem::setReadStatus(bool isNew, bool isUnread) ui->feedFrame->style()->polish( ui->feedFrame); } -// void GxsChannelPostItem::setFileCleanUpWarning(uint32_t time_left) -// { -// int hours = (int)time_left/3600; -// int minutes = (time_left - hours*3600)%60; -// -// ui->warning_label->setText(tr("Warning! You have less than %1 hours and %2 minute before this file is deleted Consider saving it.").arg( -// QString::number(hours)).arg(QString::number(minutes))); -// -// QFont warnFont = ui->warning_label->font(); -// warnFont.setBold(true); -// ui->warning_label->setFont(warnFont); -// -// ui->warn_image_label->setVisible(true); -// ui->warning_label->setVisible(true); -// } - void GxsChannelPostItem::updateItem() { /* fill in */ @@ -732,28 +716,3 @@ void GxsChannelPostItem::readToggled(bool /*checked*/) //setReadStatus(false, checked); // Updated by events } -void GxsChannelPostItem::makeDownVote() -{ - RsGxsGrpMsgIdPair msgId; - msgId.first = mPost.mMeta.mGroupId; - msgId.second = mPost.mMeta.mMsgId; - - ui->voteUpButton->setEnabled(false); - ui->voteDownButton->setEnabled(false); - - emit vote(msgId, false); -} - -void GxsChannelPostItem::makeUpVote() -{ - RsGxsGrpMsgIdPair msgId; - msgId.first = mPost.mMeta.mGroupId; - msgId.second = mPost.mMeta.mMsgId; - - ui->voteUpButton->setEnabled(false); - ui->voteDownButton->setEnabled(false); - - emit vote(msgId, true); -} - - diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index de2a50559..44cb27b37 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -76,7 +76,6 @@ protected: const std::set& olderVersions() const { return mPost.mOlderVersions; } static uint64_t computeIdentifier(const RsGxsMessageId& msgid) { return hash64("GxsChannelPostItem " + msgid.toStdString()) ; } - //void init(const RsGxsMessageId& messageId,const std::set& older_versions); /* FeedItem */ virtual void doExpand(bool open) override; @@ -110,9 +109,6 @@ private slots: void unsubscribeChannel(); void updateItem(); - void makeUpVote(); - void makeDownVote(); - signals: void vote(const RsGxsGrpMsgIdPair& msgId, bool up); From 785a83f62530dd94422d8fae6135db13fbdcda19 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 1 Nov 2025 17:24:58 +0100 Subject: [PATCH 133/147] fixed GxsChannelGroupItem --- .../src/gui/feeds/GxsChannelGroupItem.cpp | 74 +++++++++++-------- .../src/gui/feeds/GxsChannelGroupItem.h | 29 +++++--- .../src/gui/feeds/GxsChannelPostItem.cpp | 8 +- .../src/gui/feeds/GxsChannelPostItem.h | 2 - 4 files changed, 64 insertions(+), 49 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index 4c63fc030..c00422373 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -36,20 +36,22 @@ GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsChannels, autoUpdate) { - mIsLoading = false; + mLoadingGroup = false; + mLoadingStatus = NO_DATA; + setup(); requestGroup(); addEventHandler(); } -GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate) : - GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsGxsChannels, autoUpdate) -{ - mIsLoading = false; - setup(); - setGroup(group); - addEventHandler(); -} +//GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate) : +// GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsGxsChannels, autoUpdate) +//{ +// mIsLoading = false; +// setup(); +// setGroup(group); +// addEventHandler(); +//} void GxsChannelGroupItem::addEventHandler() { @@ -68,7 +70,7 @@ void GxsChannelGroupItem::addEventHandler() case RsChannelEventCode::SUBSCRIBE_STATUS_CHANGED: case RsChannelEventCode::UPDATED_CHANNEL: case RsChannelEventCode::RECEIVED_PUBLISH_KEY: - loadGroup(); + mLoadingStatus = NO_DATA; break; default: break; @@ -77,11 +79,37 @@ void GxsChannelGroupItem::addEventHandler() }, mEventHandlerId, RsEventType::GXS_CHANNELS ); } +void GxsChannelGroupItem::paintEvent(QPaintEvent *e) +{ + /* This method employs a trick to trigger a deferred loading. The post and group is requested only + * when actually displayed on the screen. */ + + if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = HAS_DATA; + + if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) + loadGroup(); + + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; + + case HAS_DATA: + fill(); + mLoadingStatus = FILLED; + break; + } + + GxsGroupFeedItem::paintEvent(e) ; +} GxsChannelGroupItem::~GxsChannelGroupItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( mIsLoading && std::chrono::steady_clock::now() < timeout ) + while( mLoadingGroup && std::chrono::steady_clock::now() < timeout ) { RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -115,23 +143,9 @@ void GxsChannelGroupItem::setup() ui->expandFrame->hide(); } -bool GxsChannelGroupItem::setGroup(const RsGxsChannelGroup &group) -{ - if (groupId() != group.mMeta.mGroupId) { - std::cerr << "GxsChannelGroupItem::setContent() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - - mGroup = group; - fill(); - - return true; -} - void GxsChannelGroupItem::loadGroup() { - mIsLoading = true; + mLoadingGroup = true; RsThread::async([this]() { @@ -143,7 +157,7 @@ void GxsChannelGroupItem::loadGroup() if(!rsGxsChannels->getChannelsInfo(groupIds,groups)) { RsErr() << "PostedItem::loadGroup() ERROR getting data" << std::endl; - mIsLoading = false; + mLoadingGroup = false; return; } @@ -151,7 +165,7 @@ void GxsChannelGroupItem::loadGroup() { std::cerr << "GxsGxsChannelGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - mIsLoading = false; + mLoadingGroup = false; return; } RsGxsChannelGroup group(groups[0]); @@ -162,8 +176,8 @@ void GxsChannelGroupItem::loadGroup() * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - setGroup(group); - mIsLoading = false; + mGroup = group; + mLoadingGroup = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h index 27d8d7480..5110898d6 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h @@ -37,19 +37,27 @@ class GxsChannelGroupItem : public GxsGroupFeedItem public: /** Default Constructor */ GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate); - GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate); - ~GxsChannelGroupItem(); + //GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate); + virtual ~GxsChannelGroupItem(); - bool setGroup(const RsGxsChannelGroup &group); uint64_t uniqueIdentifier() const override { return hash_64bits("GxsChannelGroupItem " + groupId().toStdString()) ; } -protected: - /* FeedItem */ - virtual void doExpand(bool open); - /* GxsGroupFeedItem */ - virtual QString groupName(); +protected: + enum LoadingStatus { + NO_DATA = 0x00, + HAS_DATA = 0x01, + FILLED = 0x02 + }; + + /* FeedItem */ + virtual void doExpand(bool open) override; + + virtual void paintEvent(QPaintEvent *) override; + + /* GxsGroupFeedItem */ + virtual QString groupName() override; virtual void loadGroup() override; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_CHANNEL; } + virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_CHANNEL; } private slots: /* default stuff */ @@ -62,7 +70,8 @@ private: void setup(); void addEventHandler(); - bool mIsLoading; + LoadingStatus mLoadingStatus; + bool mLoadingGroup; private: RsGxsChannelGroup mGroup; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 703d5e6b9..bc5f385d7 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -198,12 +198,6 @@ void GxsChannelPostItem::setup() } -bool GxsChannelPostItem::setPost(const RsGxsChannelPost &post) -{ - mPost = post; - return true; -} - QString GxsChannelPostItem::getTitleLabel() { return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); @@ -296,7 +290,7 @@ void GxsChannelPostItem::loadMessage() RsQThreadUtils::postToObject( [post,this]() { - setPost(post); + mPost = post; mLoadingMessage = false; update(); // this triggers a paintEvent if needed. diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 44cb27b37..2aa3086fa 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -62,8 +62,6 @@ protected: FILLED = 0x02 }; - bool setPost(const RsGxsChannelPost& post); - //void setFileCleanUpWarning(uint32_t time_left); QString getTitleLabel(); From f8061d452c0057b50a2ba8bd5bf67585e7f9e0b9 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 1 Nov 2025 18:05:26 +0100 Subject: [PATCH 134/147] fixed GxsForumGroupItem --- .../src/gui/feeds/ChannelsCommentsItem.h | 5 -- .../src/gui/feeds/GxsChannelGroupItem.cpp | 1 + .../src/gui/feeds/GxsChannelGroupItem.h | 5 -- .../src/gui/feeds/GxsChannelPostItem.h | 6 -- .../src/gui/feeds/GxsForumGroupItem.cpp | 67 ++++++++++--------- .../src/gui/feeds/GxsForumGroupItem.h | 12 ++-- retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h | 6 ++ 7 files changed, 50 insertions(+), 52 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h index d8f38e1d4..6cd25154e 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.h @@ -55,11 +55,6 @@ public: uint64_t uniqueIdentifier() const override { return hash_64bits("ChannelsCommentsItem " + messageId().toStdString()) ; } protected: - enum LoadingStatus { - NO_DATA = 0x00, - HAS_DATA = 0x01, - FILLED = 0x02 - }; bool isUnread() const ; void setReadStatus(bool isNew, bool isUnread); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index c00422373..510302ae2 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -71,6 +71,7 @@ void GxsChannelGroupItem::addEventHandler() case RsChannelEventCode::UPDATED_CHANNEL: case RsChannelEventCode::RECEIVED_PUBLISH_KEY: mLoadingStatus = NO_DATA; + mGroup = RsGxsChannelGroup(); break; default: break; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h index 5110898d6..604145941 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.h @@ -43,11 +43,6 @@ public: uint64_t uniqueIdentifier() const override { return hash_64bits("GxsChannelGroupItem " + groupId().toStdString()) ; } protected: - enum LoadingStatus { - NO_DATA = 0x00, - HAS_DATA = 0x01, - FILLED = 0x02 - }; /* FeedItem */ virtual void doExpand(bool open) override; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 2aa3086fa..fd5ccfd86 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -56,12 +56,6 @@ public: uint64_t uniqueIdentifier() const override { return hash_64bits("GxsChannelPostItem " + messageId().toStdString()) ; } protected: - enum LoadingStatus { - NO_DATA = 0x00, - HAS_DATA = 0x01, - FILLED = 0x02 - }; - //void setFileCleanUpWarning(uint32_t time_left); QString getTitleLabel(); diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index a392137dc..d338ebb57 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -34,9 +34,9 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsForums, autoUpdate) { - mIsLoading = false; + mLoadingGroup = false; + mLoadingStatus = NO_DATA; setup(); - requestGroup(); addEventHandler(); } @@ -45,9 +45,9 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, co mAddedModerators(added_moderators), mRemovedModerators(removed_moderators) { - mIsLoading = false; + mLoadingGroup = false; + mLoadingStatus = NO_DATA; setup(); - requestGroup(); addEventHandler(); } @@ -68,7 +68,8 @@ void GxsForumGroupItem::addEventHandler() case RsForumEventCode::SUBSCRIBE_STATUS_CHANGED: case RsForumEventCode::UPDATED_FORUM: case RsForumEventCode::MODERATOR_LIST_CHANGED: - loadGroup(); + mLoadingStatus = NO_DATA; + mGroup = RsGxsForumGroup(); break; default: break; @@ -77,19 +78,37 @@ void GxsForumGroupItem::addEventHandler() }, mEventHandlerId, RsEventType::GXS_FORUMS ); } -GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, bool isHome, bool autoUpdate) : - GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsGxsForums, autoUpdate) +void GxsForumGroupItem::paintEvent(QPaintEvent *e) { - setup(); - setGroup(group); - addEventHandler(); -} + /* This method employs a trick to trigger a deferred loading. The post and group is requested only + * when actually displayed on the screen. */ + if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = HAS_DATA; + + if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) + loadGroup(); + + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; + + case HAS_DATA: + fill(); + mLoadingStatus = FILLED; + break; + } + + GxsGroupFeedItem::paintEvent(e) ; +} GxsForumGroupItem::~GxsForumGroupItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( mIsLoading && std::chrono::steady_clock::now() < timeout ) + while( mLoadingGroup && std::chrono::steady_clock::now() < timeout ) { RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for data to load " << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -123,23 +142,9 @@ void GxsForumGroupItem::setup() ui->expandFrame->hide(); } -bool GxsForumGroupItem::setGroup(const RsGxsForumGroup &group) -{ - if (groupId() != group.mMeta.mGroupId) { - std::cerr << "GxsForumGroupItem::setContent() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - - mGroup = group; - fill(); - - return true; -} - void GxsForumGroupItem::loadGroup() { - mIsLoading = true; + mLoadingGroup = true; RsThread::async([this]() { @@ -155,7 +160,7 @@ void GxsForumGroupItem::loadGroup() if(!rsGxsForums->getForumsInfo(forumIds,groups)) { RsErr() << "GxsForumGroupItem::loadGroup() ERROR getting data" << std::endl; - mIsLoading = false; + mLoadingGroup = false; return; } @@ -163,7 +168,7 @@ void GxsForumGroupItem::loadGroup() { std::cerr << "GxsForumGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - mIsLoading = false; + mLoadingGroup = false; return; } RsGxsForumGroup group(groups[0]);// no reference to teporary accross threads! @@ -174,8 +179,8 @@ void GxsForumGroupItem::loadGroup() * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - setGroup(group); - mIsLoading = false; + mGroup = group; + mLoadingGroup = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h index 823b698cf..4a70a215d 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.h @@ -39,14 +39,15 @@ public: /** Default Constructor */ GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate); GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const std::list& added_moderators,const std::list& removed_moderators,bool isHome, bool autoUpdate); - GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, bool isHome, bool autoUpdate); - virtual ~GxsForumGroupItem() override; + //GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, bool isHome, bool autoUpdate); - bool setGroup(const RsGxsForumGroup &group); + virtual ~GxsForumGroupItem() override; uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumGroupItem " + groupId().toStdString()) ; } protected: - /* FeedItem */ + virtual void paintEvent(QPaintEvent *) override; + + /* FeedItem */ virtual void doExpand(bool open) override; /* GxsGroupFeedItem */ @@ -69,7 +70,8 @@ private: /** Qt Designer generated object */ Ui::GxsForumGroupItem *ui; - bool mIsLoading; + bool mLoadingGroup; + LoadingStatus mLoadingStatus; std::list mAddedModerators; std::list mRemovedModerators; diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h index 63e5907d6..cd051ccee 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h @@ -45,6 +45,12 @@ public: uint32_t feedId() const { return mFeedId; } protected: + enum LoadingStatus { + NO_DATA = 0x00, + HAS_DATA = 0x01, + FILLED = 0x02 + }; + /* load group data */ void requestGroup(); From 5e4249663e6bb4001accf8bb63b2b6a4fa8cab4d Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Nov 2025 18:25:01 +0100 Subject: [PATCH 135/147] fixed GxsForumMsgItem --- .../src/gui/feeds/GxsForumMsgItem.cpp | 231 +++++++----------- .../src/gui/feeds/GxsForumMsgItem.h | 26 +- 2 files changed, 98 insertions(+), 159 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index 2b56e9ba6..1d37e48b1 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -48,56 +48,88 @@ GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const mMessage.mMeta.mMsgId = messageId; // useful for uniqueIdentifier() before the post is actually loaded mMessage.mMeta.mGroupId = groupId; + mLoadingStatus = NO_DATA; + mLoadingGroup = false; mLoadingMessage = false; mLoadingSetAsRead = false; - mLoadingParentMessage = false; setup(); - - requestGroup(); - requestMessage(); } -GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : - GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) +// GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : +// GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) +// { +// #ifdef DEBUG_ITEM +// std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; +// std::cerr << std::endl; +// #endif +// +// setup(); +// +// setGroup(group, false); +// setMessage(post); +// } + +// GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : +// GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) +// { +// #ifdef DEBUG_ITEM +// std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; +// std::cerr << std::endl; +// #endif +// +// setup(); +// +// requestGroup(); +// setMessage(post); +// } + +void GxsForumMsgItem::paintEvent(QPaintEvent *e) { -#ifdef DEBUG_ITEM - std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; - std::cerr << std::endl; -#endif + /* This method employs a trick to trigger a deferred loading. The post and group is requested only + * when actually displayed on the screen. */ - setup(); + if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull() && !mMessage.mMeta.mMsgId.isNull()) + mLoadingStatus = HAS_DATA; - setGroup(group, false); - setMessage(post); -} + if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) + requestGroup(); -GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : - GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) -{ -#ifdef DEBUG_ITEM - std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; - std::cerr << std::endl; -#endif + if(mMessage.mMeta.mMsgId.isNull() && !mLoadingMessage) + requestMessage(); - setup(); + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; - requestGroup(); - setMessage(post); + case HAS_DATA: + fillGroup(); + fillMessage(); + + if(!mParentMessage.mMeta.mMsgId.isNull()) + fillParentMessage(); + + mLoadingStatus = FILLED; + break; + } + + GxsFeedItem::paintEvent(e) ; } GxsForumMsgItem::~GxsForumMsgItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( (mLoadingGroup || mLoadingMessage || mLoadingSetAsRead || mLoadingParentMessage) + while( (mLoadingGroup || mLoadingMessage || mLoadingSetAsRead) && std::chrono::steady_clock::now() < timeout) { RsDbg() << __PRETTY_FUNCTION__ << " is Waiting for " << (mLoadingGroup ? "Group " : "") << (mLoadingMessage ? "Message " : "") - << (mLoadingParentMessage ? "Parent message " : "") << (mLoadingSetAsRead ? "Set as read" : "") << "loading." << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -113,7 +145,6 @@ void GxsForumMsgItem::setup() setAttribute(Qt::WA_DeleteOnClose, true); - mInFill = false; mCloseOnRead = false; /* clear ui */ @@ -144,41 +175,6 @@ void GxsForumMsgItem::setup() ui->parentFrame->hide(); } -bool GxsForumMsgItem::setGroup(const RsGxsForumGroup &group, bool doFill) -{ - if (groupId() != group.mMeta.mGroupId) { - std::cerr << "GxsForumMsgItem::setGroup() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - - mGroup = group; - - if (doFill) - fillGroup(); - - return true; -} - -bool GxsForumMsgItem::setMessage(const RsGxsForumMsg &msg, bool doFill) -{ - if (groupId() != msg.mMeta.mGroupId || messageId() != msg.mMeta.mMsgId) { - std::cerr << "GxsForumMsgItem::setPost() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - - mMessage = msg; - - if(! mMessage.mMeta.mParentId.isNull()) - loadParentMessage(mMessage.mMeta.mParentId); - - if(doFill) - fillMessage(); - - return true; -} - QString GxsForumMsgItem::groupName() { return QString::fromUtf8(mGroup.mMeta.mGroupName.c_str()); @@ -221,7 +217,7 @@ void GxsForumMsgItem::loadGroup() * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - setGroup(group); + mGroup = group; mLoadingGroup = false; }, this ); @@ -244,93 +240,50 @@ void GxsForumMsgItem::loadMessage() std::cerr << "Retrieving post data for post " << mThreadId << std::endl; #endif - std::vector msgs; - const std::list forumIds = { groupId() }; + auto getMessageData = [](const RsGxsGroupId& gid,const RsGxsMessageId& msg_id,RsGxsForumMsg& msg) -> bool + { + std::vector msgs; - if(!rsGxsForums->getForumContent(groupId(),std::set( { messageId() } ),msgs)) - { - std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting data"; - std::cerr << std::endl; + if(!rsGxsForums->getForumContent(gid,std::set( { msg_id } ),msgs)) + return false; + + if (msgs.size() != 1) + return false; + + msg = msgs[0]; + + return true; + }; + + RsGxsForumMsg msg,parent_msg; + + if(!getMessageData(groupId(),messageId(),msg)) + { + std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting message data"; mLoadingMessage = false; return; - } + } + // now load the parent message. If not found, it's not a problem. - if (msgs.size() != 1) - { - std::cerr << "GxsForumMsgItem::loadMessage() Wrong number of Items"; - std::cerr << std::endl; - mLoadingMessage = false; - return; - } - RsGxsForumMsg msg(msgs[0]); + if(!msg.mMeta.mParentId.isNull() && !getMessageData(groupId(),msg.mMeta.mParentId,parent_msg)) + std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting parent message data. Maybe the parent msg is not available."; - RsQThreadUtils::postToObject( [msg,this]() + RsQThreadUtils::postToObject( [msg,parent_msg,this]() { /* Here it goes any code you want to be executed on the Qt Gui * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - setMessage(msg); + mMessage = msg; + mParentMessage = parent_msg; mLoadingMessage = false; }, this ); }); } -void GxsForumMsgItem::loadParentMessage(const RsGxsMessageId& parent_msg) -{ -#ifdef DEBUG_ITEM - std::cerr << "GxsForumMsgItem::loadParentMessage()"; - std::cerr << std::endl; -#endif - mLoadingParentMessage = true; - - RsThread::async([parent_msg,this]() - { - // 1 - get group data - -#ifdef DEBUG_FORUMS - std::cerr << "Retrieving post data for post " << mThreadId << std::endl; -#endif - - std::vector msgs; - const std::list forumIds = { groupId() }; - - if(!rsGxsForums->getForumContent(groupId(),std::set( { parent_msg } ),msgs)) - { - std::cerr << "GxsForumMsgItem::loadMessage() ERROR getting data"; - std::cerr << std::endl; - mLoadingParentMessage = false; - return; - } - - if (msgs.size() != 1) - { - std::cerr << "GxsForumMsgItem::loadMessage() Wrong number of Items"; - std::cerr << std::endl; - mLoadingParentMessage = false; - return; - } - RsGxsForumMsg msg(msgs[0]); - - RsQThreadUtils::postToObject( [msg,this]() - { - /* Here it goes any code you want to be executed on the Qt Gui - * thread, for example to update the data model with new information - * after a blocking call to RetroShare API complete */ - - mParentMessage = msg; - fillParentMessage(); - - mLoadingParentMessage = false; - - }, this ); - }); -} void GxsForumMsgItem::fillParentMessage() { - mInFill = true; - ui->parentFrame->hide(); RetroShareLink linkParent = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mParentMessage.mMeta.mGroupId, mParentMessage.mMeta.mMsgId, QString::fromUtf8(mParentMessage.mMeta.mMsgName.c_str())); @@ -347,8 +300,6 @@ void GxsForumMsgItem::fillParentMessage() pixmap = GxsIdDetails::makeDefaultIcon(mParentMessage.mMeta.mAuthorId,GxsIdDetails::SMALL); ui->parentAvatar->setPixmap(pixmap); - - mInFill = false; } void GxsForumMsgItem::fillMessage() { @@ -357,8 +308,6 @@ void GxsForumMsgItem::fillMessage() std::cerr << std::endl; #endif - mInFill = true; - if(!mIsHome && mCloseOnRead && !IS_MSG_NEW(mMessage.mMeta.mMsgStatus)) removeItem(); @@ -400,21 +349,15 @@ void GxsForumMsgItem::fillMessage() ui->clearButton->setEnabled(false); ui->clearButton->hide(); } - - mInFill = false; } void GxsForumMsgItem::fillGroup() { - mInFill = true; - ui->unsubscribeButton->setEnabled(IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroup.mMeta.mSubscribeFlags)) ; if (IS_GROUP_PUBLISHER(mGroup.mMeta.mSubscribeFlags)) ui->iconLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/forums.png")); else ui->iconLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/forums-default.png")); - - mInFill = false; } void GxsForumMsgItem::fillExpandFrame() @@ -508,10 +451,6 @@ void GxsForumMsgItem::unsubscribeForum() void GxsForumMsgItem::setAsRead(bool doUpdate) { - if (mInFill) { - return; - } - mCloseOnRead = false; mLoadingSetAsRead = true; diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h index ec933d96e..8d882785e 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h @@ -36,22 +36,18 @@ class GxsForumMsgItem : public GxsFeedItem public: GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate); - GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); - GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); - virtual ~GxsForumMsgItem(); - bool setGroup(const RsGxsForumGroup &group, bool doFill = true); - bool setMessage(const RsGxsForumMsg &msg, bool doFill = true); + //GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); + //GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); + virtual ~GxsForumMsgItem(); uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumMsgItem " + messageId().toStdString()) ; } protected: - /* FeedItem */ + virtual void paintEvent(QPaintEvent *e) override; + /* FeedItem */ virtual void doExpand(bool open) override; virtual void expandFill(bool first) override; - /* load message data */ - virtual void loadParentMessage(const RsGxsMessageId &parent_msg); - /* GxsGroupFeedItem */ virtual QString groupName() override; virtual void loadGroup() override; @@ -77,6 +73,7 @@ signals: private: void setup(); + void fillGroup(); void fillMessage(); void fillParentMessage(); @@ -85,16 +82,19 @@ private: void setAsRead(bool doUpdate); private: - bool mInFill; bool mCloseOnRead; + + LoadingStatus mLoadingStatus; + bool mLoadingMessage; - bool mLoadingParentMessage; bool mLoadingGroup; bool mLoadingSetAsRead; + bool mHasParentMessage; // set to false when we see that the msg does not have a parent. + RsGxsForumGroup mGroup; - RsGxsForumMsg mMessage; - RsGxsForumMsg mParentMessage; + RsGxsForumMsg mMessage; + RsGxsForumMsg mParentMessage; /** Qt Designer generated object */ Ui::GxsForumMsgItem *ui; From 6b88c9a49e0569d002721df6dbadca324b2851a8 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 2 Nov 2025 18:36:23 +0100 Subject: [PATCH 136/147] fixed PostedGroupItem --- .../src/gui/feeds/PostedGroupItem.cpp | 72 +++++++++++-------- .../src/gui/feeds/PostedGroupItem.h | 16 ++--- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 34fd378f2..2a45fcf0a 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -35,29 +35,55 @@ PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate) : GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsPosted, autoUpdate) { - mIsLoadingGroup = false; - setup(); + mLoadingGroup = false; + mLoadingStatus = NO_DATA; - requestGroup(); + setup(); } -PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsPostedGroup &group, bool isHome, bool autoUpdate) : - GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsPosted, autoUpdate) +//PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsPostedGroup &group, bool isHome, bool autoUpdate) : +// GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsPosted, autoUpdate) +//{ +// mIsLoadingGroup = false; +// setup(); +// +// setGroup(group); +//} + +void PostedGroupItem::paintEvent(QPaintEvent *e) { - mIsLoadingGroup = false; - setup(); + /* This method employs a trick to trigger a deferred loading. The post and group is requested only + * when actually displayed on the screen. */ - setGroup(group); + if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = HAS_DATA; + + if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) + loadGroup(); + + switch(mLoadingStatus) + { + case FILLED: + case NO_DATA: + default: + break; + + case HAS_DATA: + fill(); + mLoadingStatus = FILLED; + break; + } + + GxsGroupFeedItem::paintEvent(e) ; } - PostedGroupItem::~PostedGroupItem() { auto timeout = std::chrono::steady_clock::now() + std::chrono::milliseconds(GROUP_ITEM_LOADING_TIMEOUT_ms); - while( mIsLoadingGroup && std::chrono::steady_clock::now() < timeout) + while( mLoadingGroup && std::chrono::steady_clock::now() < timeout) { RsDbg() << __PRETTY_FUNCTION__ << " is Waiting " - << (mIsLoadingGroup ? "Group " : "") + << (mLoadingGroup ? "Group " : "") << "loading finished." << std::endl; std::this_thread::sleep_for(std::chrono::milliseconds(100)); @@ -91,23 +117,9 @@ void PostedGroupItem::setup() ui->expandFrame->hide(); } -bool PostedGroupItem::setGroup(const RsPostedGroup &group) -{ - if (groupId() != group.mMeta.mGroupId) { - std::cerr << "PostedGroupItem::setContent() - Wrong id, cannot set post"; - std::cerr << std::endl; - return false; - } - - mGroup = group; - fill(); - - return true; -} - void PostedGroupItem::loadGroup() { - mIsLoadingGroup = true; + mLoadingGroup = true; RsThread::async([this]() { @@ -123,7 +135,7 @@ void PostedGroupItem::loadGroup() if(!rsPosted->getBoardsInfo(groupIds,groups)) { RsErr() << "GxsPostedGroupItem::loadGroup() ERROR getting data" << std::endl; - mIsLoadingGroup = false; + mLoadingGroup = false; return; } @@ -131,7 +143,7 @@ void PostedGroupItem::loadGroup() { std::cerr << "GxsPostedGroupItem::loadGroup() Wrong number of Items"; std::cerr << std::endl; - mIsLoadingGroup = false; + mLoadingGroup = false; return; } RsPostedGroup group(groups[0]); @@ -142,8 +154,8 @@ void PostedGroupItem::loadGroup() * thread, for example to update the data model with new information * after a blocking call to RetroShare API complete */ - setGroup(group); - mIsLoadingGroup = false; + mGroup = group; + mLoadingGroup = false; }, this ); }); diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.h b/retroshare-gui/src/gui/feeds/PostedGroupItem.h index fa8fe65d6..835c7ce19 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.h +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.h @@ -37,21 +37,20 @@ class PostedGroupItem : public GxsGroupFeedItem public: /** Default Constructor */ PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, bool isHome, bool autoUpdate); - PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsPostedGroup &group, bool isHome, bool autoUpdate); - ~PostedGroupItem(); - - bool setGroup(const RsPostedGroup &group); + virtual ~PostedGroupItem() override; uint64_t uniqueIdentifier() const override { return hash_64bits("PostedGroupItem " + groupId().toStdString()) ; } protected: + virtual void paintEvent(QPaintEvent *e) override; + /* FeedItem */ - virtual void doExpand(bool open); + virtual void doExpand(bool open) override; /* GxsGroupFeedItem */ - virtual QString groupName(); + virtual QString groupName() override; virtual void loadGroup() override; - virtual RetroShareLink::enumType getLinkType() { return RetroShareLink::TYPE_UNKNOWN; } + virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_UNKNOWN; } private slots: void toggle() override; @@ -63,7 +62,8 @@ private: private: RsPostedGroup mGroup; - bool mIsLoadingGroup; + bool mLoadingGroup; + LoadingStatus mLoadingStatus; /** Qt Designer generated object */ Ui::PostedGroupItem *ui; From 8a23d378706f539d7461dcdf5d50dc08444bc468 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Nov 2025 16:32:49 +0100 Subject: [PATCH 137/147] removed some dead code --- .../src/gui/feeds/GxsChannelGroupItem.cpp | 9 ------ .../src/gui/feeds/GxsChannelPostItem.cpp | 13 --------- .../src/gui/feeds/GxsChannelPostItem.h | 2 -- .../src/gui/feeds/GxsForumMsgItem.cpp | 28 ------------------- .../src/gui/feeds/GxsForumMsgItem.h | 3 -- .../src/gui/feeds/PostedGroupItem.cpp | 9 ------ 6 files changed, 64 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index 510302ae2..0e3d88023 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -44,15 +44,6 @@ GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId addEventHandler(); } -//GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelGroup &group, bool isHome, bool autoUpdate) : -// GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsGxsChannels, autoUpdate) -//{ -// mIsLoading = false; -// setup(); -// setGroup(group); -// addEventHandler(); -//} - void GxsChannelGroupItem::addEventHandler() { mEventHandlerId = 0; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index bc5f385d7..cc5390782 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -197,19 +197,6 @@ void GxsChannelPostItem::setup() ui->expandFrame->hide(); } - -QString GxsChannelPostItem::getTitleLabel() -{ - return QString::fromUtf8(mPost.mMeta.mMsgName.c_str()); -} - -QString GxsChannelPostItem::getMsgLabel() -{ - //return RsHtml().formatText(NULL, QString::fromUtf8(mPost.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS); - // Disabled, because emoticon replacement kills performance. - return QString::fromUtf8(mPost.mMsg.c_str()); -} - QString GxsChannelPostItem::groupName() { return QString::fromUtf8(mGroupMeta.mGroupName.c_str()); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index fd5ccfd86..cdcd56088 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -58,8 +58,6 @@ public: protected: //void setFileCleanUpWarning(uint32_t time_left); - QString getTitleLabel(); - QString getMsgLabel(); const std::list &getFileItems() {return mFileItems; } bool isUnread() const ; diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index 1d37e48b1..1ce7d0093 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -57,34 +57,6 @@ GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const setup(); } -// GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : -// GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) -// { -// #ifdef DEBUG_ITEM -// std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; -// std::cerr << std::endl; -// #endif -// -// setup(); -// -// setGroup(group, false); -// setMessage(post); -// } - -// GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate) : -// GxsFeedItem(feedHolder, feedId, post.mMeta.mGroupId, post.mMeta.mMsgId, isHome, rsGxsForums, autoUpdate) -// { -// #ifdef DEBUG_ITEM -// std::cerr << "GxsForumMsgItem::GxsForumMsgItem() Direct Load"; -// std::cerr << std::endl; -// #endif -// -// setup(); -// -// requestGroup(); -// setMessage(post); -// } - void GxsForumMsgItem::paintEvent(QPaintEvent *e) { /* This method employs a trick to trigger a deferred loading. The post and group is requested only diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h index 8d882785e..e6dc533d5 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.h @@ -37,8 +37,6 @@ class GxsForumMsgItem : public GxsFeedItem public: GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate); - //GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumGroup &group, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); - //GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsForumMsg &post, bool isHome, bool autoUpdate); virtual ~GxsForumMsgItem(); uint64_t uniqueIdentifier() const override { return hash_64bits("GxsForumMsgItem " + messageId().toStdString()) ; } @@ -52,7 +50,6 @@ protected: virtual QString groupName() override; virtual void loadGroup() override; virtual RetroShareLink::enumType getLinkType() override { return RetroShareLink::TYPE_FORUM; } - //virtual bool isLoading(); /* GxsFeedItem */ virtual QString messageName() override; diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 2a45fcf0a..56d3d4d09 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -41,15 +41,6 @@ PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const setup(); } -//PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const RsPostedGroup &group, bool isHome, bool autoUpdate) : -// GxsGroupFeedItem(feedHolder, feedId, group.mMeta.mGroupId, isHome, rsPosted, autoUpdate) -//{ -// mIsLoadingGroup = false; -// setup(); -// -// setGroup(group); -//} - void PostedGroupItem::paintEvent(QPaintEvent *e) { /* This method employs a trick to trigger a deferred loading. The post and group is requested only From 6a0dda8cf7d461963a508f64defab19acee38775 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 3 Nov 2025 16:38:57 +0100 Subject: [PATCH 138/147] left test code template in place --- build_scripts/OBS | 2 +- libretroshare | 2 +- openpgpsdk | 2 +- retroshare-gui/src/gui/NewsFeed.cpp | 8 ++++++++ supportlibs/cmark | 2 +- supportlibs/libsam3 | 2 +- supportlibs/rapidjson | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/build_scripts/OBS b/build_scripts/OBS index 0a3997cc1..9dd9d7f94 160000 --- a/build_scripts/OBS +++ b/build_scripts/OBS @@ -1 +1 @@ -Subproject commit 0a3997cc1355b2c848161dca015b7e2df039707b +Subproject commit 9dd9d7f94a600e8c8478887a4f7784fdc3294034 diff --git a/libretroshare b/libretroshare index da6b849a4..a82f87cc9 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit da6b849a41f3cf6e60f6f76e1f3c4463876a8741 +Subproject commit a82f87cc935694e903bc5b99768d4390d421fb14 diff --git a/openpgpsdk b/openpgpsdk index 178aa8ebc..634f701d4 160000 --- a/openpgpsdk +++ b/openpgpsdk @@ -1 +1 @@ -Subproject commit 178aa8ebcef47e3271d5a5ca5c07e45d3b71c81d +Subproject commit 634f701d44585e4648b898be99d26e288db1881e diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index dc0834e71..de2767286 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -512,6 +512,14 @@ void NewsFeed::handleSecurityEvent(std::shared_ptr event) void NewsFeed::testFeeds(uint /*notifyFlags*/) { + auto feedItem = new GxsChannelPostItem(instance, + NEWSFEED_CHANNELNEWLIST, + RsGxsGroupId ("00000000000000000000000000000000"), + RsGxsMessageId("0000000000000000000000000000000000000000") + , false, true); + + instance->addFeedItem(feedItem); + #ifdef TO_REMOVE if (!instance) { return; diff --git a/supportlibs/cmark b/supportlibs/cmark index 3460cd809..b9c7a496b 160000 --- a/supportlibs/cmark +++ b/supportlibs/cmark @@ -1 +1 @@ -Subproject commit 3460cd809b6dd311b58e92733ece2fc956224fd2 +Subproject commit b9c7a496ba7dd9c3495bae2ff2855899e47b245d diff --git a/supportlibs/libsam3 b/supportlibs/libsam3 index f90555ba4..8623304b6 160000 --- a/supportlibs/libsam3 +++ b/supportlibs/libsam3 @@ -1 +1 @@ -Subproject commit f90555ba4d6f9fadb6f0fbb1e2253e13557aad34 +Subproject commit 8623304b62294dafbe477573f321a464fef721dd diff --git a/supportlibs/rapidjson b/supportlibs/rapidjson index 24b5e7a8b..f54b0e47a 160000 --- a/supportlibs/rapidjson +++ b/supportlibs/rapidjson @@ -1 +1 @@ -Subproject commit 24b5e7a8b27f42fa16b96fc70aade9106cf7102f +Subproject commit f54b0e47a08782a6131cc3d60f94d038fa6e0a51 From c0c9684adf24ffb516c1b5e2c2b1fb750ab63b50 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 4 Nov 2025 21:27:21 +0100 Subject: [PATCH 139/147] fixed forum msg item loading --- retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index 1ce7d0093..e675c7714 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -45,9 +45,6 @@ GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) : GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsGxsForums, autoUpdate) { - mMessage.mMeta.mMsgId = messageId; // useful for uniqueIdentifier() before the post is actually loaded - mMessage.mMeta.mGroupId = groupId; - mLoadingStatus = NO_DATA; mLoadingGroup = false; @@ -160,14 +157,13 @@ void GxsForumMsgItem::loadGroup() { // 1 - get group data -#ifdef DEBUG_FORUMS - std::cerr << "Retrieving post data for post " << mThreadId << std::endl; +#ifndef DEBUG_FORUMS + std::cerr << "Retrieving forum group data for forum " << groupId() << std::endl; #endif std::vector groups; - const std::list forumIds = { groupId() }; - if(!rsGxsForums->getForumsInfo(forumIds,groups)) + if(!rsGxsForums->getForumsInfo({ groupId() },groups)) { RsErr() << "GxsForumGroupItem::loadGroup() ERROR getting data" << std::endl; mLoadingGroup = false; From 89cb02528cf21285d500549b5f6403c1fd6701f2 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 5 Nov 2025 20:30:26 +0100 Subject: [PATCH 140/147] changed enum for data loading in feed items to some more specific name --- .../src/gui/feeds/ChannelsCommentsItem.cpp | 14 +++++++------- .../src/gui/feeds/GxsChannelGroupItem.cpp | 16 ++++++++-------- .../src/gui/feeds/GxsChannelPostItem.cpp | 14 +++++++------- .../src/gui/feeds/GxsForumGroupItem.cpp | 18 +++++++++--------- .../src/gui/feeds/GxsForumMsgItem.cpp | 14 +++++++------- .../src/gui/feeds/PostedGroupItem.cpp | 14 +++++++------- retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h | 6 +++--- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp index 5c112689a..a7bd64bc6 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp @@ -53,7 +53,7 @@ ChannelsCommentsItem::ChannelsCommentsItem(FeedHolder *feedHolder, uint32_t feed GxsFeedItem(feedHolder, feedId, groupId, commentId, isHome, rsGxsChannels, autoUpdate), // this one should be in GxsFeedItem mThreadId(threadId) { - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; mLoadingComment = false; mLoadingGroup = false; mLoadingMessage = false; @@ -66,8 +66,8 @@ void ChannelsCommentsItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroupMeta.mGroupId.isNull() && !mComment.mMeta.mMsgId.isNull()) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroupMeta.mGroupId.isNull() && !mComment.mMeta.mMsgId.isNull()) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroupMeta.mGroupId.isNull() && !mLoadingGroup) loadGroupData(); @@ -80,13 +80,13 @@ void ChannelsCommentsItem::paintEvent(QPaintEvent *e) switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fill(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp index 0e3d88023..56c10508a 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp @@ -37,7 +37,7 @@ GxsChannelGroupItem::GxsChannelGroupItem(FeedHolder *feedHolder, uint32_t feedId GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsChannels, autoUpdate) { mLoadingGroup = false; - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; setup(); requestGroup(); @@ -61,7 +61,7 @@ void GxsChannelGroupItem::addEventHandler() case RsChannelEventCode::SUBSCRIBE_STATUS_CHANGED: case RsChannelEventCode::UPDATED_CHANNEL: case RsChannelEventCode::RECEIVED_PUBLISH_KEY: - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; mGroup = RsGxsChannelGroup(); break; default: @@ -76,22 +76,22 @@ void GxsChannelGroupItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) loadGroup(); switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fill(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index cc5390782..abd10ed2b 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -57,7 +57,7 @@ GxsChannelPostItem::GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, if(older_versions.find(messageId) == older_versions.end()) v.push_back(messageId); - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; mLoadingMessage = false; mLoadingGroup = false; @@ -70,8 +70,8 @@ void GxsChannelPostItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroupMeta.mGroupId.isNull() && !mPost.mMeta.mMsgId.isNull() ) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroupMeta.mGroupId.isNull() && !mPost.mMeta.mMsgId.isNull() ) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroupMeta.mGroupId.isNull() && !mLoadingGroup) requestGroup(); @@ -81,14 +81,14 @@ void GxsChannelPostItem::paintEvent(QPaintEvent *e) switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fill(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp index d338ebb57..7e0fdca71 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp @@ -35,7 +35,7 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, co GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsGxsForums, autoUpdate) { mLoadingGroup = false; - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; setup(); addEventHandler(); } @@ -46,7 +46,7 @@ GxsForumGroupItem::GxsForumGroupItem(FeedHolder *feedHolder, uint32_t feedId, co mRemovedModerators(removed_moderators) { mLoadingGroup = false; - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; setup(); addEventHandler(); } @@ -68,7 +68,7 @@ void GxsForumGroupItem::addEventHandler() case RsForumEventCode::SUBSCRIBE_STATUS_CHANGED: case RsForumEventCode::UPDATED_FORUM: case RsForumEventCode::MODERATOR_LIST_CHANGED: - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; mGroup = RsGxsForumGroup(); break; default: @@ -83,22 +83,22 @@ void GxsForumGroupItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) loadGroup(); switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fill(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp index e675c7714..9e07c6de8 100644 --- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp @@ -45,7 +45,7 @@ GxsForumMsgItem::GxsForumMsgItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsGroupId &groupId, const RsGxsMessageId &messageId, bool isHome, bool autoUpdate) : GxsFeedItem(feedHolder, feedId, groupId, messageId, isHome, rsGxsForums, autoUpdate) { - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; mLoadingGroup = false; mLoadingMessage = false; @@ -59,8 +59,8 @@ void GxsForumMsgItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull() && !mMessage.mMeta.mMsgId.isNull()) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroup.mMeta.mGroupId.isNull() && !mMessage.mMeta.mMsgId.isNull()) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) requestGroup(); @@ -70,19 +70,19 @@ void GxsForumMsgItem::paintEvent(QPaintEvent *e) switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fillGroup(); fillMessage(); if(!mParentMessage.mMeta.mMsgId.isNull()) fillParentMessage(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp index 56d3d4d09..e4e416faa 100644 --- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp +++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp @@ -36,7 +36,7 @@ PostedGroupItem::PostedGroupItem(FeedHolder *feedHolder, uint32_t feedId, const GxsGroupFeedItem(feedHolder, feedId, groupId, isHome, rsPosted, autoUpdate) { mLoadingGroup = false; - mLoadingStatus = NO_DATA; + mLoadingStatus = LOADING_STATUS_NO_DATA; setup(); } @@ -46,22 +46,22 @@ void PostedGroupItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != FILLED && !mGroup.mMeta.mGroupId.isNull()) - mLoadingStatus = HAS_DATA; + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroup.mMeta.mGroupId.isNull()) + mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroup.mMeta.mGroupId.isNull() && !mLoadingGroup) loadGroup(); switch(mLoadingStatus) { - case FILLED: - case NO_DATA: + case LOADING_STATUS_FILLED: + case LOADING_STATUS_NO_DATA: default: break; - case HAS_DATA: + case LOADING_STATUS_HAS_DATA: fill(); - mLoadingStatus = FILLED; + mLoadingStatus = LOADING_STATUS_FILLED; break; } diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h index cd051ccee..9bb21b6d0 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h +++ b/retroshare-gui/src/gui/gxs/GxsGroupFeedItem.h @@ -46,9 +46,9 @@ public: protected: enum LoadingStatus { - NO_DATA = 0x00, - HAS_DATA = 0x01, - FILLED = 0x02 + LOADING_STATUS_NO_DATA = 0x00, + LOADING_STATUS_HAS_DATA = 0x01, + LOADING_STATUS_FILLED = 0x02 }; /* load group data */ From 82215711c2e732f24b810e7a3913a848d44b4054 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 7 Nov 2025 10:15:10 +0100 Subject: [PATCH 141/147] fixed arrow problem in sync time menu --- retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp index 67f9d55df..da745b122 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupFrameDialog.cpp @@ -484,7 +484,7 @@ void GxsGroupFrameDialog::groupTreeCustomPopupMenu(QPoint point) actnn = ctxMenu2->addAction(tr("1 year" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 365)) ; if(current_sync_time == 365) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} actnn = ctxMenu2->addAction(tr("3 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1095)) ; if(current_sync_time ==1095) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} actnn = ctxMenu2->addAction(tr("5 years" ),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant(1825)) ; if(current_sync_time ==1825) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} - actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setSyncPostsDelay())); actnn->setData(QVariant( 0)) ; if(current_store_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} + actnn = ctxMenu2->addAction(tr("Indefinitly"),this,SLOT(setSyncPostsDelay())) ; actnn->setData(QVariant( 0)) ; if(current_sync_time == 0) { actnn->setEnabled(false);actnn->setIcon(FilesDefs::getIconFromQtResourcePath(":/images/start.png"));} ctxMenu2->setEnabled(isSubscribed); ctxMenu2 = contextMnu.addMenu(tr("Store posts for at most...")) ; From 0502dba2e6894edd47490711fdf697748a3190fd Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 7 Nov 2025 14:26:19 +0100 Subject: [PATCH 142/147] fixed missing link in ChannelsCommentsItem --- .../src/gui/feeds/ChannelsCommentsItem.cpp | 67 +-- .../src/gui/feeds/ChannelsCommentsItem.ui | 548 +++++++++--------- 2 files changed, 300 insertions(+), 315 deletions(-) diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp index a7bd64bc6..88425975d 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp @@ -53,6 +53,9 @@ ChannelsCommentsItem::ChannelsCommentsItem(FeedHolder *feedHolder, uint32_t feed GxsFeedItem(feedHolder, feedId, groupId, commentId, isHome, rsGxsChannels, autoUpdate), // this one should be in GxsFeedItem mThreadId(threadId) { + mGroupMeta.mGroupId.clear(); // safety measure + mComment.mMeta.mMsgId.clear(); + mLoadingStatus = LOADING_STATUS_NO_DATA; mLoadingComment = false; mLoadingGroup = false; @@ -66,7 +69,7 @@ void ChannelsCommentsItem::paintEvent(QPaintEvent *e) /* This method employs a trick to trigger a deferred loading. The post and group is requested only * when actually displayed on the screen. */ - if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroupMeta.mGroupId.isNull() && !mComment.mMeta.mMsgId.isNull()) + if(mLoadingStatus != LOADING_STATUS_FILLED && !mGroupMeta.mGroupId.isNull() && !mComment.mMeta.mMsgId.isNull() && !mPost.mMeta.mMsgId.isNull()) mLoadingStatus = LOADING_STATUS_HAS_DATA; if(mGroupMeta.mGroupId.isNull() && !mLoadingGroup) @@ -328,60 +331,31 @@ void ChannelsCommentsItem::loadCommentData() void ChannelsCommentsItem::fill(bool missing_post) { #ifdef DEBUG_ITEM - std::cerr << "ChannelsCommentsItem::fill()"; - std::cerr << std::endl; + std::cerr << "ChannelsCommentsItem::fill()"; + std::cerr << std::endl; #endif - if (!mIsHome) - { - if (mCloseOnRead && !IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { - removeItem(); - } - //RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, groupName()); - //title += link.toHtml(); - //ui->titleLabel->setText(title); + if (mCloseOnRead && !IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { + removeItem(); + } - RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName()); + RetroShareLink grplink = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_CHANNEL, mGroupMeta.mGroupId, groupName()); + RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName()); - if(missing_post) - ui->subjectLabel->setText("[" + QObject::tr("Missing channel post")+"]"); - else - ui->subjectLabel->setText(msgLink.toHtml()); + if(missing_post) + ui->subjectLabel->setText("[" + QObject::tr("Missing channel post")+"]"); + else + ui->subjectLabel->setText(msgLink.toHtml()); - ui->readButton->hide(); + ui->readButton->hide(); - if (IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { - mCloseOnRead = true; - } - } - else - { - if(mPost.mMeta.mMsgId.isNull()) - ui->subjectLabel->setText("[" + QObject::tr("Missing channel post")+"]"); - else - ui->subjectLabel->setText(RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), 2)) ; + if (IS_MSG_NEW(mComment.mMeta.mMsgStatus)) { + mCloseOnRead = true; + } - /* disable buttons: deletion facility not enabled with cache services yet */ - ui->clearButton->setEnabled(false); - ui->clearButton->hide(); - ui->readAndClearButton->hide(); - ui->copyLinkButton->show(); - //ui->titleLabel->hide(); + ui->newCommentLabel->setText(groupName()+": "); - if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags)) - { - ui->readButton->setVisible(true); - - setReadStatus(IS_MSG_NEW(mComment.mMeta.mMsgStatus), IS_MSG_UNREAD(mComment.mMeta.mMsgStatus) || IS_MSG_NEW(mComment.mMeta.mMsgStatus)); - } - else - { - ui->readButton->setVisible(false); - } - - mCloseOnRead = false; - } uint32_t autorized_lines = (int)floor( (ui->avatarLabel->height() - ui->button_HL->sizeHint().height()) / QFontMetricsF(ui->subjectLabel->font()).height()); @@ -396,7 +370,6 @@ void ChannelsCommentsItem::fill(bool missing_post) if(idDetails.mAvatar.mSize == 0 || !GxsIdDetails::loadPixmapFromData(idDetails.mAvatar.mData, idDetails.mAvatar.mSize, pixmap,GxsIdDetails::SMALL)) pixmap = GxsIdDetails::makeDefaultIcon(mComment.mMeta.mAuthorId,GxsIdDetails::LARGE); ui->avatarLabel->setPixmap(pixmap); - } QString ChannelsCommentsItem::messageName() diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.ui b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.ui index db4ac6b1a..c5643f7de 100644 --- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.ui +++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.ui @@ -50,202 +50,6 @@ 3 - - - - 8 - - - - - - - I like this - - - - - - - - - - - 75 - true - - - - 0 - - - - - - - I dislike this - - - - - - - - - - - - - 24 - 16777215 - - - - Qt::NoFocus - - - Toggle Message Read Status - - - true - - - false - - - false - - - - - - - Avatar - - - - - - - - 0 - 0 - - - - - 12 - 75 - true - - - - New Comment - - - true - - - - - - - - 12 - 75 - true - - - - POST TITLE - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Copy RetroShare Link - - - - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Expand - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Set as read and remove item - - - - - - - - 0 - 0 - - - - Qt::NoFocus - - - Remove Item - - - - - @@ -257,79 +61,91 @@ - - - 3 - - - 0 - - - 9 - - - 0 - - - 3 - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 288 - 17 - - - + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + New Comment from + + + true + + + + + + + + 0 + 0 + + + + + 11 + 75 + true + true + + + + Name + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 288 + 17 + + + + + + + + + 75 + true + + + + DateTime + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + - - - - - 75 - true - - - - DateTime - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - - - - - 0 - 0 - - - - - 11 - 75 - true - true - - - - Name - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - - + @@ -360,6 +176,202 @@ + + + + 8 + + + + + + + I like this + + + + + + + + + + + 75 + true + + + + 0 + + + + + + + I dislike this + + + + + + + + + + + + + 24 + 16777215 + + + + Qt::NoFocus + + + Toggle Message Read Status + + + true + + + false + + + false + + + + + + + Avatar + + + + + + + + 0 + 0 + + + + + 12 + 75 + true + + + + New Comment + + + true + + + + + + + + 12 + 75 + true + + + + POST TITLE + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Copy RetroShare Link + + + + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Expand + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Set as read and remove item + + + + + + + + 0 + 0 + + + + Qt::NoFocus + + + Remove Item + + + + + From ae5f91700e3d68d4c68c473f6e7faf59ac18193f Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 7 Nov 2025 23:39:04 +0100 Subject: [PATCH 143/147] updated libretroshare submodule to latest commit --- libretroshare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare b/libretroshare index da6b849a4..a82f87cc9 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit da6b849a41f3cf6e60f6f76e1f3c4463876a8741 +Subproject commit a82f87cc935694e903bc5b99768d4390d421fb14 From 72ae5b74acef338944faa2aacae9dc0867a9e85e Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 10 Nov 2025 18:43:22 +0100 Subject: [PATCH 144/147] added more feed tests --- retroshare-gui/src/gui/NewsFeed.cpp | 32 +++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index de2767286..d0c59168f 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -512,13 +512,33 @@ void NewsFeed::handleSecurityEvent(std::shared_ptr event) void NewsFeed::testFeeds(uint /*notifyFlags*/) { - auto feedItem = new GxsChannelPostItem(instance, - NEWSFEED_CHANNELNEWLIST, - RsGxsGroupId ("00000000000000000000000000000000"), - RsGxsMessageId("0000000000000000000000000000000000000000") - , false, true); + uint flags = Settings->getNewsFeedFlags(); - instance->addFeedItem(feedItem); + if (flags & RS_FEED_TYPE_PEER) + instance->addFeedItemIfUnique(new PeerItem(instance, NEWSFEED_PEERLIST, RsPeerId(""), PEER_TYPE_CONNECT, false), true); + + if (flags & RS_FEED_TYPE_MSG) + instance->addFeedItemIfUnique(new MsgItem(instance, NEWSFEED_MESSAGELIST, std::string(""), false), true); + + if (flags & RS_FEED_TYPE_CHANNEL){ + instance->addFeedItem(new GxsChannelGroupItem(instance, NEWSFEED_CHANNELNEWLIST, RsGxsGroupId(""), false, true)); + instance->addFeedItem(new GxsChannelPostItem(instance, NEWSFEED_CHANNELNEWLIST, RsGxsGroupId(""), RsGxsMessageId(""), false, true)); + instance->addFeedItem(new ChannelsCommentsItem(instance, NEWSFEED_CHANNELNEWLIST, RsGxsGroupId(""), RsGxsMessageId(""), RsGxsMessageId(""), false, true)); + } + + if(flags & RS_FEED_TYPE_FORUM){ + instance->addFeedItem(new GxsForumGroupItem(instance, NEWSFEED_NEW_FORUM, RsGxsGroupId(""), false, true)); + instance->addFeedItem(new GxsForumMsgItem(instance, NEWSFEED_NEW_FORUM, RsGxsGroupId(""), RsGxsMessageId(""), false, true )); + } + + if(flags & RS_FEED_TYPE_POSTED){ + instance->addFeedItem( new PostedGroupItem(instance, NEWSFEED_POSTEDNEWLIST, RsGxsGroupId(""), false, true)); + instance->addFeedItem( new PostedItem(instance, NEWSFEED_POSTEDMSGLIST, RsGxsGroupId(""), RsGxsMessageId(""), false, true)); + instance->addFeedItem( new BoardsCommentsItem(instance, NEWSFEED_POSTEDMSGLIST, RsGxsGroupId(""), RsGxsMessageId(""), false, true)); + } + + if (flags & RS_FEED_TYPE_CIRCLE) + instance->addFeedItemIfUnique(new GxsCircleItem(instance, NEWSFEED_CIRCLELIST, RsGxsCircleId(""), RsGxsId(""), RS_FEED_ITEM_CIRCLE_MEMB_JOIN),true);; #ifdef TO_REMOVE if (!instance) { From 24540db6aa8ef79d9bab9c466c3010dfeebd4a5b Mon Sep 17 00:00:00 2001 From: Passw Date: Wed, 12 Nov 2025 09:12:05 +0800 Subject: [PATCH 145/147] fix typo WindowsMSys2_InstallGuide.md complet complete --- build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md index a0d1b67b6..eba8edf19 100644 --- a/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md +++ b/build_scripts/Windows-msys2/WindowsMSys2_InstallGuide.md @@ -8,7 +8,7 @@ Requirements: about 12 GB of free space The resulting binary is a 32-bit build of Retroshare which will also work fine on a 64-bit system. -**If you want to make complet solution without debugging it, prefer to use \build_scripts\Windows-msys2\build.bat** +**If you want to make complete solution without debugging it, prefer to use \build_scripts\Windows-msys2\build.bat** This batch will install and build all for you. From 3385abfdc6900f6ecd1631d4d2ac6808e2e89952 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sat, 15 Nov 2025 15:21:04 +0100 Subject: [PATCH 146/147] Added comment for test feeds --- retroshare-gui/src/gui/NewsFeed.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index d0c59168f..c3be5a8a5 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -514,6 +514,8 @@ void NewsFeed::testFeeds(uint /*notifyFlags*/) { uint flags = Settings->getNewsFeedFlags(); + //For test your feed add valid ID's for RsGxsGroupId & RsGxsMessageId, else test feed will be not displayed + if (flags & RS_FEED_TYPE_PEER) instance->addFeedItemIfUnique(new PeerItem(instance, NEWSFEED_PEERLIST, RsPeerId(""), PEER_TYPE_CONNECT, false), true); From 0629113d16718265fdb796838d447bf74e23ed1f Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sat, 15 Nov 2025 16:58:34 +0100 Subject: [PATCH 147/147] Fix wording --- retroshare-gui/src/gui/settings/PeoplePage.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/settings/PeoplePage.ui b/retroshare-gui/src/gui/settings/PeoplePage.ui index a654f8a28..3fd4575f6 100644 --- a/retroshare-gui/src/gui/settings/PeoplePage.ui +++ b/retroshare-gui/src/gui/settings/PeoplePage.ui @@ -100,7 +100,7 @@ Qt::RightToLeft - Delete banned identities after (0 means indefinitely): + Delete banned identities after (0 means never): Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter