Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 24th, 2012  |  syntax: None  |  size: 0.68 KB  |  views: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. QNetworkReply* clsNAM::createRequest(Operation op,const QNetworkRequest & req,
  2.                                                     QIODevice * outgoingData )
  3. {
  4.     return new clsNR(QNetworkAccessManager::createRequest(_op,_req,_outgoingData));
  5. }
  6.        
  7. bool clsNR::isImage()
  8. {
  9.     if(this->rawHeader("Content-Type").toLower().startsWith("image"))
  10.        return true;
  11.     else
  12.        return false;
  13. }
  14.        
  15. void clsNR::slotCloseConnection()
  16. {
  17.     if(isImage())
  18.     {
  19.       QImage image;
  20.       bool bool1 = image.loadFromData(ContentData);
  21.       QString name(QDir::homePath());
  22.       name.append(this->url().path());
  23.       bool bool2 = image.save(name,0,-1);
  24.     }
  25. }
  26.        
  27. "/home/guest/images/splash/3.jpg"
clone this paste RAW Paste Data