further log cleanings

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2235 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-02-07 23:01:46 +00:00
parent a433eb6abd
commit 5aff139382
5 changed files with 86 additions and 89 deletions

View File

@ -361,16 +361,12 @@ bool AuthGPG::storeAllKeys_locked()
nu.fpr = mainsubkey->fpr; nu.fpr = mainsubkey->fpr;
#ifdef GPG_DEBUG #ifdef GPG_DEBUG
std::cerr << "MAIN KEYID: " << nu.id; std::cerr << "MAIN KEYID: " << nu.id << " FPR: " << nu.fpr << std::endl;
std::cerr << " FPR: " << nu.fpr;
std::cerr << std::endl;
gpgme_subkey_t subkeylist = KEY->subkeys; gpgme_subkey_t subkeylist = KEY->subkeys;
while(subkeylist != NULL) while(subkeylist != NULL)
{ {
std::cerr << "\tKEYID: " << subkeylist->keyid; std::cerr << "\tKEYID: " << subkeylist->keyid << " FPR: " << subkeylist->fpr << std::endl;
std::cerr << " FPR: " << subkeylist->fpr;
std::cerr << std::endl;
subkeylist = subkeylist->next; subkeylist = subkeylist->next;
} }
@ -646,22 +642,19 @@ bool AuthGPG::DoOwnSignature_locked(const void *data, unsigned int datalen, void
gpgme_signers_clear(CTX); gpgme_signers_clear(CTX);
if (GPG_ERR_NO_ERROR != gpgme_signers_add(CTX, mOwnGpgCert.key)) if (GPG_ERR_NO_ERROR != gpgme_signers_add(CTX, mOwnGpgCert.key))
{ {
std::cerr << "AuthGPG::DoOwnSignature() Error Adding Signer"; std::cerr << "AuthGPG::DoOwnSignature() Error Adding Signer" << std::endl;
std::cerr << std::endl;
} }
gpgme_data_t gpgmeData; gpgme_data_t gpgmeData;
gpgme_data_t gpgmeSig; gpgme_data_t gpgmeSig;
if (GPG_ERR_NO_ERROR != gpgme_data_new_from_mem(&gpgmeData, (const char *) data, datalen, 1)) if (GPG_ERR_NO_ERROR != gpgme_data_new_from_mem(&gpgmeData, (const char *) data, datalen, 1))
{ {
std::cerr << "Error create Data"; std::cerr << "Error create Data" << std::endl;
std::cerr << std::endl;
} }
if (GPG_ERR_NO_ERROR != gpgme_data_new(&gpgmeSig)) if (GPG_ERR_NO_ERROR != gpgme_data_new(&gpgmeSig))
{ {
std::cerr << "Error create Sig"; std::cerr << "Error create Sig" << std::endl;
std::cerr << std::endl;
} }
/* move string data to gpgmeData */ /* move string data to gpgmeData */
@ -1110,22 +1103,18 @@ std::string AuthGPG::SaveCertificateToString(std::string id)
if (GPG_ERR_NO_ERROR != gpgme_data_new (&gpgmeData)) if (GPG_ERR_NO_ERROR != gpgme_data_new (&gpgmeData))
{ {
std::cerr << "Error create Data"; std::cerr << "Error create Data" << std::endl;
std::cerr << std::endl;
} }
gpgme_set_armor (CTX, 1); gpgme_set_armor (CTX, 1);
if (GPG_ERR_NO_ERROR != gpgme_op_export_ext (CTX, pattern, 0, gpgmeData)) if (GPG_ERR_NO_ERROR != gpgme_op_export_ext (CTX, pattern, 0, gpgmeData))
{ {
std::cerr << "Error export Data"; std::cerr << "Error export Data" << std::endl;
std::cerr << std::endl;
} }
gpgme_data_write (gpgmeData, "", 1); // to be able to convert it into a string gpgme_data_write (gpgmeData, "", 1); // to be able to convert it into a string
fflush (NULL); fflush (NULL);
fputs ("Begin Result:\n", stdout); showData (gpgmeData);
showData (gpgmeData);
fputs ("End Result.\n", stdout);
size_t len = 0; size_t len = 0;
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len); char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);

View File

@ -504,7 +504,9 @@ bool p3Config::saveConfiguration()
if(!written) if(!written)
return false ; return false ;
std::cerr << "renaming " << fnametmp.c_str() << " to " << fname.c_str() << std::endl ; #ifdef CONFIG_DEBUG
std::cerr << "renaming " << fnametmp.c_str() << " to " << fname.c_str() << std::endl;
#endif
if(!RsDirUtil::renameFile(fnametmp,fname)) if(!RsDirUtil::renameFile(fnametmp,fname))
{ {
@ -517,8 +519,9 @@ bool p3Config::saveConfiguration()
getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "File rename error", "Error while renaming file " + fname + ": got error "+errlog.str()); getPqiNotify()->AddSysMessage(0, RS_SYS_WARNING, "File rename error", "Error while renaming file " + fname + ": got error "+errlog.str());
return false ; return false ;
} }
#ifdef CONFIG_DEBUG
std::cerr << "Successfully wrote p3config file " << fname.c_str() << std::endl ; std::cerr << "Successfully wrote p3config file " << fname.c_str() << std::endl ;
#endif
/* else okay */ /* else okay */
return true; return true;
} }

View File

@ -37,8 +37,6 @@
#define RSSERIAL_DEBUG 1 #define RSSERIAL_DEBUG 1
***/ ***/
#define RSSERIAL_DEBUG 1
#include <iostream> #include <iostream>
/*************************************************************************/ /*************************************************************************/
@ -618,7 +616,7 @@ bool RsDiscSerialiser::serialiseHeartbeat(RsDiscHeartbeat *item, void *data, uin
ok &= setRsItemHeader(data, *pktsize, item->PacketId(), *pktsize); ok &= setRsItemHeader(data, *pktsize, item->PacketId(), *pktsize);
#ifdef RSSERIAL_DEBUG #ifdef RSSERIAL_DEBUG
std::cerr << "RsDiscSerialiser::serialiseHeartbeat() Header: " << ok << std::endl; std::cerr << "RsDiscSerialiser::serialiseHeartbeat() Header: " << ok << std::endl;
std::cerr << "RsDiscSerialiser::serialiseHeartbeat() Size: " << tlvsize << std::endl; std::cerr << "RsDiscSerialiser::serialiseHeartbeat() Size: " << tlvsize << std::endl;
#endif #endif

View File

@ -247,7 +247,9 @@ void p3turtle::autoWash()
if(it == _incoming_file_hashes.end()) if(it == _incoming_file_hashes.end())
{ {
#ifdef P3TURTLE_DEBUG
std::cerr << "p3turtle: asked to stop monitoring file hash " << _hashes_to_remove[i] << ", but this hash is actually not handled by the turtle router." << std::endl ; std::cerr << "p3turtle: asked to stop monitoring file hash " << _hashes_to_remove[i] << ", but this hash is actually not handled by the turtle router." << std::endl ;
#endif
continue ; continue ;
} }

View File

@ -369,10 +369,9 @@ void PeersDialog::insertPeers()
//add the gpg friends //add the gpg friends
for(it = gpgFriends.begin(); it != gpgFriends.end(); it++) { for(it = gpgFriends.begin(); it != gpgFriends.end(); it++) {
std::cerr << "" << *it << std::endl; #ifdef PEERS_DEBUG
// if (*it == rsPeers->getGPGOwnId()) { std::cerr << "PeersDialog::insertPeers() inserting gpg_id : " << *it << std::endl;
// continue; #endif
// }
/* make a widget per friend */ /* make a widget per friend */
QTreeWidgetItem *gpg_item; QTreeWidgetItem *gpg_item;
@ -437,7 +436,9 @@ void PeersDialog::insertPeers()
RsPeerDetails sslDetail; RsPeerDetails sslDetail;
if (!rsPeers->getPeerDetails(*sslIt, sslDetail) || !rsPeers->isFriend(*sslIt)) { if (!rsPeers->getPeerDetails(*sslIt, sslDetail) || !rsPeers->isFriend(*sslIt)) {
#ifdef PEERS_DEBUG
std::cerr << "Removing widget from the view : id : " << *sslIt << std::endl; std::cerr << "Removing widget from the view : id : " << *sslIt << std::endl;
#endif
//child has disappeared, remove it from the gpg_item //child has disappeared, remove it from the gpg_item
gpg_item->removeChild(sslItem); gpg_item->removeChild(sslItem);
} }
@ -575,8 +576,7 @@ void PeersDialog::exportfriend()
if (file != "") if (file != "")
{ {
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::exportfriend() Saving to: " << file << std::endl; std::cerr << "PeersDialog::exportfriend() Saving to: " << file << std::endl;
std::cerr << std::endl;
#endif #endif
if (rsPeers) if (rsPeers)
{ {
@ -841,7 +841,9 @@ void PeersDialog::updatePeersCustomStateString(const QString& peer_id)
void PeersDialog::updatePeersAvatar(const QString& peer_id) void PeersDialog::updatePeersAvatar(const QString& peer_id)
{ {
#ifdef PEERS_DEBUG
std::cerr << "PeersDialog: Got notified of new avatar for peer " << peer_id.toStdString() << std::endl ; std::cerr << "PeersDialog: Got notified of new avatar for peer " << peer_id.toStdString() << std::endl ;
#endif
PopupChatDialog *pcd = getPrivateChat(peer_id.toStdString(),rsPeers->getPeerName(peer_id.toStdString()), 0); PopupChatDialog *pcd = getPrivateChat(peer_id.toStdString(),rsPeers->getPeerName(peer_id.toStdString()), 0);
pcd->updatePeerAvatar(peer_id.toStdString()); pcd->updatePeerAvatar(peer_id.toStdString());
@ -856,7 +858,9 @@ void PeersDialog::updatePeerStatusString(const QString& peer_id,const QString& s
} }
else else
{ {
#ifdef PEERS_DEBUG
std::cerr << "Updating public chat msg from peer " << rsPeers->getPeerName(peer_id.toStdString()) << ": " << status_string.toStdString() << std::endl ; std::cerr << "Updating public chat msg from peer " << rsPeers->getPeerName(peer_id.toStdString()) << ": " << status_string.toStdString() << std::endl ;
#endif
updateStatusString(status_string) ; updateStatusString(status_string) ;
} }
@ -866,9 +870,9 @@ void PeersDialog::insertChat()
{ {
if (!rsMsgs->chatAvailable()) if (!rsMsgs->chatAvailable())
{ {
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "no chat available." << std::endl ; std::cerr << "no chat available." << std::endl ;
#endif #endif
return; return;
} }
@ -878,9 +882,10 @@ void PeersDialog::insertChat()
std::cerr << "could not get new chat." << std::endl ; std::cerr << "could not get new chat." << std::endl ;
return; return;
} }
#ifdef PEERS_DEBUG
std::cerr << "got new chat." << std::endl ; std::cerr << "got new chat." << std::endl;
QTextEdit *msgWidget = ui.msgText; #endif
QTextEdit *msgWidget = ui.msgText;
std::list<ChatInfo>::iterator it; std::list<ChatInfo>::iterator it;
/** A RshareSettings object used for saving/loading settings */ /** A RshareSettings object used for saving/loading settings */
@ -891,9 +896,9 @@ void PeersDialog::insertChat()
for(it = newchat.begin(); it != newchat.end(); it++) for(it = newchat.begin(); it != newchat.end(); it++)
{ {
std::string msg(it->msg.begin(), it->msg.end()); std::string msg(it->msg.begin(), it->msg.end());
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::insertChat(): " << msg << std::endl; std::cerr << "PeersDialog::insertChat(): " << msg << std::endl;
#endif #endif
/* are they private? */ /* are they private? */
if (it->chatflags & RS_CHAT_PRIVATE) if (it->chatflags & RS_CHAT_PRIVATE)
@ -1003,9 +1008,9 @@ void PeersDialog::sendMsg()
//historyKeeper.addMessage("THIS", "ALL", lineWidget->toHtml() ); //historyKeeper.addMessage("THIS", "ALL", lineWidget->toHtml() );
std::string msg(ci.msg.begin(), ci.msg.end()); std::string msg(ci.msg.begin(), ci.msg.end());
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::sendMsg(): " << msg << std::endl; std::cerr << "PeersDialog::sendMsg(): " << msg << std::endl;
#endif #endif
rsMsgs -> ChatSend(ci); rsMsgs -> ChatSend(ci);
ui.lineEdit->clear(); ui.lineEdit->clear();
@ -1087,9 +1092,9 @@ void PeersDialog::insertSendList()
void PeersDialog::toggleSendItem( QTreeWidgetItem *item, int col ) void PeersDialog::toggleSendItem( QTreeWidgetItem *item, int col )
{ {
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "ToggleSendItem()" << std::endl; std::cerr << "ToggleSendItem()" << std::endl;
#endif #endif
/* extract id */ /* extract id */
std::string id = (item -> text(4)).toStdString(); std::string id = (item -> text(4)).toStdString();
@ -1115,8 +1120,9 @@ PeersDialog::getPrivateChat(std::string id, std::string name, uint chatflags)
if (chatflags & RS_CHAT_REOPEN) if (chatflags & RS_CHAT_REOPEN)
{ {
show = true; show = true;
std::cerr << "reopen flag so: enable SHOW popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "reopen flag so: enable SHOW popupchatdialog()" << std::endl;
#endif
} }
@ -1133,8 +1139,9 @@ PeersDialog::getPrivateChat(std::string id, std::string name, uint chatflags)
if (chatflags & RS_CHAT_OPEN_NEW) if (chatflags & RS_CHAT_OPEN_NEW)
{ {
std::cerr << "new chat so: enable SHOW popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "new chat so: enable SHOW popupchatdialog()" << std::endl;
#endif
show = true; show = true;
} }
@ -1142,8 +1149,9 @@ PeersDialog::getPrivateChat(std::string id, std::string name, uint chatflags)
if (show) if (show)
{ {
std::cerr << "SHOWING popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "SHOWING popupchatdialog()" << std::endl;
#endif
popupchatdialog->show(); popupchatdialog->show();
} }
@ -1153,23 +1161,26 @@ PeersDialog::getPrivateChat(std::string id, std::string name, uint chatflags)
{ {
if (chatflags & RS_CHAT_FOCUS) if (chatflags & RS_CHAT_FOCUS)
{ {
std::cerr << "focus chat flag so: GETFOCUS popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "focus chat flag so: GETFOCUS popupchatdialog()" << std::endl;
#endif
popupchatdialog->getfocus(); popupchatdialog->getfocus();
} }
else else
{ {
std::cerr << "no focus chat flag so: FLASH popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "no focus chat flag so: FLASH popupchatdialog()" << std::endl;
#endif
popupchatdialog->flash(); popupchatdialog->flash();
} }
} }
else else
{ {
std::cerr << "not visible ... so leave popupchatdialog()"; #ifdef PEERS_DEBUG
std::cerr << std::endl; std::cerr << "not visible ... so leave popupchatdialog()" << std::endl;
#endif
} }
return popupchatdialog; return popupchatdialog;
@ -1412,7 +1423,9 @@ void PeersDialog::updateAvatar()
rsMsgs->getOwnAvatarData(data,size); rsMsgs->getOwnAvatarData(data,size);
#ifdef PEERS_DEBUG
std::cerr << "Image size = " << size << std::endl ; std::cerr << "Image size = " << size << std::endl ;
#endif
if(size == 0) if(size == 0)
std::cerr << "Got no image" << std::endl ; std::cerr << "Got no image" << std::endl ;
@ -1435,7 +1448,9 @@ void PeersDialog::getAvatar()
{ {
picture = QPixmap(fileName).scaled(82,82, Qt::IgnoreAspectRatio); picture = QPixmap(fileName).scaled(82,82, Qt::IgnoreAspectRatio);
#ifdef PEERS_DEBUG
std::cerr << "Sending avatar image down the pipe" << std::endl ; std::cerr << "Sending avatar image down the pipe" << std::endl ;
#endif
// send avatar down the pipe for other peers to get it. // send avatar down the pipe for other peers to get it.
QByteArray ba; QByteArray ba;
@ -1443,7 +1458,9 @@ void PeersDialog::getAvatar()
buffer.open(QIODevice::WriteOnly); buffer.open(QIODevice::WriteOnly);
picture.save(&buffer, "PNG"); // writes image into ba in PNG format picture.save(&buffer, "PNG"); // writes image into ba in PNG format
#ifdef PEERS_DEBUG
std::cerr << "Image size = " << ba.size() << std::endl ; std::cerr << "Image size = " << ba.size() << std::endl ;
#endif
rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()),ba.size()) ; // last char 0 included. rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()),ba.size()) ; // last char 0 included.
@ -1518,8 +1535,7 @@ void PeersDialog::addExtraFile()
void PeersDialog::addAttachment(std::string filePath) { void PeersDialog::addAttachment(std::string filePath) {
/* add a AttachFileItem to the attachment section */ /* add a AttachFileItem to the attachment section */
std::cerr << "PopupChatDialog::addExtraFile() hashing file."; std::cerr << "PopupChatDialog::addExtraFile() hashing file." << std::endl;
std::cerr << std::endl;
/* add widget in for new destination */ /* add widget in for new destination */
AttachFileItem *file = new AttachFileItem(filePath); AttachFileItem *file = new AttachFileItem(filePath);
@ -1536,14 +1552,13 @@ void PeersDialog::addAttachment(std::string filePath) {
} }
void PeersDialog::fileHashingFinished(AttachFileItem* file) { void PeersDialog::fileHashingFinished(AttachFileItem* file) {
std::cerr << "PeersDialog::fileHashingFinished() started."; std::cerr << "PeersDialog::fileHashingFinished() started." << std::endl;
std::cerr << std::endl;
//check that the file is ok tos end //check that the file is ok tos end
if (file->getState() == AFI_STATE_ERROR) { if (file->getState() == AFI_STATE_ERROR) {
#ifdef CHAT_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed."; std::cerr << "PopupChatDialog::fileHashingFinished error file is not hashed." << std::endl;
#endif #endif
return; return;
} }
@ -1560,16 +1575,16 @@ void PeersDialog::fileHashingFinished(AttachFileItem* file) {
rsiface->unlockData(); /* Unlock Interface */ rsiface->unlockData(); /* Unlock Interface */
} }
//convert fileSize from uint_64 to string for html link //convert fileSize from uint_64 to string for html link
char fileSizeChar [100]; char fileSizeChar [100];
sprintf(fileSizeChar, "%lld", file->FileSize()); sprintf(fileSizeChar, "%lld", file->FileSize());
std::string fileSize = *(&fileSizeChar); std::string fileSize = *(&fileSizeChar);
std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>" std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
+ "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>"; + "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::fileHashingFinished mesgString : " << mesgString << std::endl; std::cerr << "PeersDialog::fileHashingFinished mesgString : " << mesgString << std::endl;
#endif #endif
const char * messageString = mesgString.c_str (); const char * messageString = mesgString.c_str ();
@ -1595,9 +1610,9 @@ void PeersDialog::fileHashingFinished(AttachFileItem* file) {
void PeersDialog::anchorClicked (const QUrl& link ) void PeersDialog::anchorClicked (const QUrl& link )
{ {
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl; std::cerr << "PeersDialog::anchorClicked link.scheme() : " << link.scheme().toStdString() << std::endl;
#endif #endif
if (link.scheme() == "retroshare") if (link.scheme() == "retroshare")
{ {
@ -1607,9 +1622,9 @@ void PeersDialog::anchorClicked (const QUrl& link )
uint64_t fileSize = L.at(2).toULongLong(); uint64_t fileSize = L.at(2).toULongLong();
std::string fileHash = L.at(3).toStdString() ; std::string fileHash = L.at(3).toStdString() ;
#ifdef PEERS_DEBUG #ifdef PEERS_DEBUG
std::cerr << "PeersDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize << std::endl; std::cerr << "PeersDialog::anchorClicked FileRequest : fileName : " << fileName << ". fileHash : " << fileHash << ". fileSize : " << fileSize << std::endl;
#endif #endif
if (fileName != "" && fileHash != "") if (fileName != "" && fileHash != "")
{ {
@ -1654,37 +1669,31 @@ void PeersDialog::dropEvent(QDropEvent *event)
{ {
if (!(Qt::CopyAction & event->possibleActions())) if (!(Qt::CopyAction & event->possibleActions()))
{ {
std::cerr << "PeersDialog::dropEvent() Rejecting uncopyable DropAction"; std::cerr << "PeersDialog::dropEvent() Rejecting uncopyable DropAction" << std::endl;
std::cerr << std::endl;
/* can't do it */ /* can't do it */
return; return;
} }
std::cerr << "PeersDialog::dropEvent() Formats"; std::cerr << "PeersDialog::dropEvent() Formats" << std::endl;
std::cerr << std::endl;
QStringList formats = event->mimeData()->formats(); QStringList formats = event->mimeData()->formats();
QStringList::iterator it; QStringList::iterator it;
for(it = formats.begin(); it != formats.end(); it++) for(it = formats.begin(); it != formats.end(); it++)
{ {
std::cerr << "Format: " << (*it).toStdString(); std::cerr << "Format: " << (*it).toStdString() << std::endl;
std::cerr << std::endl;
} }
if (event->mimeData()->hasUrls()) if (event->mimeData()->hasUrls())
{ {
std::cerr << "PeersDialog::dropEvent() Urls:"; std::cerr << "PeersDialog::dropEvent() Urls:" << std::endl;
std::cerr << std::endl;
QList<QUrl> urls = event->mimeData()->urls(); QList<QUrl> urls = event->mimeData()->urls();
QList<QUrl>::iterator uit; QList<QUrl>::iterator uit;
for(uit = urls.begin(); uit != urls.end(); uit++) for(uit = urls.begin(); uit != urls.end(); uit++)
{ {
std::string localpath = uit->toLocalFile().toStdString(); std::string localpath = uit->toLocalFile().toStdString();
std::cerr << "Whole URL: " << uit->toString().toStdString(); std::cerr << "Whole URL: " << uit->toString().toStdString() << std::endl;
std::cerr << std::endl; std::cerr << "or As Local File: " << localpath << std::endl;
std::cerr << "or As Local File: " << localpath;
std::cerr << std::endl;
if (localpath.size() > 0) if (localpath.size() > 0)
{ {
@ -1714,25 +1723,21 @@ void PeersDialog::dropEvent(QDropEvent *event)
void PeersDialog::dragEnterEvent(QDragEnterEvent *event) void PeersDialog::dragEnterEvent(QDragEnterEvent *event)
{ {
/* print out mimeType */ /* print out mimeType */
std::cerr << "PeersDialog::dragEnterEvent() Formats"; std::cerr << "PeersDialog::dragEnterEvent() Formats" << std::endl;
std::cerr << std::endl;
QStringList formats = event->mimeData()->formats(); QStringList formats = event->mimeData()->formats();
QStringList::iterator it; QStringList::iterator it;
for(it = formats.begin(); it != formats.end(); it++) for(it = formats.begin(); it != formats.end(); it++)
{ {
std::cerr << "Format: " << (*it).toStdString(); std::cerr << "Format: " << (*it).toStdString() << std::endl;
std::cerr << std::endl;
} }
if (event->mimeData()->hasUrls()) if (event->mimeData()->hasUrls())
{ {
std::cerr << "PeersDialog::dragEnterEvent() Accepting Urls"; std::cerr << "PeersDialog::dragEnterEvent() Accepting Urls" << std::endl;
std::cerr << std::endl;
event->acceptProposedAction(); event->acceptProposedAction();
} }
else else
{ {
std::cerr << "PeersDialog::dragEnterEvent() No Urls"; std::cerr << "PeersDialog::dragEnterEvent() No Urls" << std::endl;
std::cerr << std::endl;
} }
} }