■ ■ ■ ■ ■ ■
sub3suite/src/items/ASNItem.h
| skipped 147 lines |
148 | 148 | | this->setText(asn.asn); |
149 | 149 | | |
150 | 150 | | /* info */ |
151 | | - | info_asn->setText(asn.info_asn); |
152 | | - | info_name->setText(asn.info_name); |
153 | | - | info_description->setText(asn.info_description); |
154 | | - | info_country->setText(asn.info_country); |
155 | | - | info_website->setText(asn.info_website); |
156 | | - | info_ownerAddress->setText(asn.info_ownerAddress); |
| 151 | + | if(info_asn->text().isEmpty()) |
| 152 | + | info_asn->setText(asn.info_asn); |
| 153 | + | if(info_name->text().isEmpty()) |
| 154 | + | info_name->setText(asn.info_name); |
| 155 | + | if(info_description->text().isEmpty()) |
| 156 | + | info_description->setText(asn.info_description); |
| 157 | + | if(info_country->text().isEmpty()) |
| 158 | + | info_country->setText(asn.info_country); |
| 159 | + | if(info_website->text().isEmpty()) |
| 160 | + | info_website->setText(asn.info_website); |
| 161 | + | if(info_ownerAddress->text().isEmpty()) |
| 162 | + | info_ownerAddress->setText(asn.info_ownerAddress); |
157 | 163 | | |
158 | 164 | | /* rir */ |
159 | | - | rir_name->setText(asn.rir_name); |
160 | | - | rir_country->setText(asn.rir_country); |
161 | | - | rir_dateAllocated->setText(asn.rir_dateallocated); |
| 165 | + | if(rir_name->text().isEmpty()) |
| 166 | + | rir_name->setText(asn.rir_name); |
| 167 | + | if(rir_country->text().isEmpty()) |
| 168 | + | rir_country->setText(asn.rir_country); |
| 169 | + | if(rir_dateAllocated->text().isEmpty()) |
| 170 | + | rir_dateAllocated->setText(asn.rir_dateallocated); |
162 | 171 | | |
163 | | - | int count = 0; |
| 172 | + | int count = emailContacts->rowCount(); |
164 | 173 | | /* email contacts */ |
165 | 174 | | foreach(const QString &value, asn.emailcontacts){ |
166 | 175 | | emailContacts->appendRow({new QStandardItem(QString::number(count)), |
| skipped 2 lines |
169 | 178 | | } |
170 | 179 | | |
171 | 180 | | /* abuse contacts */ |
172 | | - | count = 0; |
| 181 | + | count = abuseContacts->rowCount(); |
173 | 182 | | foreach(const QString &value, asn.abusecontacts){ |
174 | 183 | | abuseContacts->appendRow({new QStandardItem(QString::number(count)), |
175 | 184 | | new QStandardItem(value)}); |
| skipped 1 lines |
177 | 186 | | } |
178 | 187 | | |
179 | 188 | | /* peers */ |
180 | | - | count = 0; |
| 189 | + | count = peers->rowCount(); |
181 | 190 | | foreach(const QString &peer, asn.peers){ |
182 | 191 | | peers->appendRow({new QStandardItem(QString::number(count)), |
183 | 192 | | new QStandardItem(peer)}); |
| skipped 1 lines |
185 | 194 | | } |
186 | 195 | | |
187 | 196 | | /* prefixes */ |
188 | | - | count = 0; |
| 197 | + | count = prefixes->rowCount(); |
189 | 198 | | foreach(const QString &prefix, asn.prefixes){ |
190 | 199 | | prefixes->appendRow({new QStandardItem(QString::number(count)), |
191 | 200 | | new QStandardItem(prefix)}); |
| skipped 5 lines |
197 | 206 | | } |
198 | 207 | | |
199 | 208 | | void setPeers(const QSet<QString> &peersList){ |
200 | | - | int count = 0; |
| 209 | + | int count = peers->rowCount(); |
201 | 210 | | foreach(const QString &peer, peersList){ |
202 | 211 | | peers->appendRow({new QStandardItem(QString::number(count)), |
203 | 212 | | new QStandardItem(peer)}); |
| skipped 5 lines |
209 | 218 | | } |
210 | 219 | | |
211 | 220 | | void setPrefixes(const QSet<QString> &prefixList){ |
212 | | - | int count = 0; |
| 221 | + | int count = prefixes->rowCount(); |
213 | 222 | | foreach(const QString &prefix, prefixList){ |
214 | 223 | | prefixes->appendRow({new QStandardItem(QString::number(count)), |
215 | 224 | | new QStandardItem(prefix)}); |
| skipped 18 lines |