[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1509: IP addresses should be a QHostAddress, not a QString. (in trunk/src: control gui/network)
Author: edmanm
Date: 2006-12-09 15:44:09 -0500 (Sat, 09 Dec 2006)
New Revision: 1509
Modified:
trunk/src/control/routerdescriptor.cpp
trunk/src/control/routerdescriptor.h
trunk/src/gui/network/netviewer.cpp
trunk/src/gui/network/routerdescriptorview.cpp
Log:
IP addresses should be a QHostAddress, not a QString.
Modified: trunk/src/control/routerdescriptor.cpp
===================================================================
--- trunk/src/control/routerdescriptor.cpp 2006-12-09 19:58:10 UTC (rev 1508)
+++ trunk/src/control/routerdescriptor.cpp 2006-12-09 20:44:09 UTC (rev 1509)
@@ -47,7 +47,7 @@
if (line.startsWith("router ")) {
QStringList parts = line.remove(0,qstrlen("router ")).split(" ");
_name = parts.at(0);
- _ip = parts.at(1);
+ _ip = QHostAddress(parts.at(1));
_orPort = (quint16)parts.at(2).toUInt();
_dirPort = (quint16)parts.at(4).toUInt();
} else if (line.startsWith("platform ")) {
Modified: trunk/src/control/routerdescriptor.h
===================================================================
--- trunk/src/control/routerdescriptor.h 2006-12-09 19:58:10 UTC (rev 1508)
+++ trunk/src/control/routerdescriptor.h 2006-12-09 20:44:09 UTC (rev 1509)
@@ -32,6 +32,7 @@
#include <QStringList>
#include <QDateTime>
#include <QList>
+#include <QHostAddress>
class RouterDescriptor
@@ -54,7 +55,7 @@
/** Returns the router's name. */
QString name() const { return _name; }
/** Returns the router's IP address. */
- QString ip() const { return _ip; }
+ QHostAddress ip() const { return _ip; }
/** Returns the router's ORPort. */
quint16 orPort() const { return _orPort; }
/** Returns the router's DirPort. */
@@ -107,7 +108,7 @@
QString _fingerprint; /**< Router's fingerprint. */
QString _platform; /**< Platform on which router is running. */
QString _contact; /**< Router operator contact information. */
- QString _ip; /**< Router's IP address. */
+ QHostAddress _ip; /**< Router's IP address. */
quint16 _orPort; /**< Router's ORPort. */
quint16 _dirPort; /**< Router's DirPort. */
QDateTime _published; /**< Date router descriptor was published. */
Modified: trunk/src/gui/network/netviewer.cpp
===================================================================
--- trunk/src/gui/network/netviewer.cpp 2006-12-09 19:58:10 UTC (rev 1508)
+++ trunk/src/gui/network/netviewer.cpp 2006-12-09 20:44:09 UTC (rev 1509)
@@ -291,7 +291,7 @@
ui.treeRouterList->addRouter(rd);
/* Add this IP to a list whose geographic location we'd like to find. */
- addToResolveQueue(QHostAddress(rd.ip()), rd.id());
+ addToResolveQueue(rd.ip(), rd.id());
}
/** Adds an IP address to the resolve queue and updates the queue timers. */
Modified: trunk/src/gui/network/routerdescriptorview.cpp
===================================================================
--- trunk/src/gui/network/routerdescriptorview.cpp 2006-12-09 19:58:10 UTC (rev 1508)
+++ trunk/src/gui/network/routerdescriptorview.cpp 2006-12-09 20:44:09 UTC (rev 1509)
@@ -111,7 +111,7 @@
}
/* Add the IP address and router platform information */
- html.append(trow(tcol(b(tr("IP Address:"))) + tcol(rd.ip())));
+ html.append(trow(tcol(b(tr("IP Address:"))) + tcol(rd.ip().toString())));
html.append(trow(tcol(b(tr("Platform:"))) + tcol(rd.platform())));
/* If the router is online, then show the uptime and bandwidth stats. */