34 foreach (QString line, descriptor) {
35 if (line.startsWith(
"router ")) {
36 QStringList parts = line.remove(0,qstrlen(
"router ")).split(
" ");
38 _ip = QHostAddress(parts.at(1));
39 _orPort = (quint16)parts.at(2).toUInt();
40 _dirPort = (quint16)parts.at(4).toUInt();
41 }
else if (line.startsWith(
"platform ")) {
42 _platform = line.remove(0,qstrlen(
"platform "));
43 }
else if (line.startsWith(
"published ")) {
45 line.remove(0,qstrlen(
"published ")),
46 "yyyy-MM-dd HH:mm:ss");
48 }
else if (line.startsWith(
"opt fingerprint ")) {
49 _fingerprint = line.remove(0,qstrlen(
"opt fingerprint "));
51 }
else if (line.startsWith(
"fingerprint ")) {
54 }
else if (line.startsWith(
"uptime ")) {
55 _uptime = (quint64)line.remove(0,qstrlen(
"uptime ")).toULongLong();
56 }
else if (line.startsWith(
"bandwidth ")) {
57 QStringList bw = line.remove(0,qstrlen(
"bandwidth ")).split(
" ");
61 }
else if (line.startsWith(
"contact ")) {
62 _contact = line.remove(0,qstrlen(
"contact "));
63 }
else if (line.startsWith(
"hibernating ")) {
64 if (line.remove(0,qstrlen(
"hibernating ")).trimmed() ==
"1") {
78 return tr(
"Hibernating");