removed debug info

This commit is contained in:
csoler 2020-04-19 21:07:53 +02:00
parent 02e939ac8f
commit 5b761c72ba
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
5 changed files with 35 additions and 8 deletions

View File

@ -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 <fstream>
#include <util/rsdir.h>
#include <algorithm>

View File

@ -30,8 +30,6 @@
* #define DATA_DEBUG 1
**********/
#define DATA_DEBUG 1
RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds) :
mDataStore(ds), mDataMutex("RsGxsDataAccess"), mNextToken(0) {}

View File

@ -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;
}

View File

@ -27,6 +27,8 @@
#include <map>
//#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<QString,QPixmap> 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<QString,QIcon> 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;
}

View File

@ -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();
}