Load from XML
| 288 | |
| 289 | //! Load from XML |
| 290 | bool PlotArea::load(XmlStreamReader* reader, bool preview) { |
| 291 | Q_D(PlotArea); |
| 292 | |
| 293 | if (!readBasicAttributes(reader)) |
| 294 | return false; |
| 295 | |
| 296 | QXmlStreamAttributes attribs; |
| 297 | QString str; |
| 298 | |
| 299 | while (!reader->atEnd()) { |
| 300 | reader->readNext(); |
| 301 | if (reader->isEndElement() && reader->name() == QLatin1String("plotArea")) |
| 302 | break; |
| 303 | |
| 304 | if (!reader->isStartElement()) |
| 305 | continue; |
| 306 | |
| 307 | if (!preview && reader->name() == QLatin1String("comment")) { |
| 308 | if (!readCommentElement(reader)) |
| 309 | return false; |
| 310 | } else if (!preview && reader->name() == QLatin1String("background")) |
| 311 | d->background->load(reader, preview); |
| 312 | else if (!preview && reader->name() == QLatin1String("border")) { |
| 313 | attribs = reader->attributes(); |
| 314 | |
| 315 | READ_INT_VALUE("borderType", borderType, PlotArea::BorderType); |
| 316 | d->borderLine->load(reader, preview); |
| 317 | |
| 318 | str = attribs.value(QStringLiteral("borderCornerRadius")).toString(); |
| 319 | if (str.isEmpty()) |
| 320 | reader->raiseMissingAttributeWarning(QStringLiteral("borderCornerRadius")); |
| 321 | else |
| 322 | d->borderCornerRadius = str.toDouble(); |
| 323 | } else { // unknown element |
| 324 | reader->raiseUnknownElementWarning(); |
| 325 | if (!reader->skipToEndElement()) |
| 326 | return false; |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | return true; |
| 331 | } |
| 332 | |
| 333 | void PlotArea::loadThemeConfig(const KConfig& config) { |
| 334 | KConfigGroup group; |
nothing calls this directly
no test coverage detected