From 5b761c72bad6eb3b2dcd96fd0e3c9c00dfecb225 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 19 Apr 2020 21:07:53 +0200 Subject: [PATCH] removed debug info --- libretroshare/src/gxs/rsdataservice.cc | 4 ---- libretroshare/src/gxs/rsgxsdataaccess.cc | 2 -- libretroshare/src/retroshare/rsgxsifacehelper.h | 16 +++++++++++++++- retroshare-gui/src/gui/common/FilesDefs.cpp | 14 ++++++++++++++ .../src/gui/feeds/GxsChannelPostItem.cpp | 7 ++++++- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/libretroshare/src/gxs/rsdataservice.cc b/libretroshare/src/gxs/rsdataservice.cc index cc215dc14..6bdc924ed 100644 --- a/libretroshare/src/gxs/rsdataservice.cc +++ b/libretroshare/src/gxs/rsdataservice.cc @@ -26,10 +26,6 @@ * #define RS_DATA_SERVICE_DEBUG_CACHE 1 ****/ -#define RS_DATA_SERVICE_DEBUG 1 -#define RS_DATA_SERVICE_DEBUG_TIME 1 -#define RS_DATA_SERVICE_DEBUG_CACHE 1 - #include #include #include diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index f8300b37e..dd41f9237 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -30,8 +30,6 @@ * #define DATA_DEBUG 1 **********/ -#define DATA_DEBUG 1 - RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds) : mDataStore(ds), mDataMutex("RsGxsDataAccess"), mNextToken(0) {} diff --git a/libretroshare/src/retroshare/rsgxsifacehelper.h b/libretroshare/src/retroshare/rsgxsifacehelper.h index 422261a02..9f49e76ef 100644 --- a/libretroshare/src/retroshare/rsgxsifacehelper.h +++ b/libretroshare/src/retroshare/rsgxsifacehelper.h @@ -40,7 +40,7 @@ * are necessary, so at this point this workaround seems acceptable. */ -#define DEBUG_GXSIFACEHELPER 1 +//#define DEBUG_GXSIFACEHELPER 1 enum class TokenRequestType: uint8_t { @@ -270,7 +270,9 @@ public: { RS_STACK_MUTEX(mMtx); mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } else @@ -298,7 +300,9 @@ public: { RS_STACK_MUTEX(mMtx); mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } else @@ -313,7 +317,9 @@ public: RS_STACK_MUTEX(mMtx); mActiveTokens[token]= (msgIds.size()==1 && msgIds.begin()->second.size()==0) ?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS); +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } else @@ -327,7 +333,9 @@ public: { RS_STACK_MUTEX(mMtx); mActiveTokens[token]=TokenRequestType::ALL_POSTS; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } else @@ -343,7 +351,9 @@ public: { RS_STACK_MUTEX(mMtx); mActiveTokens[token]=TokenRequestType::MSG_RELATED_INFO; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } else @@ -365,7 +375,9 @@ public: RS_STACK_MUTEX(mMtx); mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif } /// @see RsTokenService::requestGroupStatistic @@ -375,7 +387,9 @@ public: RS_STACK_MUTEX(mMtx); mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS; +#ifdef DEBUG_GXSIFACEHELPER locked_dumpTokens(); +#endif return true; } diff --git a/retroshare-gui/src/gui/common/FilesDefs.cpp b/retroshare-gui/src/gui/common/FilesDefs.cpp index dc8b30e86..c8b0d63d8 100644 --- a/retroshare-gui/src/gui/common/FilesDefs.cpp +++ b/retroshare-gui/src/gui/common/FilesDefs.cpp @@ -27,6 +27,8 @@ #include +//#define DEBUG_FILESDEFS 1 + static QString getInfoFromFilename(const QString& filename, bool anyForUnknown, bool image) { QString ext = QFileInfo(filename).suffix().toLower(); @@ -89,19 +91,25 @@ QPixmap FilesDefs::getPixmapFromQtResourcePath(const QString& resource_path) { static std::map mPixmapCache; QPixmap pixmap; +#ifdef DEBUG_FILESDEFS std::cerr << "Creating Pixmap from resource path " << resource_path.toStdString() ; +#endif auto item = mPixmapCache.find(resource_path); if (item == mPixmapCache.end()) { +#ifdef DEBUG_FILESDEFS std::cerr << " Not in cache. Creating new one." << std::endl; +#endif pixmap = QPixmap(resource_path); mPixmapCache[resource_path] = pixmap; } else { +#ifdef DEBUG_FILESDEFS std::cerr << " In cache. " << std::endl; +#endif pixmap = item->second; } @@ -112,19 +120,25 @@ QIcon FilesDefs::getIconFromQtResourcePath(const QString& resource_path) { static std::map mIconCache; QIcon icon; +#ifdef DEBUG_FILESDEFS std::cerr << "Creating Icon from resource path " << resource_path.toStdString() ; +#endif auto item = mIconCache.find(resource_path); if (item == mIconCache.end()) { +#ifdef DEBUG_FILESDEFS std::cerr << " Not in cache. Creating new one." << std::endl; +#endif icon = QIcon(resource_path); mIconCache[resource_path] = icon; } else { +#ifdef DEBUG_FILESDEFS std::cerr << " In cache. " << std::endl; +#endif icon = item->second; } diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 4ee799041..c01ca7315 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -288,7 +288,9 @@ void GxsChannelPostItem::loadMessage() if (posts.size() == 1) { +#ifdef DEBUG_ITEM std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl; +#endif const RsGxsChannelPost& post(posts[0]); RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this ); @@ -296,7 +298,9 @@ void GxsChannelPostItem::loadMessage() 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]() { @@ -313,8 +317,10 @@ void GxsChannelPostItem::loadMessage() } else { +#ifdef DEBUG_ITEM std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items. Remove It."; std::cerr << std::endl; +#endif RsQThreadUtils::postToObject( [this]() { removeItem(); }, this ); } @@ -745,7 +751,6 @@ void GxsChannelPostItem::readAndClearItem() std::cerr << "GxsChannelPostItem::readAndClearItem()"; std::cerr << std::endl; #endif - readToggled(false); removeItem(); }