From 48da2d195a725987b74d93bf9d630fab3e1edf8b Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 10 Nov 2023 22:42:32 +0100 Subject: [PATCH] removed some debug output --- retroshare-gui/src/gui/GenCertDialog.cpp | 4 +++- retroshare-gui/src/gui/common/NewFriendList.cpp | 2 ++ retroshare-gui/src/gui/settings/JsonApiPage.cc | 3 ++- retroshare-gui/src/gui/settings/WebuiPage.cpp | 6 +++++- retroshare-gui/src/main.cpp | 5 +++-- retroshare-gui/src/rshare.cpp | 7 ++++++- 6 files changed, 21 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/GenCertDialog.cpp b/retroshare-gui/src/gui/GenCertDialog.cpp index b71e324c7..d3b755f0d 100644 --- a/retroshare-gui/src/gui/GenCertDialog.cpp +++ b/retroshare-gui/src/gui/GenCertDialog.cpp @@ -609,7 +609,9 @@ void GenCertDialog::genPerson() QCoreApplication::processEvents(); QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance(); - std::cout << "Waiting ed->processEvents()" << std::endl; +#ifdef DEBUG_GENCERTDIALOG + std::cout << "Waiting ed->processEvents()" << std::endl; +#endif time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents if (ed->hasPendingEvents()) while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd)); diff --git a/retroshare-gui/src/gui/common/NewFriendList.cpp b/retroshare-gui/src/gui/common/NewFriendList.cpp index 893433469..bd6faec41 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.cpp +++ b/retroshare-gui/src/gui/common/NewFriendList.cpp @@ -1619,7 +1619,9 @@ bool NewFriendList::isColumnVisible(int col) const } void NewFriendList::setColumnVisible(int col,bool visible) { +#ifdef DEBUG_NEW_FRIEND_LIST std::cerr << "Setting column " << col << " to be visible: " << visible << std::endl; +#endif ui->peerTreeWidget->setColumnHidden(col, !visible); } void NewFriendList::toggleColumnVisible() diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.cc b/retroshare-gui/src/gui/settings/JsonApiPage.cc index fee064093..2b7f25d80 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.cc +++ b/retroshare-gui/src/gui/settings/JsonApiPage.cc @@ -73,8 +73,9 @@ JsonApiPage::JsonApiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) if(!je) return; - +#ifdef DEBUG std::cerr << "Caught JSONAPI event! code=" << static_cast(je->mJsonApiEventCode) << std::endl; +#endif RsQThreadUtils::postToObject([=]() { load(); }, this ); }, diff --git a/retroshare-gui/src/gui/settings/WebuiPage.cpp b/retroshare-gui/src/gui/settings/WebuiPage.cpp index a14cc022d..4b36b758c 100644 --- a/retroshare-gui/src/gui/settings/WebuiPage.cpp +++ b/retroshare-gui/src/gui/settings/WebuiPage.cpp @@ -58,7 +58,9 @@ WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/) rsEvents->registerEventsHandler( [this](std::shared_ptr /* event */) { +#ifdef DEBUG std::cerr << "Caught JSONAPI event in webui!" << std::endl; +#endif RsQThreadUtils::postToObject([=]() { load(); }, this ); }, mEventsHandlerId, RsEventType::JSON_API ); @@ -132,7 +134,9 @@ bool WebuiPage::restart() void WebuiPage::loadParams() { - std::cerr << "WebuiPage::load()" << std::endl; +#ifdef DEBUG + std::cerr << "WebuiPage::load()" << std::endl; +#endif whileBlocking(ui.enableWebUI_CB)->setChecked(Settings->getWebinterfaceEnabled()); whileBlocking(ui.webInterfaceFiles_LE)->setText(Settings->getWebinterfaceFilesDirectory()); diff --git a/retroshare-gui/src/main.cpp b/retroshare-gui/src/main.cpp index ff091ccf9..13710a28b 100644 --- a/retroshare-gui/src/main.cpp +++ b/retroshare-gui/src/main.cpp @@ -538,8 +538,9 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); // qRegisterMetaType("RsPeerId") ; - +#ifdef DEBUG std::cerr << "connecting signals and slots" << std::endl ; +#endif QObject::connect(notify,SIGNAL(deferredSignatureHandlingRequested()),notify,SLOT(handleSignatureEvent()),Qt::QueuedConnection) ; QObject::connect(notify,SIGNAL(chatLobbyTimeShift(int)),notify,SLOT(handleChatLobbyTimeShift(int)),Qt::QueuedConnection) ; QObject::connect(notify,SIGNAL(diskFull(int,int)) ,w ,SLOT(displayDiskSpaceWarning(int,int))) ; @@ -582,7 +583,7 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO); if(!Settings->getWebinterfaceFilesDirectory().isNull()) rsWebUi->setHtmlFilesDirectory(Settings->getWebinterfaceFilesDirectory().toStdString()); #endif - RsInit::startupWebServices(conf); + RsInit::startupWebServices(conf,false); #endif /* dive into the endless loop */ diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index 8fb8fdc58..e5f450f57 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -139,17 +139,22 @@ static bool notifyRunningInstance() // that a new process had been started QLocalSocket localSocket; localSocket.connectToServer(QString(TARGET)); - +#ifdef DEBUG std::cerr << "Rshare::Rshare waitForConnected to other instance." << std::endl; +#endif if( localSocket.waitForConnected(100) ) { +#ifdef DEBUG std::cerr << "Rshare::Rshare Connection etablished. Waiting for disconnection." << std::endl; +#endif localSocket.waitForDisconnected(1000); return true; } else { +#ifdef DEBUG std::cerr << "Rshare::Rshare failed to connect to other instance." << std::endl; +#endif return false; } }