void AvatarDownloadDialog::startDownload() { connect(m_pRequest,SIGNAL(terminated(bool)),this,SLOT(downloadTerminated(bool))); connect(m_pRequest,SIGNAL(status(const QString &)),this,SLOT(downloadMessage(const QString &))); QString tmp = m_szUrl; g_pIconManager->urlToCachedFileName(tmp); g_pApp->getLocalKvircDirectory(m_szLocalFileName,KviApplication::Avatars,tmp); m_pRequest->setExistingFileAction(KviHttpRequest::RenameExisting); if(!m_pRequest->get(KviUrl(m_szUrl),KviHttpRequest::StoreToFile,m_szLocalFileName.toUtf8().data())) { m_szErrorMessage = __tr2qs_ctx("Failed to start the download","options"); reject(); } }
void KviRemoteMircServerImportWizard::start() { QString url = m_pUrlEdit->text(); if(url.isEmpty())url = KVI_WWWMIRCCOUK_SERVERSINI; finishButton()->setEnabled(false); if(m_pRequest)delete m_pRequest; m_pRequest = new KviHttpRequest(); connect(m_pRequest,SIGNAL(terminated(bool)),this,SLOT(getListTerminated(bool))); connect(m_pRequest,SIGNAL(status(const QString &)),this,SLOT(getListMessage(const QString &))); g_pApp->getTmpFileName(m_szTmpFileName,"servers.ini"); if(!m_pRequest->get(KviUrl(url),KviHttpRequest::StoreToFile,m_szTmpFileName)) { delete m_pRequest; m_pRequest = 0; m_pOutput->setText(__tr2qs("Failed to start the server list transfer :(")); finishButton()->setEnabled(true); } }