mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
removed debug info
This commit is contained in:
parent
02e939ac8f
commit
5b761c72ba
@ -26,10 +26,6 @@
|
|||||||
* #define RS_DATA_SERVICE_DEBUG_CACHE 1
|
* #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 <fstream>
|
||||||
#include <util/rsdir.h>
|
#include <util/rsdir.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
* #define DATA_DEBUG 1
|
* #define DATA_DEBUG 1
|
||||||
**********/
|
**********/
|
||||||
|
|
||||||
#define DATA_DEBUG 1
|
|
||||||
|
|
||||||
RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds) :
|
RsGxsDataAccess::RsGxsDataAccess(RsGeneralDataService* ds) :
|
||||||
mDataStore(ds), mDataMutex("RsGxsDataAccess"), mNextToken(0) {}
|
mDataStore(ds), mDataMutex("RsGxsDataAccess"), mNextToken(0) {}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
* are necessary, so at this point this workaround seems acceptable.
|
* are necessary, so at this point this workaround seems acceptable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define DEBUG_GXSIFACEHELPER 1
|
//#define DEBUG_GXSIFACEHELPER 1
|
||||||
|
|
||||||
enum class TokenRequestType: uint8_t
|
enum class TokenRequestType: uint8_t
|
||||||
{
|
{
|
||||||
@ -270,7 +270,9 @@ public:
|
|||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -298,7 +300,9 @@ public:
|
|||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
mActiveTokens[token]=high_priority_request? (TokenRequestType::NO_KILL_TYPE) : token_request_type;
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -313,7 +317,9 @@ public:
|
|||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
|
|
||||||
mActiveTokens[token]= (msgIds.size()==1 && msgIds.begin()->second.size()==0) ?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS);
|
mActiveTokens[token]= (msgIds.size()==1 && msgIds.begin()->second.size()==0) ?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS);
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -327,7 +333,9 @@ public:
|
|||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::ALL_POSTS;
|
mActiveTokens[token]=TokenRequestType::ALL_POSTS;
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -343,7 +351,9 @@ public:
|
|||||||
{
|
{
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::MSG_RELATED_INFO;
|
mActiveTokens[token]=TokenRequestType::MSG_RELATED_INFO;
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -365,7 +375,9 @@ public:
|
|||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
mActiveTokens[token]=TokenRequestType::SERVICE_STATISTICS;
|
||||||
|
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @see RsTokenService::requestGroupStatistic
|
/// @see RsTokenService::requestGroupStatistic
|
||||||
@ -375,7 +387,9 @@ public:
|
|||||||
|
|
||||||
RS_STACK_MUTEX(mMtx);
|
RS_STACK_MUTEX(mMtx);
|
||||||
mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS;
|
mActiveTokens[token]=TokenRequestType::GROUP_STATISTICS;
|
||||||
|
#ifdef DEBUG_GXSIFACEHELPER
|
||||||
locked_dumpTokens();
|
locked_dumpTokens();
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
//#define DEBUG_FILESDEFS 1
|
||||||
|
|
||||||
static QString getInfoFromFilename(const QString& filename, bool anyForUnknown, bool image)
|
static QString getInfoFromFilename(const QString& filename, bool anyForUnknown, bool image)
|
||||||
{
|
{
|
||||||
QString ext = QFileInfo(filename).suffix().toLower();
|
QString ext = QFileInfo(filename).suffix().toLower();
|
||||||
@ -89,19 +91,25 @@ QPixmap FilesDefs::getPixmapFromQtResourcePath(const QString& resource_path)
|
|||||||
{
|
{
|
||||||
static std::map<QString,QPixmap> mPixmapCache;
|
static std::map<QString,QPixmap> mPixmapCache;
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << "Creating Pixmap from resource path " << resource_path.toStdString() ;
|
std::cerr << "Creating Pixmap from resource path " << resource_path.toStdString() ;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto item = mPixmapCache.find(resource_path);
|
auto item = mPixmapCache.find(resource_path);
|
||||||
|
|
||||||
if (item == mPixmapCache.end())
|
if (item == mPixmapCache.end())
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << " Not in cache. Creating new one." << std::endl;
|
std::cerr << " Not in cache. Creating new one." << std::endl;
|
||||||
|
#endif
|
||||||
pixmap = QPixmap(resource_path);
|
pixmap = QPixmap(resource_path);
|
||||||
mPixmapCache[resource_path] = pixmap;
|
mPixmapCache[resource_path] = pixmap;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << " In cache. " << std::endl;
|
std::cerr << " In cache. " << std::endl;
|
||||||
|
#endif
|
||||||
pixmap = item->second;
|
pixmap = item->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -112,19 +120,25 @@ QIcon FilesDefs::getIconFromQtResourcePath(const QString& resource_path)
|
|||||||
{
|
{
|
||||||
static std::map<QString,QIcon> mIconCache;
|
static std::map<QString,QIcon> mIconCache;
|
||||||
QIcon icon;
|
QIcon icon;
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << "Creating Icon from resource path " << resource_path.toStdString() ;
|
std::cerr << "Creating Icon from resource path " << resource_path.toStdString() ;
|
||||||
|
#endif
|
||||||
|
|
||||||
auto item = mIconCache.find(resource_path);
|
auto item = mIconCache.find(resource_path);
|
||||||
|
|
||||||
if (item == mIconCache.end())
|
if (item == mIconCache.end())
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << " Not in cache. Creating new one." << std::endl;
|
std::cerr << " Not in cache. Creating new one." << std::endl;
|
||||||
|
#endif
|
||||||
icon = QIcon(resource_path);
|
icon = QIcon(resource_path);
|
||||||
mIconCache[resource_path] = icon;
|
mIconCache[resource_path] = icon;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_FILESDEFS
|
||||||
std::cerr << " In cache. " << std::endl;
|
std::cerr << " In cache. " << std::endl;
|
||||||
|
#endif
|
||||||
icon = item->second;
|
icon = item->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +288,9 @@ void GxsChannelPostItem::loadMessage()
|
|||||||
|
|
||||||
if (posts.size() == 1)
|
if (posts.size() == 1)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
std::cerr << (void*)this << ": Obtained post, with msgId = " << posts[0].mMeta.mMsgId << std::endl;
|
||||||
|
#endif
|
||||||
const RsGxsChannelPost& post(posts[0]);
|
const RsGxsChannelPost& post(posts[0]);
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this );
|
RsQThreadUtils::postToObject( [post,this]() { setPost(post); }, this );
|
||||||
@ -296,7 +298,9 @@ void GxsChannelPostItem::loadMessage()
|
|||||||
else if(comments.size() == 1)
|
else if(comments.size() == 1)
|
||||||
{
|
{
|
||||||
const RsGxsComment& cmt = comments[0];
|
const RsGxsComment& cmt = comments[0];
|
||||||
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
std::cerr << (void*)this << ": Obtained comment, setting messageId to threadID = " << cmt.mMeta.mThreadId << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [cmt,this]()
|
RsQThreadUtils::postToObject( [cmt,this]()
|
||||||
{
|
{
|
||||||
@ -313,8 +317,10 @@ void GxsChannelPostItem::loadMessage()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_ITEM
|
||||||
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items. Remove It.";
|
std::cerr << "GxsChannelPostItem::loadMessage() Wrong number of Items. Remove It.";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
RsQThreadUtils::postToObject( [this]() { removeItem(); }, this );
|
RsQThreadUtils::postToObject( [this]() { removeItem(); }, this );
|
||||||
}
|
}
|
||||||
@ -745,7 +751,6 @@ void GxsChannelPostItem::readAndClearItem()
|
|||||||
std::cerr << "GxsChannelPostItem::readAndClearItem()";
|
std::cerr << "GxsChannelPostItem::readAndClearItem()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
readToggled(false);
|
readToggled(false);
|
||||||
removeItem();
|
removeItem();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user