SHARE
TWEET

Untitled

a guest Aug 30th, 2019 90 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void WebWatcher::save(QIODevice* device)
  2. {
  3.     QXmlStreamWriter writer(device);
  4.     writer.setAutoFormatting(true);
  5.     writer.writeStartDocument();
  6.     writer.writeStartElement(QLatin1String("WebWatcher"));
  7.  
  8.     writer.writeAttribute(QLatin1String("id_counter"), QString::number(id_count));
  9.     writer.writeAttribute(QLatin1String("sites_count"), QString::number(sites.size()));
  10.  
  11.     for(const WatchedSite& site: sites)
  12.     {
  13.         writer.writeStartElement(QLatin1String("WatchedSite"));
  14.         writer.writeAttribute(QLatin1String("id"), QString::number(site.id));
  15.  
  16.         writer.writeTextElement(QLatin1String("Url"), site.url.toString());
  17.         writer.writeTextElement(QLatin1String("Title"), site.title);
  18.         writer.writeTextElement(QLatin1String("Query"), site.jsQuery);
  19.         writer.writeTextElement(QLatin1String("Interval"), QString::number(site.updateIntervalMs));
  20.         for (size_t i = 0; i < site.probes.size(); i++)
  21.         {
  22.             writer.writeStartElement(QLatin1String("WatchedSiteProbe"));
  23.             writer.writeAttribute(QLatin1String("id"), QString::number(site.id));
  24.             writer.writeEndElement();
  25.         }
  26.         writer.writeTextElement(QLatin1String("LastUpdateTime"), QString::number(site.lastUpdateTimeMs));
  27.         writer.writeTextElement(QLatin1String("LastHash"), QString::fromLatin1(site.lastHash.toBase64()));
  28.  
  29.         writer.writeEndElement();
  30.     }
  31.  
  32.     writer.writeEndElement();
  33.     writer.writeEndDocument();
  34. }
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