SHARE
TWEET

Untitled

a guest Aug 28th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. QXmlStreamReader reader(device);
  2.     reader.readNextStartElement();
  3.  
  4.     assert(reader.name() == QLatin1String("WebWatcher"));
  5.  
  6.     id_count = reader.attributes().value(QLatin1String("id_counter")).toLongLong();
  7.     qint64 count = reader.attributes().value(QLatin1String("sites_count")).toLongLong();
  8.     reader.readNextStartElement();
  9.  
  10.     sites.reserve(count);
  11.     qDebug() << count;
  12.     for (qint64 i = 0; i < count; i++)
  13.     {
  14.         assert(reader.name() == QLatin1String("WatchedSite"));
  15.  
  16.         WatchedSite site;
  17.         site.id = reader.attributes().value(QLatin1String("id")).toInt();
  18.         qDebug() << site.id;
  19.         qDebug() << reader.readNextStartElement() << reader.tokenString() << reader.text();
  20.  
  21.         assert(reader.name() == QLatin1String("Url"));
  22.         site.url = QUrl(reader.readElementText());
  23.         reader.readNextStartElement();
  24.  
  25.         assert(reader.name() == QLatin1String("Title"));
  26.         site.title = reader.readElementText();
  27.         reader.readNextStartElement();
  28.  
  29.         assert(reader.name() == QLatin1String("Query"));
  30.         site.jsQuery = reader.readElementText();
  31.         reader.readNextStartElement();
  32.  
  33.         assert(reader.name() == QLatin1String("Interval"));
  34.         site.updateInterval = reader.readElementText().toLongLong();
  35.         reader.readNextStartElement();
  36.  
  37.         assert(reader.name() == QLatin1String("LastUpdateTime"));
  38.         site.lastUpdateTimeMs = reader.readElementText().toLongLong();
  39.         reader.readNextStartElement();
  40.  
  41.         assert(reader.name() == QLatin1String("LastHash"));
  42.         site.lastHash = reader.readElementText().toLatin1();
  43.         qDebug() << reader.readNextStartElement();
  44.  
  45.         sites.push_back(site);
  46.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top