mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-01 01:55:50 -05:00
Ported trunk Commit 2882 (Thunder)
Memory leak: - getLocalInterfaces -> iptable = (MIB_IPADDRTABLE *) malloc(dwSize); - main -> RshareSettings *_settings = new RshareSettings(); ExtAddrFinder::~ExtAddrFinder - use free for pointer allocated with malloc Ported trunk commit 2810 (Thunder): RetroShare stopped responding during signing a key and asking for password. The QSingleShotTimer of ConfCertDialog wants to update the gui and stopped in PeerItem::updateItem. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2883 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
d82e1ba63c
commit
ac693595c9
@ -352,6 +352,8 @@ std::list<std::string> getLocalInterfaces()
|
|||||||
addrs.push_back(inet_ntoa(addr));
|
addrs.push_back(inet_ntoa(addr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free (iptable);
|
||||||
|
|
||||||
return addrs;
|
return addrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ ExtAddrFinder::~ExtAddrFinder()
|
|||||||
|
|
||||||
delete _found ;
|
delete _found ;
|
||||||
delete _searching ;
|
delete _searching ;
|
||||||
delete _addr ;
|
free (_addr) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtAddrFinder::ExtAddrFinder()
|
ExtAddrFinder::ExtAddrFinder()
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "PeerItem.h"
|
#include "PeerItem.h"
|
||||||
#include "FeedHolder.h"
|
#include "FeedHolder.h"
|
||||||
|
#include "../RsAutoUpdatePage.h"
|
||||||
|
|
||||||
#include "rsiface/rspeers.h"
|
#include "rsiface/rspeers.h"
|
||||||
|
|
||||||
@ -146,56 +147,58 @@ void PeerItem::updateItem()
|
|||||||
std::cerr << "PeerItem::updateItem()";
|
std::cerr << "PeerItem::updateItem()";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
#endif
|
#endif
|
||||||
RsPeerDetails details;
|
if(!RsAutoUpdatePage::eventsLocked()) {
|
||||||
if (!rsPeers->getPeerDetails(mPeerId, details))
|
RsPeerDetails details;
|
||||||
{
|
if (!rsPeers->getPeerDetails(mPeerId, details))
|
||||||
return;
|
{
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* top Level info */
|
/* top Level info */
|
||||||
QString status = QString::fromStdString(RsPeerStateString(details.state));
|
QString status = QString::fromStdString(RsPeerStateString(details.state));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* Append additional status info from status service */
|
/* Append additional status info from status service */
|
||||||
StatusInfo statusInfo;
|
StatusInfo statusInfo;
|
||||||
if ((rsStatus) && (rsStatus->getStatus(*it, statusInfo)))
|
if ((rsStatus) && (rsStatus->getStatus(*it, statusInfo)))
|
||||||
{
|
{
|
||||||
status.append(QString::fromStdString("/" + RsStatusString(statusInfo.status)));
|
status.append(QString::fromStdString("/" + RsStatusString(statusInfo.status)));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
statusLabel->setText(status);
|
statusLabel->setText(status);
|
||||||
trustLabel->setText(QString::fromStdString(
|
trustLabel->setText(QString::fromStdString(
|
||||||
RsPeerTrustString(details.trustLvl)));
|
RsPeerTrustString(details.trustLvl)));
|
||||||
|
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << details.localAddr << ":";
|
out << details.localAddr << ":";
|
||||||
out << details.localPort << "/";
|
out << details.localPort << "/";
|
||||||
out << details.extAddr << ":";
|
out << details.extAddr << ":";
|
||||||
out << details.extPort;
|
out << details.extPort;
|
||||||
ipLabel->setText(QString::fromStdString(out.str()));
|
ipLabel->setText(QString::fromStdString(out.str()));
|
||||||
|
}
|
||||||
|
|
||||||
|
connLabel->setText(QString::fromStdString(details.autoconnect));
|
||||||
|
QDateTime date = QDateTime::fromTime_t(details.lastConnect);
|
||||||
|
QString stime = date.toString(Qt::LocalDate);
|
||||||
|
lastLabel-> setText(stime);
|
||||||
|
|
||||||
|
/* do buttons */
|
||||||
|
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
|
||||||
|
if (details.state & RS_PEER_STATE_FRIEND)
|
||||||
|
{
|
||||||
|
addButton->setEnabled(false);
|
||||||
|
removeButton->setEnabled(true);
|
||||||
|
msgButton->setEnabled(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addButton->setEnabled(true);
|
||||||
|
removeButton->setEnabled(false);
|
||||||
|
msgButton->setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connLabel->setText(QString::fromStdString(details.autoconnect));
|
|
||||||
QDateTime date = QDateTime::fromTime_t(details.lastConnect);
|
|
||||||
QString stime = date.toString(Qt::LocalDate);
|
|
||||||
lastLabel-> setText(stime);
|
|
||||||
|
|
||||||
/* do buttons */
|
|
||||||
chatButton->setEnabled(details.state & RS_PEER_STATE_CONNECTED);
|
|
||||||
if (details.state & RS_PEER_STATE_FRIEND)
|
|
||||||
{
|
|
||||||
addButton->setEnabled(false);
|
|
||||||
removeButton->setEnabled(true);
|
|
||||||
msgButton->setEnabled(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
addButton->setEnabled(true);
|
|
||||||
removeButton->setEnabled(false);
|
|
||||||
msgButton->setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* slow Tick */
|
/* slow Tick */
|
||||||
int msec_rate = 10129;
|
int msec_rate = 10129;
|
||||||
|
|
||||||
|
@ -168,13 +168,15 @@ int main(int argc, char *argv[])
|
|||||||
QObject::connect(w->peersDialog,SIGNAL(friendsUpdated()),w->networkDialog,SLOT(insertConnect())) ;
|
QObject::connect(w->peersDialog,SIGNAL(friendsUpdated()),w->networkDialog,SLOT(insertConnect())) ;
|
||||||
QObject::connect(w->peersDialog,SIGNAL(notifyGroupChat(const QString&,const QString&)),w,SLOT(displaySystrayMsg(const QString&,const QString&)),Qt::QueuedConnection) ;
|
QObject::connect(w->peersDialog,SIGNAL(notifyGroupChat(const QString&,const QString&)),w,SLOT(displaySystrayMsg(const QString&,const QString&)),Qt::QueuedConnection) ;
|
||||||
|
|
||||||
/* only show window, if not startMinimized */
|
|
||||||
RshareSettings *_settings = new RshareSettings();
|
|
||||||
|
|
||||||
if(!_settings->value(QString::fromUtf8("StartMinimized"), false).toBool())
|
|
||||||
{
|
{
|
||||||
|
/* only show window, if not startMinimized */
|
||||||
|
RshareSettings _settings;
|
||||||
|
|
||||||
w->show();
|
if(!_settings.value(QString::fromUtf8("StartMinimized"), false).toBool())
|
||||||
|
{
|
||||||
|
|
||||||
|
w->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Startup a Timer to keep the gui's updated */
|
/* Startup a Timer to keep the gui's updated */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user