From 04636a8b6e8bfafe85ee2a3d04c0001cbc282507 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 1 Apr 2022 09:50:34 +0900 Subject: [PATCH 01/33] gui: newfriendlist: select row above when deleting profile --- retroshare-gui/src/gui/common/NewFriendList.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 893433469..ada487e9f 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -1015,6 +1015,15 @@ void NewFriendList::removeProfile() if ((QMessageBox::question(this, "RetroShare", tr("Do you want to remove this Friend?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes)) == QMessageBox::Yes) rsPeers->removeFriend(det.gpg_id); + QModelIndex index_to_remove = ui->peerTreeWidget->selectionModel()->selectedIndexes().first(); + // could be only one selected item + ui->peerTreeWidget->selectionModel()->select(index_to_remove, QItemSelectionModel::Clear); + // otherwise already at top + QModelIndex index_to_select = ui->peerTreeWidget->indexAbove(index_to_remove); + if (index_to_select.isValid()) { + ui->peerTreeWidget->selectionModel()->select(index_to_select, QItemSelectionModel::Select | QItemSelectionModel::Rows); + } + checkInternalData(true); } From 47fc1902af44b6ea62b50137c2e313fc97b1fb21 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Sat, 2 Apr 2022 22:19:28 +0900 Subject: [PATCH 02/33] gui: chat: add power to copy person's id to clipboard via rmb --- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 15 +++++++++++++++ retroshare-gui/src/gui/chat/ChatLobbyDialog.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 3b92883e8..0138e16f4 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" @@ -98,6 +99,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi distantChatAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/chats.png"), tr("Start private chat"), this); sendMessageAct = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/mail/write-mail.png"), tr("Send Message"), this); showInPeopleAct = new QAction(QIcon(), tr("Show author in people tab"), this); + copyIdAct = new QAction(QIcon(), tr("Copy ID to clipboard"), this); QActionGroup *sortgrp = new QActionGroup(this); actionSortByName = new QAction(QIcon(), tr("Sort by Name"), this); @@ -118,6 +120,7 @@ ChatLobbyDialog::ChatLobbyDialog(const ChatLobbyId& lid, QWidget *parent, Qt::Wi connect(voteNeutralAct, SIGNAL(triggered()), this, SLOT(voteParticipant())); connect(voteNegativeAct, SIGNAL(triggered()), this, SLOT(voteParticipant())); connect(showInPeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab())); + connect(copyIdAct, SIGNAL(triggered()), this, SLOT(copyId())); connect(actionSortByName, SIGNAL(triggered()), this, SLOT(sortParcipants())); connect(actionSortByActivity, SIGNAL(triggered()), this, SLOT(sortParcipants())); @@ -290,6 +293,7 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListaddAction(voteNeutralAct); contextMnu->addAction(voteNegativeAct); contextMnu->addAction(showInPeopleAct); + contextMnu->addAction(copyIdAct); distantChatAct->setEnabled(false); sendMessageAct->setEnabled(false); @@ -300,6 +304,7 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListsetEnabled(false); voteNegativeAct->setEnabled(false); showInPeopleAct->setEnabled(idList.count() == 1); + copyIdAct->setEnabled(idList.count() == 1); distantChatAct->setData(QVariant::fromValue(idList)); sendMessageAct->setData(QVariant::fromValue(idList)); @@ -311,6 +316,9 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListsetData(QString::fromStdString(gxsid.toStdString())); + if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid)) { distantChatAct->setEnabled(true); @@ -379,6 +387,13 @@ void ChatLobbyDialog::showInPeopleTab() idDialog->navigate(nickname); } +void ChatLobbyDialog::copyId() +{ + QAction* the_action = qobject_cast(sender()); + if (the_action) + QApplication::clipboard()->setText(the_action->data().toString()) ; +} + void ChatLobbyDialog::init(const ChatId &/*id*/, const QString &/*title*/) { ChatLobbyInfo linfo ; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 429a5bfb4..2f3ca0340 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -62,6 +62,7 @@ private slots: void inviteFriends() ; void filterChanged(const QString &text); void showInPeopleTab(); + void copyId(); void toggleWindowed(){setWindowed(!isWindowed());} void setWindowed(bool windowed); @@ -131,6 +132,7 @@ private: QWidgetAction *checkableAction; QAction *sendMessageAct; QAction *showInPeopleAct; + QAction *copyIdAct; GxsIdChooser *ownIdChooser ; //icons cache From 62ad4129144d5043525be445d99560180802b46a Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Sat, 2 Apr 2022 23:12:14 +0900 Subject: [PATCH 03/33] gui: chat: hide untouchable context menu actions for own identity --- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 0138e16f4..0f9f26240 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -319,6 +319,16 @@ void ChatLobbyDialog::initParticipantsContextMenu(QMenu *contextMnu, QListsetData(QString::fromStdString(gxsid.toStdString())); + if (!gxsid.isNull() && rsIdentity->isOwnId(gxsid)) + { + distantChatAct->setVisible(false); + sendMessageAct->setVisible(false); + muteAct->setVisible(false); + votePositiveAct->setVisible(false); + voteNeutralAct->setVisible(false); + voteNegativeAct->setVisible(false); + } + if(!gxsid.isNull() && !rsIdentity->isOwnId(gxsid)) { distantChatAct->setEnabled(true); From 9b9ad5666a56b429f81a94bd067f5a604445204d Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Sun, 3 Apr 2022 21:58:02 +0900 Subject: [PATCH 04/33] gui: make listwidget respect no_icons setting --- retroshare-gui/src/gui/MainWindow.cpp | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 974715d63..e1a89a303 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -1479,8 +1479,28 @@ void MainWindow::settingsChanged() ui->toolBarPage->setIconSize(QSize(toolSize,toolSize)); ui->toolBarAction->setToolButtonStyle(Settings->getToolButtonStyle()); ui->toolBarAction->setIconSize(QSize(toolSize,toolSize)); - int itemSize = Settings->getListItemIconSize(); - ui->listWidget->setIconSize(QSize(itemSize,itemSize)); + switch (Settings->RshareSettings::getToolButtonStyle()) + { + case Qt::ToolButtonTextOnly: + for (int i = 0; i < ui->listWidget->count(); ++i) + { + // annihilate icons + ui->listWidget->item(i)->setIcon(QIcon()); + } + break; + default: + QList pages = ui->stackPages->pages(); + int count = 0; + for (QList::iterator i = pages.begin(); i != pages.end(); ++i) { + ui->listWidget->item(count++)->setIcon((*i)->iconPixmap()); + } + // because 'exit' isn't a 'page', but only 'action' + ui->listWidget->item(count)->setIcon(QIcon(IMAGE_QUIT)) ; + + int itemSize = Settings->getListItemIconSize(); + ui->listWidget->setIconSize(QSize(itemSize,itemSize)); + break; + } } void MainWindow::externalLinkActivated(const QUrl &url) From 4f13ba089c5147eda087f0c30530d1ea7ddf6af3 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Tue, 5 Apr 2022 01:16:07 +0900 Subject: [PATCH 05/33] gui: chatlobbywidget: not expand public 'chat rooms' anymore at program start --- retroshare-gui/src/gui/ChatLobbyWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 0b5350110..da754f51c 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -170,7 +170,10 @@ ChatLobbyWidget::ChatLobbyWidget(QWidget *parent, Qt::WindowFlags flags) publicLobbyItem->setData(COLUMN_DATA, ROLE_PRIVACYLEVEL, CHAT_LOBBY_PRIVACY_LEVEL_PUBLIC); ui.lobbyTreeWidget->insertTopLevelItem(3, publicLobbyItem); - ui.lobbyTreeWidget->expandAll(); + ui.lobbyTreeWidget->expandItem(privateSubLobbyItem); + ui.lobbyTreeWidget->expandItem(publicSubLobbyItem); + ui.lobbyTreeWidget->expandItem(privateLobbyItem); + // ui.lobbyTreeWidget->expandItem(publicLobbyItem); ui.lobbyTreeWidget->setColumnHidden(COLUMN_NAME,false) ; ui.lobbyTreeWidget->setColumnHidden(COLUMN_USER_COUNT,true) ; ui.lobbyTreeWidget->setColumnHidden(COLUMN_TOPIC,true) ; From c38156ee82f520d20b4408ed6c29f7e6c8040ab8 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 8 Apr 2022 20:12:39 +0900 Subject: [PATCH 06/33] gui: make notify respect no_icons setting for listwidget --- retroshare-gui/src/gui/common/UserNotify.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/common/UserNotify.cpp b/retroshare-gui/src/gui/common/UserNotify.cpp index f712f4822..be669167d 100644 --- a/retroshare-gui/src/gui/common/UserNotify.cpp +++ b/retroshare-gui/src/gui/common/UserNotify.cpp @@ -179,7 +179,12 @@ void UserNotify::update() } if (mListItem) { - mListItem->setIcon(getMainIcon(count > 0)); + switch (Settings->RshareSettings::getToolButtonStyle()) { + case Qt::ToolButtonTextOnly: + break; + default: + mListItem->setIcon(getMainIcon(count > 0)); + } mListItem->setText((count > 0) ? QString("%1 (%2)").arg(mButtonText).arg(count) : mButtonText); QFont font = mListItem->font(); From 25837426a9a77f679afd55974af62bd048b751a9 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Tue, 12 Apr 2022 16:28:58 +0900 Subject: [PATCH 07/33] gui: statistics: set attribute Qt::WA_DeleteOnClose for the window to free memory on close. before opening->clicked through all tabs->after closing without WA_DeleteOnClose: 180->225->225 ; ->225->225... with WA_DeleteOnClose: 180->226->187 ; ->224->189... There is a mud with spaceotabulation, so don't poke me for doing automatic things for indentation, instead of understanding what should be there for new code. 'tis no more saves last opened statistics' tab, but hopefully nobody needs such a thing. --- retroshare-gui/src/gui/statistics/StatisticsWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index 48b1462cc..c392aec05 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -97,6 +97,7 @@ StatisticsWindow::StatisticsWindow(QWidget *parent) : ui(new Ui::StatisticsWindow) { ui->setupUi(this); + setAttribute(Qt::WA_DeleteOnClose, true); Settings->loadWidgetInformation(this); From 73efcfba8db714d5084fdec3da183c606e14e1f4 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Wed, 13 Apr 2022 01:27:01 +0900 Subject: [PATCH 08/33] gui: chat: repudiate a hashbox to be half-screen large --- retroshare-gui/src/gui/chat/ChatWidget.ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.ui b/retroshare-gui/src/gui/chat/ChatWidget.ui index 879c99d00..9f8315ab8 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.ui +++ b/retroshare-gui/src/gui/chat/ChatWidget.ui @@ -894,6 +894,12 @@ border-image: url(:/images/closepressed.png) + + + 16777215 + 78 + + true From d66340d65a65741cca35bd977696c9cb4af76aa8 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 18 Apr 2022 18:28:51 +0900 Subject: [PATCH 09/33] gui: statistics: comment out deleteonclose attribute retroshare crashes --- retroshare-gui/src/gui/statistics/StatisticsWindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index c392aec05..b6871ff70 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -97,7 +97,7 @@ StatisticsWindow::StatisticsWindow(QWidget *parent) : ui(new Ui::StatisticsWindow) { ui->setupUi(this); - setAttribute(Qt::WA_DeleteOnClose, true); + // setAttribute(Qt::WA_DeleteOnClose, true); Settings->loadWidgetInformation(this); From 5d132918c3ef3a33481e01bf4a255338c471927b Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Sat, 7 May 2022 09:06:45 +0900 Subject: [PATCH 10/33] gui: forum: set combobox property for versions of post Only silhouette of word instead of time no more. This is maximum length of time representation, but auto shrinkable. --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui index c74ea5ebb..804b2af14 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui @@ -433,7 +433,11 @@ - + + + QComboBox::AdjustToContents + + From 638216e5139b9dd222b8b121b0fea8552c7b036a Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 9 May 2022 20:22:12 +0900 Subject: [PATCH 11/33] gui: forum: not expand unread children no more Make the setting great again --- .../gui/gxsforums/GxsForumThreadWidget.cpp | 21 ++++++++++++++++++- .../src/gui/gxsforums/GxsForumThreadWidget.h | 1 + 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 19c408336..8592cf2bc 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -936,6 +936,12 @@ void GxsForumThreadWidget::changedThread(QModelIndex index) #endif markMsgAsReadUnread(true, false, false); } + + if (Settings->getForumExpandNewMessages()) + { + recursExpandUnread(index); + } + } void GxsForumThreadWidget::clickedThread(QModelIndex index) @@ -1323,7 +1329,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) else { RsIdentityDetails details; rsIdentity->getIdDetails(msg.mMeta.mAuthorId, details); - QString name = GxsIdDetails::getName(details); + QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE); banned_text_info += "

" + tr( "The author of this message (with ID %1) is banned. And named by name ( %2 )").arg(QString::fromStdString(msg.mMeta.mAuthorId.toStdString()), name) + ""; banned_text_info += "

  • " + tr( "Messages from this author are not forwarded.") + "
"; @@ -2107,3 +2113,16 @@ void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg) MainWindow::showWindow(MainWindow::People); idDialog->navigate(RsGxsId(msg.mMeta.mAuthorId)); } + +void GxsForumThreadWidget::recursExpandUnread(const QModelIndex &index) +{ + if (index.isValid() + && index.data(RsGxsForumModel::UnreadChildrenRole).toBool() + ) { + ui->threadTreeWidget->expand(index); + for (int row=0; row < mThreadProxyModel->rowCount(index); ++row) + { + recursExpandUnread(index.child(row, 0)); + } + } +} diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 29e56268f..32dce5c1f 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -199,6 +199,7 @@ private: void setForumDescriptionLoading(); void clearForumDescription(); void blankPost(); + void recursExpandUnread(const QModelIndex &index); RsGxsGroupId mLastForumID; RsGxsMessageId mThreadId; From 14a1163afaf899d15a93dabac21e07806d345f0f Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:10:02 +0900 Subject: [PATCH 12/33] gui: chatlobbydialog: delete mparticipantcomparerole in destructor --- retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 0f9f26240..62834fb3e 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -469,6 +469,7 @@ ChatLobbyDialog::~ChatLobbyDialog() // save settings processSettings(false); + delete mParticipantCompareRole; } ChatWidget *ChatLobbyDialog::getChatWidget() From 7a94f9da74fd31032d6a51b518e057feff704864 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:11:20 +0900 Subject: [PATCH 13/33] gui: chatwidget: delete menus in destructor As qt says: Ownership of the menu is not transferred to the tool button. --- retroshare-gui/src/gui/chat/ChatWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index a909e3e27..0d6d9f294 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -260,6 +260,8 @@ ChatWidget::~ChatWidget() foreach (ChatWidgetHolder *chatWidgetHolder, mChatWidgetHolder) { delete(chatWidgetHolder); } + delete ui->fontcolorButton->menu(); + delete ui->pushtoolsButton->menu(); delete ui; } From 2e175cbc6f5aacf6a60ee1b868fb3462cba313c2 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:34:53 +0900 Subject: [PATCH 14/33] gui: rscombobox: add destructor --- retroshare-gui/src/gui/common/RSComboBox.cpp | 5 +++++ retroshare-gui/src/gui/common/RSComboBox.h | 1 + 2 files changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/common/RSComboBox.cpp b/retroshare-gui/src/gui/common/RSComboBox.cpp index e11a3c99d..993e86fbe 100644 --- a/retroshare-gui/src/gui/common/RSComboBox.cpp +++ b/retroshare-gui/src/gui/common/RSComboBox.cpp @@ -33,6 +33,11 @@ RSComboBox::RSComboBox(QWidget *parent /*= nullptr*/) view()->installEventFilter(this); } +RSComboBox::~RSComboBox() +{ + delete this->itemDelegate(); +} + bool RSComboBox::eventFilter(QObject *obj, QEvent *event) { if(QAbstractItemView* view = dynamic_cast(obj)) diff --git a/retroshare-gui/src/gui/common/RSComboBox.h b/retroshare-gui/src/gui/common/RSComboBox.h index 8ce46a649..21e9eb37f 100644 --- a/retroshare-gui/src/gui/common/RSComboBox.h +++ b/retroshare-gui/src/gui/common/RSComboBox.h @@ -28,6 +28,7 @@ class RSComboBox : public QComboBox Q_OBJECT public: explicit RSComboBox(QWidget *parent = nullptr); + ~RSComboBox(); protected: bool eventFilter(QObject *obj, QEvent *event); From a9ec9166e818ed06206ac01c7c3436b8eb52969c Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:36:24 +0900 Subject: [PATCH 15/33] gui: settings: add missed ui deletion in postedpage --- retroshare-gui/src/gui/settings/PostedPage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/settings/PostedPage.cpp b/retroshare-gui/src/gui/settings/PostedPage.cpp index f4c178705..acf1e95fd 100644 --- a/retroshare-gui/src/gui/settings/PostedPage.cpp +++ b/retroshare-gui/src/gui/settings/PostedPage.cpp @@ -36,6 +36,7 @@ PostedPage::PostedPage(QWidget * parent, Qt::WindowFlags flags) PostedPage::~PostedPage() { + delete ui; } /** Loads the settings for this page */ From c3160c062e45faa2f5977940ea792e6853ece72b Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:37:51 +0900 Subject: [PATCH 16/33] gui: statistics: delete bwdelegate in destructor --- retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp index 44f606318..d65862a24 100644 --- a/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp +++ b/retroshare-gui/src/gui/statistics/BwCtrlWindow.cpp @@ -197,6 +197,7 @@ BwCtrlWindow::BwCtrlWindow(QWidget *parent) BwCtrlWindow::~BwCtrlWindow() { + delete BWDelegate; } void BwCtrlWindow::updateDisplay() From 6c307bf094eb1d9fe005d17b5cfacbfb699bfc12 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:38:58 +0900 Subject: [PATCH 17/33] gui: rsgraphwidget: delete timer in destructor --- retroshare-gui/src/gui/common/RSGraphWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/common/RSGraphWidget.cpp b/retroshare-gui/src/gui/common/RSGraphWidget.cpp index dab0645c4..48f22638d 100644 --- a/retroshare-gui/src/gui/common/RSGraphWidget.cpp +++ b/retroshare-gui/src/gui/common/RSGraphWidget.cpp @@ -301,6 +301,8 @@ RSGraphWidget::~RSGraphWidget() { delete _painter; delete _source ; + _timer->stop(); + delete _timer; } void RSGraphWidget::setFiltering(bool b) From e331b0ba3e5637a31199b88b869156c158648ab2 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:40:44 +0900 Subject: [PATCH 18/33] gui: forum: add default destructor for itemdelegate and delete delegatesforcolumn --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 8592cf2bc..cb3f532a7 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -97,6 +97,7 @@ class DistributionItemDelegate: public QStyledItemDelegate { public: DistributionItemDelegate() {} + ~DistributionItemDelegate() {} virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override { @@ -433,6 +434,9 @@ GxsForumThreadWidget::~GxsForumThreadWidget() // save settings processSettings(false); + delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION) ; + delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR) ; + delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ) ; delete ui; } From 05c8835055827cbc0f7a46170999cd3236156028 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:41:58 +0900 Subject: [PATCH 19/33] gui: messagesdialog: delete itemdelegate in destructor --- retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index 480959bb8..36fd4985f 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -401,6 +401,7 @@ MessagesDialog::~MessagesDialog() rsEvents->unregisterEventsHandler(mEventHandlerId); rsEvents->unregisterEventsHandler(mTagEventHandlerId); + delete ui.messageTreeWidget->itemDelegateForColumn(RsMessageModel::COLUMN_THREAD_AUTHOR) ; } UserNotify *MessagesDialog::createUserNotify(QObject *parent) From ff9f92aee90d3b216c2f4ff2dd482a2019c37d32 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:43:24 +0900 Subject: [PATCH 20/33] gui: iddialog: delete itemdelegate and menu in destructor --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 5397f6300..3250e9598 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -1230,6 +1230,11 @@ IdDialog::~IdDialog() { rsEvents->unregisterEventsHandler(mEventHandlerId_identity); rsEvents->unregisterEventsHandler(mEventHandlerId_circles); + delete ui->idTreeWidget->itemDelegateForColumn(RSID_COL_NICKNAME); + delete ui->idTreeWidget->itemDelegateForColumn(RSID_COL_VOTES); + delete ui->idTreeWidget->itemDelegate(); + delete ui->treeWidget_membership->itemDelegateForColumn(CIRCLEGROUP_CIRCLE_COL_GROUPNAME); + delete ui->toolButton_New->menu(); // save settings processSettings(false); From 02fb6d84c89ef44389903cc5714e1bf8abe02a51 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:44:26 +0900 Subject: [PATCH 21/33] gui: grouptreewidget: delete comparerole and itemdelegate in destructor --- retroshare-gui/src/gui/common/GroupTreeWidget.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp index 0597a652c..e4c315f9d 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.cpp +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.cpp @@ -153,6 +153,8 @@ GroupTreeWidget::GroupTreeWidget(QWidget *parent) : GroupTreeWidget::~GroupTreeWidget() { + delete compareRole; + delete ui->treeWidget->itemDelegate(); delete ui; } From cb6a2633d27a56358b3591a3b03e836d1181fd12 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:46:44 +0900 Subject: [PATCH 22/33] gui: lineeditclear: add destructor --- retroshare-gui/src/gui/common/LineEditClear.cpp | 8 ++++++++ retroshare-gui/src/gui/common/LineEditClear.h | 1 + 2 files changed, 9 insertions(+) diff --git a/retroshare-gui/src/gui/common/LineEditClear.cpp b/retroshare-gui/src/gui/common/LineEditClear.cpp index c3d68b512..829b4f4d4 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.cpp +++ b/retroshare-gui/src/gui/common/LineEditClear.cpp @@ -68,6 +68,14 @@ LineEditClear::LineEditClear(QWidget *parent) qMax(msz.height(), mClearButton->sizeHint().height() + frameWidth * 2)); } +LineEditClear::~LineEditClear() +{ + delete (mFilterButton ? mFilterButton->menu() : nullptr); + delete mClearButton; + delete mFilterButton; + delete mActionGroup; +} + void LineEditClear::resizeEvent(QResizeEvent *) { QSize sz = mClearButton->sizeHint(); diff --git a/retroshare-gui/src/gui/common/LineEditClear.h b/retroshare-gui/src/gui/common/LineEditClear.h index ae30f6127..596123c98 100644 --- a/retroshare-gui/src/gui/common/LineEditClear.h +++ b/retroshare-gui/src/gui/common/LineEditClear.h @@ -37,6 +37,7 @@ class LineEditClear : public QLineEdit public: LineEditClear(QWidget *parent = 0); + ~LineEditClear(); void addFilter(const QIcon &icon, const QString &text, int id, const QString &description = ""); void setCurrentFilter(int id); From 3621734a111680413eb1905ef589c87020709ecd Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:48:31 +0900 Subject: [PATCH 23/33] gui: mainwindow: delete idle in destructor --- retroshare-gui/src/gui/MainWindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index e1a89a303..634932a9d 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -378,6 +378,7 @@ MainWindow::~MainWindow() delete trayIcon; delete trayMenu; // delete notifyMenu; // already deleted by the deletion of trayMenu + delete idle; StatisticsWindow::releaseInstance(); #ifdef MESSENGER_WINDOW From 1d3bff99d5c0e0993c0f1f7a6bbf4b07bd231614 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:49:29 +0900 Subject: [PATCH 24/33] gui: sharedfilesdialog: add default destructor for shareflagsitemdelegate --- retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp index a7d61489a..b6502923c 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.cpp @@ -130,6 +130,9 @@ class ShareFlagsItemDelegate: public QStyledItemDelegate { public: ShareFlagsItemDelegate() {} + /** Default Destructor */ + ~ShareFlagsItemDelegate() {} + virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { From b489dd973930204b9d303e405bd451e7db4d145c Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:51:59 +0900 Subject: [PATCH 25/33] gui: transfersdialog: delete also model in destructor --- retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp index 035ed2ca6..50c5dda74 100644 --- a/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/TransfersDialog.cpp @@ -1133,6 +1133,9 @@ TransfersDialog::~TransfersDialog() delete ULDelegate; delete DLDelegate; + delete ULListModel; + delete DLListModel; + delete DLLFilterModel; } void TransfersDialog::activatePage(TransfersDialog::Page page) From c383d21e31340f2428e0ac49eab98d91ee851513 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:53:07 +0900 Subject: [PATCH 26/33] gui: homepage: delete also menu in destructor --- retroshare-gui/src/gui/HomePage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/HomePage.cpp b/retroshare-gui/src/gui/HomePage.cpp index dec4e9fec..d6881e96f 100644 --- a/retroshare-gui/src/gui/HomePage.cpp +++ b/retroshare-gui/src/gui/HomePage.cpp @@ -202,6 +202,7 @@ void HomePage::certContextMenu(QPoint /*point*/) HomePage::~HomePage() { rsEvents->unregisterEventsHandler(mEventHandlerId); + delete ui->shareButton->menu(); delete ui; } From c784e09daa5c24ab45e5e677717a1f0662fefecb Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Fri, 13 May 2022 21:53:42 +0900 Subject: [PATCH 27/33] gui: newsfeed: delete ui in destructor --- retroshare-gui/src/gui/NewsFeed.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/NewsFeed.cpp b/retroshare-gui/src/gui/NewsFeed.cpp index 252560d43..0d91b0cee 100644 --- a/retroshare-gui/src/gui/NewsFeed.cpp +++ b/retroshare-gui/src/gui/NewsFeed.cpp @@ -146,6 +146,7 @@ NewsFeed::~NewsFeed() if (instance == this) { instance = NULL; + delete ui; } } From 3fa98d79731ee2244e9cb337293698650c8a90ea Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Tue, 12 Apr 2022 16:13:23 +0900 Subject: [PATCH 28/33] gui: statistics: add exit button onto toolbar and comment out quit-close button per cyril taste --- retroshare-gui/src/gui/statistics/StatisticsWindow.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp index b6871ff70..34cfc87a9 100644 --- a/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp +++ b/retroshare-gui/src/gui/statistics/StatisticsWindow.cpp @@ -59,6 +59,7 @@ #define IMAGE_BWGRAPH ":/icons/bandwidth128.png" #define IMAGE_GLOBALROUTER ":/icons/GRouter128.png" #define IMAGE_GXSTRANSPORT ":/icons/transport128.png" +#define IMAGE_QUIT ":/icons/png/exit.png" #define IMAGE_RTT ":/icons/RTT128.png" //#define IMAGE_BANDWIDTH ":images/office-chart-area-stacked.png" @@ -201,6 +202,9 @@ void StatisticsWindow::initStackedPage() /* Create the toolbar */ ui->toolBar->addActions(grp->actions()); + // commented out per cyril taste + // action = ui->toolBar->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_QUIT), tr("Quit")); + // connect(action, &QAction::triggered, this, &StatisticsWindow::close); connect(grp, SIGNAL(triggered(QAction *)), ui->stackPages, SLOT(showPage(QAction *))); From c6152678dae1bd9c2c2ccb2329e97db4dd4dad3a Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Sun, 15 May 2022 00:52:33 +0900 Subject: [PATCH 29/33] gui: forum: delete threadtreewidget proxymodel in destructor As qt says: the view does not take ownership of the model. --- retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index cb3f532a7..79a8b72a3 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -437,6 +437,7 @@ GxsForumThreadWidget::~GxsForumThreadWidget() delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_DISTRIBUTION) ; delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_AUTHOR) ; delete ui->threadTreeWidget->itemDelegateForColumn(RsGxsForumModel::COLUMN_THREAD_READ) ; + delete ui->threadTreeWidget->model(); delete ui; } From 342f415a56982029d864c78d057c2fecc0ee01c0 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 16 May 2022 01:16:42 +0900 Subject: [PATCH 30/33] gui: messagewidget: delete menu in destructor --- retroshare-gui/src/gui/msgs/MessageWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp index d05d17446..5267727c2 100644 --- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp +++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp @@ -221,6 +221,7 @@ MessageWidget::~MessageWidget() } rsEvents->unregisterEventsHandler(mEventHandlerId); + delete ui.moreButton->menu(); } void MessageWidget::handleEvent_main_thread(std::shared_ptr event) From c567810841756a6eebbcea2f995b4a975ad105e1 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 16 May 2022 01:41:02 +0900 Subject: [PATCH 31/33] gui: rsimageblockwidget: delete menu in destructor --- retroshare-gui/src/gui/common/RSImageBlockWidget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp index 63dd224f1..01ba310a2 100644 --- a/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp +++ b/retroshare-gui/src/gui/common/RSImageBlockWidget.cpp @@ -47,6 +47,7 @@ RSImageBlockWidget::~RSImageBlockWidget() delete mAnimation; mTimer->stop(); delete mTimer; + delete ui->loadImagesButton->menu(); delete ui; } From 826b0970401c79a7fe13dc2abc7131b4c1091b20 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 16 May 2022 01:41:54 +0900 Subject: [PATCH 32/33] gui: handlerichtext: attempt to silence valgrind for qimage "Conditional jump or move depends on uninitialised value" --- retroshare-gui/src/util/HandleRichText.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/util/HandleRichText.cpp b/retroshare-gui/src/util/HandleRichText.cpp index bba7c03af..b23daf287 100644 --- a/retroshare-gui/src/util/HandleRichText.cpp +++ b/retroshare-gui/src/util/HandleRichText.cpp @@ -1210,7 +1210,7 @@ QString RsHtml::toHtml(QString text, bool realHtml) /** Loads image and converts image to embedded image HTML fragment **/ bool RsHtml::makeEmbeddedImage(const QString &fileName, QString &embeddedImage, const int maxPixels, const int maxBytes) { - QImage image; + QImage image {}; if (image.load (fileName) == false) { fprintf (stderr, "RsHtml::makeEmbeddedImage() - image \"%s\" can't be load\n", fileName.toLatin1().constData()); From 26def039eb4f8bbb22b0ba21caae1e596f054928 Mon Sep 17 00:00:00 2001 From: chelovechishko Date: Mon, 16 May 2022 12:45:28 +0900 Subject: [PATCH 33/33] gui: forum: set expanding sizepolicy for grouptreewidget It still shrinks for some amount, but less. What exactly cause such behaviour from post to post still unknown. --- retroshare-gui/src/gui/common/GroupTreeWidget.ui | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index d3e0a14a5..46a6e4314 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -10,6 +10,12 @@ 257 + + + 0 + 0 + + 2