25 : _microdesc(microdesc), _observedBandwidth(0), _uptime(0) {
36 foreach(QString line, descriptor) {
37 if(line.startsWith(
"onion-key")) {
39 }
else if(line.startsWith(
"p ")) {
41 }
else if(line.startsWith(
"family ")) {
42 _family = line.remove(0,qstrlen(
"family "));
47 if(line.startsWith(
"-----END RSA PUBLIC KEY-----"))
51 foreach (QString line, descriptor) {
52 if (line.startsWith(
"router ")) {
53 QStringList parts = line.remove(0,qstrlen(
"router ")).split(
" ");
55 _ip = QHostAddress(parts.at(1));
56 _orPort = (quint16)parts.at(2).toUInt();
57 _dirPort = (quint16)parts.at(4).toUInt();
58 }
else if (line.startsWith(
"platform ")) {
59 _platform = line.remove(0,qstrlen(
"platform "));
60 }
else if (line.startsWith(
"published ")) {
62 line.remove(0,qstrlen(
"published ")),
63 "yyyy-MM-dd HH:mm:ss");
65 }
else if (line.startsWith(
"opt fingerprint ")) {
66 _fingerprint = line.remove(0,qstrlen(
"opt fingerprint "));
68 }
else if (line.startsWith(
"fingerprint ")) {
71 }
else if (line.startsWith(
"uptime ")) {
72 _uptime = (quint64)line.remove(0,qstrlen(
"uptime ")).toULongLong();
73 }
else if (line.startsWith(
"bandwidth ")) {
74 QStringList bw = line.remove(0,qstrlen(
"bandwidth ")).split(
" ");
78 }
else if (line.startsWith(
"contact ")) {
79 _contact = line.remove(0,qstrlen(
"contact "));
80 }
else if (line.startsWith(
"hibernating ")) {
81 if (line.remove(0,qstrlen(
"hibernating ")).trimmed() ==
"1") {
96 return tr(
"Hibernating");