mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-20 20:31:46 -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));
|
||||
}
|
||||
|
||||
free (iptable);
|
||||
|
||||
return addrs;
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ ExtAddrFinder::~ExtAddrFinder()
|
||||
|
||||
delete _found ;
|
||||
delete _searching ;
|
||||
delete _addr ;
|
||||
free (_addr) ;
|
||||
}
|
||||
|
||||
ExtAddrFinder::ExtAddrFinder()
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "PeerItem.h"
|
||||
#include "FeedHolder.h"
|
||||
#include "../RsAutoUpdatePage.h"
|
||||
|
||||
#include "rsiface/rspeers.h"
|
||||
|
||||
@ -146,56 +147,58 @@ void PeerItem::updateItem()
|
||||
std::cerr << "PeerItem::updateItem()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
RsPeerDetails details;
|
||||
if (!rsPeers->getPeerDetails(mPeerId, details))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(!RsAutoUpdatePage::eventsLocked()) {
|
||||
RsPeerDetails details;
|
||||
if (!rsPeers->getPeerDetails(mPeerId, details))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* top Level info */
|
||||
QString status = QString::fromStdString(RsPeerStateString(details.state));
|
||||
/* top Level info */
|
||||
QString status = QString::fromStdString(RsPeerStateString(details.state));
|
||||
|
||||
#if 0
|
||||
/* Append additional status info from status service */
|
||||
StatusInfo statusInfo;
|
||||
if ((rsStatus) && (rsStatus->getStatus(*it, statusInfo)))
|
||||
{
|
||||
status.append(QString::fromStdString("/" + RsStatusString(statusInfo.status)));
|
||||
}
|
||||
/* Append additional status info from status service */
|
||||
StatusInfo statusInfo;
|
||||
if ((rsStatus) && (rsStatus->getStatus(*it, statusInfo)))
|
||||
{
|
||||
status.append(QString::fromStdString("/" + RsStatusString(statusInfo.status)));
|
||||
}
|
||||
#endif
|
||||
statusLabel->setText(status);
|
||||
trustLabel->setText(QString::fromStdString(
|
||||
RsPeerTrustString(details.trustLvl)));
|
||||
statusLabel->setText(status);
|
||||
trustLabel->setText(QString::fromStdString(
|
||||
RsPeerTrustString(details.trustLvl)));
|
||||
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << details.localAddr << ":";
|
||||
out << details.localPort << "/";
|
||||
out << details.extAddr << ":";
|
||||
out << details.extPort;
|
||||
ipLabel->setText(QString::fromStdString(out.str()));
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << details.localAddr << ":";
|
||||
out << details.localPort << "/";
|
||||
out << details.extAddr << ":";
|
||||
out << details.extPort;
|
||||
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 */
|
||||
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(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 */
|
||||
|
Loading…
Reference in New Issue
Block a user