本文整理汇总了C++中kio::Job::kill方法的典型用法代码示例。如果您正苦于以下问题:C++ Job::kill方法的具体用法?C++ Job::kill怎么用?C++ Job::kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::Job
的用法示例。
在下文中一共展示了Job::kill方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: killJob
void Observer::killJob(int progressId)
{
KIO::Job *job = m_dctJobs[progressId];
if(!job)
{
kdWarning() << "Can't find job to kill ! There is no job with progressId=" << progressId << " in this process" << endl;
return;
}
job->kill(false /* not quietly */);
}
示例2: abortLoad
void ReadOnlyPart::abortLoad()
{
m_file = "";
if ( m_job )
{
KIO::Job *job = m_job;
m_job = 0;
job->kill();
}
}
示例3: sendQuery
void LdapConfigWidget::sendQuery()
{
LDAPUrl _url;
mQResult.clear();
mCancelled = true;
_url.setProtocol( ( mSecSSL && mSecSSL->isChecked() ) ? "ldaps" : "ldap" );
if ( mHost ) _url.setHost( mHost->text() );
if ( mPort ) _url.setPort( mPort->value() );
_url.setDn( "" );
_url.setAttributes( mAttr );
_url.setScope( LDAPUrl::Base );
if ( mVer ) _url.setExtension( "x-ver", QString::number( mVer->value() ) );
if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls", "" );
kdDebug(5700) << "sendQuery url: " << _url.prettyURL() << endl;
mLdif.startParsing();
KIO::Job *job = KIO::get( _url, true, false );
job->addMetaData("no-auth-prompt","true");
connect( job, SIGNAL( data( KIO::Job*, const QByteArray& ) ),
this, SLOT( loadData( KIO::Job*, const QByteArray& ) ) );
connect( job, SIGNAL( result( KIO::Job* ) ),
this, SLOT( loadResult( KIO::Job* ) ) );
if ( mProg == NULL )
mProg = new KProgressDialog( this, 0, i18n("LDAP Query"), _url.prettyURL(), true );
else
mProg->setLabel( _url.prettyURL() );
mProg->progressBar()->setValue( 0 );
mProg->progressBar()->setTotalSteps( 1 );
mProg->exec();
if ( mCancelled ) {
kdDebug(5700) << "query cancelled!" << endl;
job->kill( true );
} else {
if ( !mErrorMsg.isEmpty() ) KMessageBox::error( this, mErrorMsg );
}
}
示例4: slotResult
void PiwigoTalker::slotResult(KJob* job)
{
KIO::Job* tempjob = static_cast<KIO::Job*>(job);
State state = m_state; // Can change in the treatment itself
// so we cache it
if (tempjob->error())
{
if (state == GE_LOGIN)
{
emit signalLoginFailed(tempjob->errorString());
kDebug() << tempjob->errorString();
}
else if (state == GE_GETVERSION) {
kDebug() << tempjob->errorString();
// Version isn't mandatory and errors can be ignored
// As login succeeded, albums can be listed
listAlbums();
}
else if (state == GE_CHECKPHOTOEXIST || state == GE_GETINFO ||
state == GE_SETINFO || state == GE_ADDPHOTOCHUNK ||
state == GE_ADDPHOTOSUMMARY || state == GE_OLD_ADDPHOTOCHUNK ||
state == GE_OLD_ADDTHUMB || state == GE_OLD_ADDHQ ||
state == GE_OLD_ADDPHOTOSUMMARY)
{
emit signalAddPhotoFailed(tempjob->errorString());
}
else
{
tempjob->ui()->setWindow(m_parent);
tempjob->ui()->showErrorMessage();
}
emit signalBusy(false);
return;
}
switch (state)
{
case(GE_LOGIN):
parseResponseLogin(m_talker_buffer);
break;
case(GE_GETVERSION):
parseResponseGetVersion(m_talker_buffer);
break;
case(GE_LISTALBUMS):
parseResponseListAlbums(m_talker_buffer);
break;
case(GE_CHECKPHOTOEXIST):
parseResponseDoesPhotoExist(m_talker_buffer);
break;
case(GE_GETINFO):
parseResponseGetInfo(m_talker_buffer);
break;
case(GE_SETINFO):
parseResponseSetInfo(m_talker_buffer);
break;
// Support for Web API >= 2.4
case(GE_ADDPHOTOCHUNK):
parseResponseAddPhotoChunk(m_talker_buffer);
break;
case(GE_ADDPHOTOSUMMARY):
parseResponseAddPhotoSummary(m_talker_buffer);
break;
// Support for Web API < 2.4
case(GE_OLD_ADDPHOTOCHUNK):
parseResponseOldAddPhoto(m_talker_buffer);
break;
case(GE_OLD_ADDTHUMB):
parseResponseOldAddThumbnail(m_talker_buffer);
break;
case(GE_OLD_ADDHQ):
parseResponseOldAddHQPhoto(m_talker_buffer);
break;
case(GE_OLD_ADDPHOTOSUMMARY):
parseResponseOldAddPhotoSummary(m_talker_buffer);
break;
}
tempjob->kill();
m_job = 0;
if (state == GE_GETVERSION && m_loggedIn)
{
listAlbums();
}
emit signalBusy(false);
}
示例5: slotResult
void GalleryTalker::slotResult(KJob *job)
{
KIO::Job *tempjob = static_cast<KIO::Job*>(job);
if (tempjob->error())
{
if (m_state == GE_LOGIN)
{
emit signalLoginFailed(tempjob->errorString());
}
else
{
if (m_state == GE_ADDPHOTO)
{
emit signalAddPhotoFailed(tempjob->errorString());
}
else
{
tempjob->ui()->setWindow(m_parent);
tempjob->ui()->showErrorMessage();
}
}
emit signalBusy(false);
return;
}
switch (m_state)
{
case(GE_LOGIN):
parseResponseLogin(m_talker_buffer);
break;
case(GE_LISTALBUMS):
parseResponseListAlbums(m_talker_buffer);
break;
case(GE_LISTPHOTOS):
parseResponseListPhotos(m_talker_buffer);
break;
case(GE_CREATEALBUM):
parseResponseCreateAlbum(m_talker_buffer);
break;
case(GE_ADDPHOTO):
parseResponseAddPhoto(m_talker_buffer);
break;
}
if (m_state == GE_LOGIN && m_loggedIn)
{
const QStringList cookielist = (tempjob->queryMetaData("setcookies")).split('\n');
m_cookie = "Cookie:";
if(!cookielist.isEmpty())
{
QRegExp rx("^GALLERYSID=.+");
QString app;
foreach(const QString &str, cookielist)
{
if(str.contains("Set-Cookie: "))
{
const QStringList cl = str.split(' ');
int n = cl.lastIndexOf(rx);
if(n!= -1)
{
app = cl.at(n);
}
}
}
m_cookie += app;
}
tempjob->kill();
listAlbums();
}