Logo Search packages:      
Sourcecode: karchiver version File versions  Download package

QString KarchiveurApp::openRemoteFile ( const KURL &  url  ) 

Download a net file and returns itls local filename

Download a net file and returns its local filename

Definition at line 1116 of file karchiveur.cpp.

References CLed::setColor().

{
  QString localfile;

  localfile=QDir::homeDirPath();
  localfile+="/";
  localfile+=url.fileName(true);
  kdDebug()<<QString("local file:%1*%2*").arg(localfile).arg(url.prettyURL())<<endl;
  if ( !url.isValid() )
  {
      KMessageBox::error(this, i18n("Bad URL!"));
      led->setColor(QColor("orange"));
      return NULL;
  }

  if (KIO::NetAccess::download(url, localfile, this) == false)
  {
    // this needs to be handled within KIO sooooon
    KMessageBox::error(this, i18n("Cannot download file!"));
    led->setColor(QColor("orange"));
    return NULL;
  }

  return localfile;
}


Generated by  Doxygen 1.6.0   Back to index