Removed most debugging/std::cerr output (in #defines)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@640 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-07-09 09:53:47 +00:00
parent bbe2ba2103
commit d5376cd575
24 changed files with 350 additions and 20 deletions

View File

@ -33,6 +33,9 @@
#include "GeneralMsgDialog.h"
/****
* #define CHAN_DEBUG
***/
/** Constructor */
ChannelFeed::ChannelFeed(QWidget *parent)
@ -125,8 +128,10 @@ void ChannelFeed::channelSelection()
void ChannelFeed::sendMsg()
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::sendMsg()";
std::cerr << std::endl;
#endif
if (mChannelId != "")
{
@ -134,8 +139,10 @@ void ChannelFeed::sendMsg()
}
else
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::sendMsg() no Channel Selected!";
std::cerr << std::endl;
#endif
}
}
@ -158,8 +165,10 @@ void ChannelFeed::openChat(std::string peerId)
void ChannelFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
@ -304,8 +313,10 @@ void ChannelFeed::updateChannelListOwn(std::list<std::string> &ids)
int index = topIndex + 1;
for (iit = ids.begin(); iit != ids.end(); iit++, index++)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::updateChannelListOwn(): " << *iit << " at: " << index;
std::cerr << std::endl;
#endif
ChanMenuItem *cmi = new ChanMenuItem(*iit);
mChannelListOwn.push_back(cmi);
@ -331,8 +342,10 @@ void ChannelFeed::updateChannelListSub(std::list<std::string> &ids)
int index = topIndex + 1;
for (iit = ids.begin(); iit != ids.end(); iit++, index++)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::updateChannelListSub(): " << *iit << " at: " << index;
std::cerr << std::endl;
#endif
ChanMenuItem *cmi = new ChanMenuItem(*iit);
mChannelListSub.push_back(cmi);
@ -358,8 +371,10 @@ void ChannelFeed::updateChannelListPop(std::list<std::string> &ids)
int index = topIndex + 1;
for (iit = ids.begin(); iit != ids.end(); iit++, index++)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::updateChannelListPop(): " << *iit << " at: " << index;
std::cerr << std::endl;
#endif
ChanMenuItem *cmi = new ChanMenuItem(*iit);
mChannelListPop.push_back(cmi);
@ -386,8 +401,10 @@ void ChannelFeed::updateChannelListOther(std::list<std::string> &ids)
int index = topIndex + 1;
for (iit = ids.begin(); iit != ids.end(); iit++, index++)
{
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::updateChannelListOther(): " << *iit << " at: " << index;
std::cerr << std::endl;
#endif
ChanMenuItem *cmi = new ChanMenuItem(*iit);
mChannelListOther.push_back(cmi);
@ -462,7 +479,7 @@ void ChannelFeed::updateChannelMsgs()
void ChannelFeed::unsubscribeChannel()
{
#ifdef DEBUG_ITEM
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::unsubscribeChannel()";
std::cerr << std::endl;
#endif
@ -476,7 +493,7 @@ void ChannelFeed::unsubscribeChannel()
void ChannelFeed::subscribeChannel()
{
#ifdef DEBUG_ITEM
#ifdef CHAN_DEBUG
std::cerr << "ChannelFeed::subscribeChannel()";
std::cerr << std::endl;
#endif

View File

@ -50,6 +50,10 @@
RsCertId getNeighRsCertId(QTreeWidgetItem *i);
/****
* #define CONN_DEBUG 1
****/
/** Constructor */
ConnectionsDialog::ConnectionsDialog(QWidget *parent)
: MainPage(parent), connectdialog(NULL)
@ -123,7 +127,9 @@ void ConnectionsDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
/** Shows Peer Information/Auth Dialog */
void ConnectionsDialog::peerdetails()
{
#ifdef CONN_DEBUG
std::cerr << "ConnectionsDialog::peerdetails()" << std::endl;
#endif
QTreeWidgetItem *wi = getCurrentNeighbour();
if (!wi)
@ -139,7 +145,10 @@ void ConnectionsDialog::peerdetails()
/** Shows Peer Information/Auth Dialog */
void ConnectionsDialog::showpeerdetails(std::string id)
{
#ifdef CONN_DEBUG
std::cerr << "ConnectionsDialog::showpeerdetails()" << std::endl;
#endif
if ((connectdialog) && (connectdialog -> loadPeer(id)))
{
connectdialog->show();
@ -338,7 +347,9 @@ QTreeWidgetItem *ConnectionsDialog::getCurrentNeighbour()
QTreeWidgetItem *item = connectWidget -> currentItem();
if (!item)
{
#ifdef CONN_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
@ -351,7 +362,9 @@ QTreeWidgetItem *ConnectionsDialog::getCurrentNeighbour()
QString txt = item -> text(i);
out << "\t" << i << ":" << txt.toStdString() << std::endl;
}
#ifdef CONN_DEBUG
std::cerr << out.str();
#endif
return item;
}
@ -372,7 +385,9 @@ RsCertId getNeighRsCertId(QTreeWidgetItem *i)
std::string ConnectionsDialog::loadneighbour()
{
#ifdef CONN_DEBUG
std::cerr << "ConnectionsDialog::loadneighbour()" << std::endl;
#endif
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Certificate"), "",
tr("Certificates (*.pqi *.pem)"));
@ -388,7 +403,9 @@ std::string ConnectionsDialog::loadneighbour()
void ConnectionsDialog::addneighbour()
{
QTreeWidgetItem *c = getCurrentNeighbour();
#ifdef CONN_DEBUG
std::cerr << "ConnectionsDialog::addneighbour()" << std::endl;
#endif
/*
rsServer->NeighAddFriend(getNeighRsCertId(c));
*/
@ -397,7 +414,9 @@ void ConnectionsDialog::addneighbour()
void ConnectionsDialog::authneighbour()
{
QTreeWidgetItem *c = getCurrentNeighbour();
#ifdef CONN_DEBUG
std::cerr << "ConnectionsDialog::authneighbour()" << std::endl;
#endif
/*
RsAuthId code;
rsServer->NeighAuthFriend(getNeighRsCertId(c), code);

View File

@ -54,6 +54,10 @@
#define IMAGE_SUX ":/images/filerating2.png"
#define IMAGE_BADLINK ":/images/filerating1.png"
/******
* #define LINKS_DEBUG 1
*****/
/** Constructor */
LinksDialog::LinksDialog(QWidget *parent)
: MainPage(parent)
@ -303,7 +307,9 @@ void LinksDialog::updateLinks()
std::list<std::string>::iterator rit;
std::list<RsRankComment>::iterator cit;
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::updateLinks()" << std::endl;
#endif
/* Work out the number/entries to show */
uint32_t count = rsRanks->getRankingsCount();
@ -488,12 +494,17 @@ void LinksDialog::updateLinks()
void LinksDialog::openLink ( QTreeWidgetItem * item, int column )
{
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::openLink()" << std::endl;
#endif
/* work out the ids */
if (!item)
{
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::openLink() Failed Item" << std::endl;
#endif
return;
}
@ -504,11 +515,15 @@ void LinksDialog::openLink ( QTreeWidgetItem * item, int column )
if (parent)
{
/* a child comment -> ignore double click */
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::openLink() Failed Child" << std::endl;
#endif
return;
}
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::openLink() " << (item->text(2)).toStdString() << std::endl;
#endif
/* open a browser */
QUrl url(item->text(2));
QDesktopServices::openUrl ( url );
@ -536,8 +551,10 @@ void LinksDialog::changedItem(QTreeWidgetItem *curr, QTreeWidgetItem *prev)
rid = (parent->text(4)).toStdString();
pid = (curr->text(4)).toStdString();
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::changedItem() Rid: " << rid << " Pid: " << pid;
std::cerr << std::endl;
#endif
updateComments(rid, pid);
}
@ -545,8 +562,10 @@ void LinksDialog::changedItem(QTreeWidgetItem *curr, QTreeWidgetItem *prev)
{
rid = (curr->text(4)).toStdString();
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::changedItem() Rid: " << rid << " Pid: NULL";
std::cerr << std::endl;
#endif
updateComments(rid, "");
}
@ -805,10 +824,13 @@ QTreeWidgetItem *LinksDialog::getCurrentLine()
QTreeWidgetItem *item = peerWidget -> currentItem();
if (!item)
{
#ifdef LINKS_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
#ifdef LINKS_DEBUG
/* Display the columns of this item. */
std::ostringstream out;
out << "CurrentPeerItem: " << std::endl;
@ -819,6 +841,8 @@ QTreeWidgetItem *LinksDialog::getCurrentLine()
out << "\t" << i << ":" << txt.toStdString() << std::endl;
}
std::cerr << out.str();
#endif
return item;
}
@ -839,7 +863,9 @@ void LinksDialog::voteup_anon()
}
QString link = QString::fromStdWString(detail.link);
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::voteup_anon() : " << link.toStdString() << std::endl;
#endif
// need a proper anon sharing option.
rsRanks->anonRankMsg(mLinkId, detail.link, detail.title);
}
@ -863,7 +889,9 @@ void LinksDialog::voteup_score(int score)
QString link = QString::fromStdWString(detail.link);
std::wstring comment;
#ifdef LINKS_DEBUG
std::cerr << "LinksDialog::voteup_score() : " << link.toStdString() << std::endl;
#endif
std::list<RsRankComment>::iterator cit;

View File

@ -64,6 +64,10 @@
#define IMAGE_ON ":/images/contract_hover.png"
#define IMAGE_OFF ":/images/expand_hover.png"
/******
* #define MSG_DEBUG 1
*****/
/** Constructor */
MessengerWindow::MessengerWindow(QWidget * parent)
@ -299,11 +303,15 @@ void MessengerWindow::connectfriend2()
std::string id = (i -> text(4)).toStdString();
if (rsPeers->isOnline(id))
{
#ifdef MSG_DEBUG
std::cerr << "MessengerWindow::connectfriend2() Already online" << std::endl;
#endif
}
else
{
#ifdef MSG_DEBUG
std::cerr << "MessengerWindow::connectfriend2() Trying" << std::endl;
#endif
rsPeers->connectAttempt(getMessengerPeerRsCertId(i));
}
}
@ -400,7 +408,9 @@ void MessengerWindow::chatfriend2()
void MessengerWindow::sendMessage()
{
bool isOnline;
#ifdef MSG_DEBUG
std::cerr << "SharedFilesDialog::msgfriend()" << std::endl;
#endif
QTreeWidgetItem *i = getCurrentPeer(isOnline);
@ -431,7 +441,9 @@ QTreeWidgetItem *MessengerWindow::getCurrentPeer(bool &isOnline)
QTreeWidgetItem *item = peerWidget -> currentItem();
if (!item)
{
#ifdef MSG_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
@ -440,7 +452,9 @@ QTreeWidgetItem *MessengerWindow::getCurrentPeer(bool &isOnline)
if ((!parent) ||
(parent == peerWidget->invisibleRootItem()))
{
#ifdef MSG_DEBUG
std::cerr << "Selected Parent Invalid Item" << std::endl;
#endif
return NULL;
}
@ -453,10 +467,14 @@ void MessengerWindow::removefriend2()
{
bool isOnline;
QTreeWidgetItem *c = getCurrentPeer(isOnline);
#ifdef MSG_DEBUG
std::cerr << "MessengerWindow::removefriend2()" << std::endl;
#endif
if (!c)
{
#ifdef MSG_DEBUG
std::cerr << "MessengerWindow::removefriend2() Noone Selected -- sorry" << std::endl;
#endif
return;
}
rsPeers->removeFriend(getMessengerPeerRsCertId(c));

View File

@ -29,6 +29,10 @@
#include "rsiface/rsmsgs.h"
#include "rsiface/rspeers.h"
/*****
* #define MSG_DEBUG 1
****/
/** Constructor */
MsgFeed::MsgFeed(QWidget *parent)
: MainPage (parent)
@ -78,20 +82,27 @@ MsgFeed::MsgFeed(QWidget *parent)
/* FeedHolder Functions (for FeedItem functionality) */
void MsgFeed::deleteFeedItem(QWidget *item, uint32_t type)
{
#ifdef MSG_DEBUG
std::cerr << "MsgFeed::deleteFeedItem()";
std::cerr << std::endl;
#endif
}
void MsgFeed::openChat(std::string peerId)
{
#ifdef MSG_DEBUG
std::cerr << "MsgFeed::openChat()";
std::cerr << std::endl;
#endif
}
void MsgFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef MSG_DEBUG
std::cerr << "MsgFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
@ -103,8 +114,11 @@ void MsgFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
void MsgFeed::newMsg()
{
#ifdef MSG_DEBUG
std::cerr << "MsgFeed::newMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);
msgDialog->setMsgType(FEEDHOLDER_MSG_MESSAGE);
@ -156,8 +170,10 @@ void MsgFeed::updateSort()
void MsgFeed::updatePeerIds()
{
#ifdef MSG_DEBUG
std::cerr << "MsgFeed::updatePeerIds()";
std::cerr << std::endl;
#endif
int selectIdx = 0; /* ALL */
std::string peerId;

View File

@ -52,6 +52,10 @@
RsCertId getNeighRsCertId(QTreeWidgetItem *i);
/******
* #define NET_DEBUG 1
*****/
/** Constructor */
NetworkDialog::NetworkDialog(QWidget *parent)
: MainPage(parent), connectdialog(NULL)
@ -139,7 +143,9 @@ void NetworkDialog::connecttreeWidgetCostumPopupMenu( QPoint point )
/** Shows Peer Information/Auth Dialog */
void NetworkDialog::peerdetails()
{
#ifdef NET_DEBUG
std::cerr << "ConnectionsDialog::peerdetails()" << std::endl;
#endif
QTreeWidgetItem *wi = getCurrentNeighbour();
if (!wi)
@ -155,7 +161,9 @@ void NetworkDialog::peerdetails()
/** Shows Peer Information/Auth Dialog */
void NetworkDialog::showpeerdetails(std::string id)
{
#ifdef NET_DEBUG
std::cerr << "ConnectionsDialog::showpeerdetails()" << std::endl;
#endif
if ((connectdialog) && (connectdialog -> loadPeer(id)))
{
connectdialog->show();
@ -392,7 +400,9 @@ QTreeWidgetItem *NetworkDialog::getCurrentNeighbour()
QTreeWidgetItem *item = connectWidget -> currentItem();
if (!item)
{
#ifdef NET_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
@ -418,7 +428,9 @@ RsCertId getNeighRsCertId(QTreeWidgetItem *i)
std::string NetworkDialog::loadneighbour()
{
#ifdef NET_DEBUG
std::cerr << "ConnectionsDialog::loadneighbour()" << std::endl;
#endif
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Certificate"), "",
tr("Certificates (*.pqi *.pem)"));
@ -434,7 +446,9 @@ std::string NetworkDialog::loadneighbour()
void NetworkDialog::addneighbour()
{
QTreeWidgetItem *c = getCurrentNeighbour();
#ifdef NET_DEBUG
std::cerr << "ConnectionsDialog::addneighbour()" << std::endl;
#endif
/*
rsServer->NeighAddFriend(getNeighRsCertId(c));
*/
@ -443,7 +457,9 @@ void NetworkDialog::addneighbour()
void NetworkDialog::authneighbour()
{
QTreeWidgetItem *c = getCurrentNeighbour();
#ifdef NET_DEBUG
std::cerr << "ConnectionsDialog::authneighbour()" << std::endl;
#endif
/*
RsAuthId code;
rsServer->NeighAuthFriend(getNeighRsCertId(c), code);

View File

@ -46,6 +46,10 @@ const uint32_t NEWSFEED_CHANMSGLIST = 0x0005;
const uint32_t NEWSFEED_BLOGMSGLIST = 0x0006;
const uint32_t NEWSFEED_MESSAGELIST = 0x0007;
/*****
* #define NEWS_DEBUG 1
****/
/** Constructor */
NewsFeed::NewsFeed(QWidget *parent)
: MainPage (parent)
@ -154,8 +158,11 @@ void NewsFeed::addFeedItemPeerConnect(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(pi);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemPeerConnect()";
std::cerr << std::endl;
#endif
}
@ -171,8 +178,10 @@ void NewsFeed::addFeedItemPeerDisconnect(RsFeedItem &fi)
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemPeerDisconnect()";
std::cerr << std::endl;
#endif
}
@ -187,8 +196,10 @@ void NewsFeed::addFeedItemPeerHello(RsFeedItem &fi)
mLayout->addWidget(pi);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemPeerHello()";
std::cerr << std::endl;
#endif
}
@ -202,8 +213,10 @@ void NewsFeed::addFeedItemPeerNew(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(pi);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemPeerNew()";
std::cerr << std::endl;
#endif
}
@ -217,8 +230,10 @@ void NewsFeed::addFeedItemChanNew(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(cni);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemChanNew()";
std::cerr << std::endl;
#endif
}
@ -232,8 +247,10 @@ void NewsFeed::addFeedItemChanUpdate(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(cni);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemChanUpdate()";
std::cerr << std::endl;
#endif
}
@ -247,8 +264,10 @@ void NewsFeed::addFeedItemChanMsg(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(cm);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemChanMsg()";
std::cerr << std::endl;
#endif
}
@ -264,8 +283,10 @@ void NewsFeed::addFeedItemForumNew(RsFeedItem &fi)
mLayout->addWidget(fni);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemForumNew()";
std::cerr << std::endl;
#endif
}
@ -280,8 +301,10 @@ void NewsFeed::addFeedItemForumUpdate(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(fni);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemForumUpdate()";
std::cerr << std::endl;
#endif
}
@ -295,8 +318,10 @@ void NewsFeed::addFeedItemForumMsg(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(fm);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemForumMsg()";
std::cerr << std::endl;
#endif
}
@ -310,15 +335,19 @@ void NewsFeed::addFeedItemBlogMsg(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(bm);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemBlogMsg()";
std::cerr << std::endl;
#endif
}
void NewsFeed::addFeedItemChatNew(RsFeedItem &fi)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemChatNew()";
std::cerr << std::endl;
#endif
}
@ -332,15 +361,19 @@ void NewsFeed::addFeedItemMessage(RsFeedItem &fi)
/* add to layout */
mLayout->addWidget(mi);
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemMessage()";
std::cerr << std::endl;
#endif
}
void NewsFeed::addFeedItemFilesNew(RsFeedItem &fi)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::addFeedItemFilesNew()";
std::cerr << std::endl;
#endif
}
@ -349,20 +382,26 @@ void NewsFeed::addFeedItemFilesNew(RsFeedItem &fi)
/* FeedHolder Functions (for FeedItem functionality) */
void NewsFeed::deleteFeedItem(QWidget *item, uint32_t type)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::deleteFeedItem()";
std::cerr << std::endl;
#endif
}
void NewsFeed::openChat(std::string peerId)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::openChat()";
std::cerr << std::endl;
#endif
}
void NewsFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef NEWS_DEBUG
std::cerr << "NewsFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);

View File

@ -57,6 +57,11 @@
#define IMAGE_ONLINE ":/images/donline.png"
#define IMAGE_OFFLINE ":/images/dhidden.png"
/******
* #define PEERS_DEBUG 1
*****/
/** Constructor */
PeersDialog::PeersDialog(QWidget *parent)
: MainPage(parent), chatDialog(NULL)
@ -321,10 +326,15 @@ std::string getPeerRsCertId(QTreeWidgetItem *i)
void PeersDialog::exportfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::exportfriend()" << std::endl;
#endif
if (!c)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::exportfriend() Noone Selected -- sorry" << std::endl;
#endif
return;
}
@ -335,8 +345,10 @@ void PeersDialog::exportfriend()
std::string file = fileName.toStdString();
if (file != "")
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::exportfriend() Saving to: " << file << std::endl;
std::cerr << std::endl;
#endif
if (rsPeers)
{
rsPeers->SaveCertificateToFile(id, file);
@ -387,7 +399,9 @@ void PeersDialog::chatfriend()
void PeersDialog::msgfriend()
{
#ifdef PEERS_DEBUG
std::cerr << "SharedFilesDialog::msgfriend()" << std::endl;
#endif
QTreeWidgetItem *i = getCurrentPeer();
@ -418,10 +432,13 @@ QTreeWidgetItem *PeersDialog::getCurrentPeer()
QTreeWidgetItem *item = peerWidget -> currentItem();
if (!item)
{
#ifdef PEERS_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
#ifdef PEERS_DEBUG
/* Display the columns of this item. */
std::ostringstream out;
out << "CurrentPeerItem: " << std::endl;
@ -432,6 +449,7 @@ QTreeWidgetItem *PeersDialog::getCurrentPeer()
out << "\t" << i << ":" << txt.toStdString() << std::endl;
}
std::cerr << out.str();
#endif
return item;
}
@ -450,10 +468,14 @@ QTreeWidgetItem *PeersDialog::getCurrentPeer()
void PeersDialog::removefriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::removefriend()" << std::endl;
#endif
if (!c)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::removefriend() Noone Selected -- sorry" << std::endl;
#endif
return;
}
@ -467,7 +489,9 @@ void PeersDialog::removefriend()
void PeersDialog::allowfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::allowfriend()" << std::endl;
#endif
/*
bool accept = true;
rsServer->FriendStatus(getPeerRsCertId(c), accept);
@ -478,10 +502,14 @@ void PeersDialog::allowfriend()
void PeersDialog::connectfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend()" << std::endl;
#endif
if (!c)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::connectfriend() Noone Selected -- sorry" << std::endl;
#endif
return;
}
@ -494,7 +522,9 @@ void PeersDialog::connectfriend()
void PeersDialog::setaddressfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::setaddressfriend()" << std::endl;
#endif
/* need to get the input address / port */
/*
@ -507,7 +537,9 @@ void PeersDialog::setaddressfriend()
void PeersDialog::trustfriend()
{
QTreeWidgetItem *c = getCurrentPeer();
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::trustfriend()" << std::endl;
#endif
/*
bool trust = true;
rsServer->FriendTrust(getPeerRsCertId(c), trust);
@ -520,7 +552,9 @@ void PeersDialog::trustfriend()
void PeersDialog::configurefriend()
{
/* display Dialog */
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog::configurefriend()" << std::endl;
#endif
QTreeWidgetItem *c = getCurrentPeer();

View File

@ -34,6 +34,11 @@ const uint32_t PEERSFEED_MODE_ONLINE = 0x0001;
const uint32_t PEERSFEED_MODE_FOF = 0x0002;
const uint32_t PEERSFEED_MODE_ALL = 0x0003;
/*****
* #define PEERS_DEBUG 1
****/
/** Constructor */
PeersFeed::PeersFeed(QWidget *parent)
: MainPage (parent)
@ -77,20 +82,27 @@ PeersFeed::PeersFeed(QWidget *parent)
/* FeedHolder Functions (for FeedItem functionality) */
void PeersFeed::deleteFeedItem(QWidget *item, uint32_t type)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersFeed::deleteFeedItem()";
std::cerr << std::endl;
#endif
}
void PeersFeed::openChat(std::string peerId)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersFeed::openChat()";
std::cerr << std::endl;
#endif
}
void PeersFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef PEERS_DEBUG
std::cerr << "PeersFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);

View File

@ -69,6 +69,11 @@
#define PHOTO_LIST_COL_PEERID 6
#define PHOTO_LIST_COL_PHOTOID 7
/******
* #define PHOTO_DEBUG 1
*****/
/** Constructor */
PhotoDialog::PhotoDialog(QWidget *parent)
@ -267,7 +272,9 @@ void PhotoDialog::addShows(std::string id)
void PhotoDialog::updatePhotoList()
{
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList()" << std::endl;
#endif
/* get current item */
QTreeWidgetItem *item = ui.peerTreeWidget->currentItem();
@ -275,7 +282,9 @@ void PhotoDialog::updatePhotoList()
if (!item)
{
/* leave current list */
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() No Current item -> leave" << std::endl;
#endif
return;
}
@ -286,11 +295,15 @@ void PhotoDialog::updatePhotoList()
if ((mCurrentPID == pid) && (mCurrentSID == sid))
{
/* still good */
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() List still good!" << std::endl;
#endif
return;
}
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() pid: " << pid << " sid: " << sid << std::endl;
#endif
/* get the list of photos */
ui.photoTreeWidget->clear();
@ -298,7 +311,9 @@ void PhotoDialog::updatePhotoList()
if (sid != "")
{
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() SID -> showing show" << std::endl;
#endif
/* load up show list */
RsPhotoShowDetails detail;
rsPhoto->getShowDetails(pid, sid, detail);
@ -311,7 +326,9 @@ void PhotoDialog::updatePhotoList()
if (!rsPhoto->getPhotoDetails(pid, sit->photoId, photoDetail))
{
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() getPhotoDetails: " << sit->photoId << " FAILED" << std::endl;
#endif
continue;
}
@ -350,7 +367,9 @@ void PhotoDialog::updatePhotoList()
}
else
{
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() No SID -> show all" << std::endl;
#endif
std::list<std::string> photoIds;
std::list<std::string>::iterator pit;
@ -361,7 +380,9 @@ void PhotoDialog::updatePhotoList()
if (!rsPhoto->getPhotoDetails(pid, *pit, photoDetail))
{
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() getPhotoDetails: " << *pit << " FAILED" << std::endl;
#endif
continue;
}
@ -396,7 +417,9 @@ void PhotoDialog::updatePhotoList()
QString::fromStdString(photoDetail.hash));
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::updatePhotoList() added Item: " << *pit << std::endl;
#endif
items.append(photoItem);
}
@ -428,11 +451,14 @@ QTreeWidgetItem *PhotoDialog::getCurrentLine()
QTreeWidgetItem *item = peerWidget -> currentItem();
if (!item)
{
#ifdef PHOTO_DEBUG
std::cerr << "Invalid Current Item" << std::endl;
#endif
return NULL;
}
/* Display the columns of this item. */
#ifdef PHOTO_DEBUG
std::ostringstream out;
out << "CurrentPeerItem: " << std::endl;
@ -442,13 +468,16 @@ QTreeWidgetItem *PhotoDialog::getCurrentLine()
out << "\t" << i << ":" << txt.toStdString() << std::endl;
}
std::cerr << out.str();
#endif
return item;
}
void PhotoDialog::removePhoto()
{
QTreeWidgetItem *c = getCurrentLine();
#ifdef PHOTO_DEBUG
std::cerr << "PhotoDialog::removePhoto()" << std::endl;
#endif
}

View File

@ -28,6 +28,11 @@
#include "rsiface/rsfiles.h"
/*****
* #define TRANSFER_DEBUG 1
****/
/** Constructor */
TransferFeed::TransferFeed(QWidget *parent)
: MainPage (parent)
@ -92,20 +97,27 @@ TransferFeed::TransferFeed(QWidget *parent)
/* FeedHolder Functions (for FeedItem functionality) */
void TransferFeed::deleteFeedItem(QWidget *item, uint32_t type)
{
#ifdef TRANSFER_DEBUG
std::cerr << "TransferFeed::deleteFeedItem()";
std::cerr << std::endl;
#endif
}
void TransferFeed::openChat(std::string peerId)
{
#ifdef TRANSFER_DEBUG
std::cerr << "TransferFeed::openChat()";
std::cerr << std::endl;
#endif
}
void TransferFeed::openMsg(uint32_t type, std::string grpId, std::string inReplyTo)
{
#ifdef TRANSFER_DEBUG
std::cerr << "TransferFeed::openMsg()";
std::cerr << std::endl;
#endif
GeneralMsgDialog *msgDialog = new GeneralMsgDialog(NULL);

View File

@ -27,7 +27,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
BlogMsgItem::BlogMsgItem(FeedHolder *parent, uint32_t feedId, std::string peerId, std::string msgId, bool isHome)

View File

@ -25,7 +25,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ChanGroupItem::ChanGroupItem(std::string groupName)

View File

@ -25,7 +25,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ChanMenuItem::ChanMenuItem(std::string chanId)

View File

@ -29,7 +29,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ChanMsgItem::ChanMsgItem(FeedHolder *parent, uint32_t feedId, std::string chanId, std::string msgId, bool isHome)

View File

@ -27,7 +27,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ChanNewItem::ChanNewItem(FeedHolder *parent, uint32_t feedId, std::string chanId, bool isHome, bool isNew)

View File

@ -27,7 +27,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ForumMsgItem::ForumMsgItem(FeedHolder *parent, uint32_t feedId, std::string forumId, std::string postId, bool isHome)

View File

@ -27,7 +27,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
ForumNewItem::ForumNewItem(FeedHolder *parent, uint32_t feedId, std::string forumId, bool isHome, bool isNew)

View File

@ -30,7 +30,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, std::string msgId, bool isHome)

View File

@ -28,7 +28,9 @@
#include <iostream>
#include <sstream>
#define DEBUG_ITEM 1
/*****
* #define DEBUG_ITEM 1
****/
/** Constructor */
PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, std::string peerId, uint32_t type, bool isHome)

View File

@ -29,7 +29,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/** Constructor */
SubDestItem::SubDestItem(uint32_t type, std::string groupId, std::string inReplyTo)

View File

@ -26,7 +26,9 @@
#include <iostream>
#define DEBUG_ITEM 1
/****
* #define DEBUG_ITEM 1
****/
/*******************************************************************
* SubFileItem fully controls the file transfer from the gui side

View File

@ -4,11 +4,14 @@
#include <QtGui>
#include <iostream>
#include <sstream>
#include <math.h>
/*****
* #define RDM_DEBUG
****/
RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
: QAbstractItemModel(parent),
RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */
@ -544,7 +547,9 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
/* Callback from */
void RemoteDirModel::preMods()
{
#ifdef RDM_DEBUG
std::cerr << "RemoteDirModel::preMods()" << std::endl;
#endif
//modelAboutToBeReset();
reset();
layoutAboutToBeChanged();
@ -553,7 +558,9 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
/* Callback from */
void RemoteDirModel::postMods()
{
#ifdef RDM_DEBUG
std::cerr << "RemoteDirModel::postMods()" << std::endl;
#endif
//modelReset();
layoutChanged();
//reset();
@ -562,8 +569,10 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
void RemoteDirModel::update (const QModelIndex &index )
{
#ifdef RDM_DEBUG
//std::cerr << "Directory Request(" << id << ") : ";
//std::cerr << path << std::endl;
#endif
//rsFiles -> RequestDirectories(id, path, 1);
}
@ -571,7 +580,9 @@ void RemoteDirModel::downloadSelected(QModelIndexList list)
{
if (!RemoteMode)
{
#ifdef RDM_DEBUG
std::cerr << "Cannot download from local" << std::endl;
#endif
}
/* so for all the selected .... get the name out,
@ -618,10 +629,14 @@ void RemoteDirModel::downloadSelected(QModelIndexList list)
void RemoteDirModel::recommendSelected(QModelIndexList list)
{
#ifdef RDM_DEBUG
std::cerr << "recommendSelected()" << std::endl;
#endif
if (RemoteMode)
{
#ifdef RDM_DEBUG
std::cerr << "Cannot recommend remote! (should download)" << std::endl;
#endif
}
/* Fire off requests */
QModelIndexList::iterator it;
@ -646,24 +661,32 @@ void RemoteDirModel::recommendSelected(QModelIndexList list)
continue;
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::FileRecommend:::: " << std::endl;
std::cerr << "Name: " << details.name << std::endl;
std::cerr << "Hash: " << details.hash << std::endl;
std::cerr << "Size: " << details.count << std::endl;
std::cerr << "Path: " << details.path << std::endl;
#endif
rsFiles -> FileRecommend(details.name, details.hash, details.count);
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::Done FileRecommend" << std::endl;
#endif
}
void RemoteDirModel::recommendSelectedOnly(QModelIndexList list)
{
#ifdef RDM_DEBUG
std::cerr << "recommendSelectedOnly()" << std::endl;
#endif
if (RemoteMode)
{
#ifdef RDM_DEBUG
std::cerr << "Cannot recommend remote! (should download)" << std::endl;
#endif
}
rsFiles->ClearInRecommend();
@ -690,16 +713,20 @@ void RemoteDirModel::recommendSelectedOnly(QModelIndexList list)
continue;
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::FileRecommend:::: " << std::endl;
std::cerr << "Name: " << details.name << std::endl;
std::cerr << "Hash: " << details.hash << std::endl;
std::cerr << "Size: " << details.count << std::endl;
std::cerr << "Path: " << details.path << std::endl;
#endif
rsFiles -> FileRecommend(details.name, details.hash, details.count);
rsFiles -> SetInRecommend(details.name, true);
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::Done FileRecommend" << std::endl;
#endif
}
#endif
@ -715,10 +742,14 @@ void RemoteDirModel::openSelected(QModelIndexList list)
void RemoteDirModel::getFilePaths(QModelIndexList list, std::list<std::string> &fullpaths)
{
#ifdef RDM_DEBUG
std::cerr << "RemoteDirModel::getFilePaths()" << std::endl;
#endif
if (RemoteMode)
{
#ifdef RDM_DEBUG
std::cerr << "No File Paths for remote files" << std::endl;
#endif
return;
}
/* translate */
@ -733,32 +764,42 @@ void RemoteDirModel::getFilePaths(QModelIndexList list, std::list<std::string> &
if (!rsFiles->RequestDirDetails(ref, details, flags))
{
#ifdef RDM_DEBUG
std::cerr << "getFilePaths() Bad Request" << std::endl;
#endif
continue;
}
if (details.type != DIR_TYPE_FILE)
{
#ifdef RDM_DEBUG
std::cerr << "getFilePaths() Not File" << std::endl;
#endif
continue; /* not file! */
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::File Details:::: " << std::endl;
std::cerr << "Name: " << details.name << std::endl;
std::cerr << "Hash: " << details.hash << std::endl;
std::cerr << "Size: " << details.count << std::endl;
std::cerr << "Path: " << details.path << std::endl;
#endif
std::string filepath = details.path + "/";
filepath += details.name;
#ifdef RDM_DEBUG
std::cerr << "Constructed FilePath: " << filepath << std::endl;
#endif
if (fullpaths.end() == std::find(fullpaths.begin(), fullpaths.end(), filepath))
{
fullpaths.push_back(filepath);
}
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::Done getFilePaths" << std::endl;
#endif
}
/* Drag and Drop Functionality */
@ -790,21 +831,27 @@ QMimeData * RemoteDirModel::mimeData ( const QModelIndexList & indexes ) const
continue;
}
#ifdef RDM_DEBUG
std::cerr << "::::::::::::FileDrag:::: " << std::endl;
std::cerr << "Name: " << details.name << std::endl;
std::cerr << "Hash: " << details.hash << std::endl;
std::cerr << "Size: " << details.count << std::endl;
std::cerr << "Path: " << details.path << std::endl;
#endif
if (details.type != DIR_TYPE_FILE)
{
#ifdef RDM_DEBUG
std::cerr << "RemoteDirModel::mimeData() Not File" << std::endl;
#endif
continue; /* not file! */
}
if (drags.end() != (dit = drags.find(details.hash)))
{
#ifdef RDM_DEBUG
std::cerr << "RemoteDirModel::mimeData() Duplicate" << std::endl;
#endif
continue; /* duplicate */
}
@ -835,11 +882,13 @@ QMimeData * RemoteDirModel::mimeData ( const QModelIndexList & indexes ) const
text += line;
}
#ifdef RDM_DEBUG
std::cerr << "Created MimeData:";
std::cerr << std::endl;
std::cerr << text;
std::cerr << std::endl;
#endif
QMimeData *data = new QMimeData();
data->setData("application/x-rsfilelist", QByteArray(text.c_str()));

View File

@ -20,6 +20,10 @@
#include <iostream>
#include <sstream>
/*****
* #define NOTIFY_DEBUG
****/
void NotifyQt::notifyErrorMsg(int list, int type, std::string msg)
{
(void) list;
@ -37,7 +41,10 @@ void NotifyQt::notifyChat()
void NotifyQt::notifyListChange(int list, int type)
{
(void) type;
#ifdef NOTIFY_DEBUG
std::cerr << "NotifyQt::notifyListChange()" << std::endl;
#endif
switch(list)
{
case NOTIFY_LIST_NEIGHBOURS:
@ -70,7 +77,9 @@ void NotifyQt::notifyListChange(int list, int type)
void NotifyQt::notifyListPreChange(int list, int type)
{
#ifdef NOTIFY_DEBUG
std::cerr << "NotifyQt::notifyListPreChange()" << std::endl;
#endif
switch(list)
{
case NOTIFY_LIST_NEIGHBOURS:
@ -263,10 +272,12 @@ void NotifyQt::preDisplayDirectories()
{
//iface->lockData(); /* Lock Interface */
#ifdef NOTIFY_DEBUG
std::ostringstream out;
out << "NotifyQt::preDisplayDirectories()" << std::endl;
std::cerr << out.str();
#endif
//iface->unlockData(); /* UnLock Interface */
@ -282,10 +293,12 @@ void NotifyQt::displayDirectories()
{
//iface->lockData(); /* Lock Interface */
#ifdef NOTIFY_DEBUG
std::ostringstream out;
out << "NotifyQt::displayDirectories()" << std::endl;
std::cerr << out.str();
#endif
//iface->unlockData(); /* UnLock Interface */
@ -302,8 +315,10 @@ void NotifyQt::displaySearch()
{
iface->lockData(); /* Lock Interface */
#ifdef NOTIFY_DEBUG
std::ostringstream out;
std::cerr << out.str();
#endif
iface->unlockData(); /* UnLock Interface */
}
@ -319,8 +334,10 @@ void NotifyQt::displayChat()
{
iface->lockData(); /* Lock Interface */
#ifdef NOTIFY_DEBUG
std::ostringstream out;
std::cerr << out.str();
#endif
iface->unlockData(); /* UnLock Interface */
@ -333,8 +350,10 @@ void NotifyQt::displayChannels()
{
iface->lockData(); /* Lock Interface */
#ifdef NOTIFY_DEBUG
std::ostringstream out;
std::cerr << out.str();
#endif
iface->unlockData(); /* UnLock Interface */