本文整理汇总了C++中KJob::start方法的典型用法代码示例。如果您正苦于以下问题:C++ KJob::start方法的具体用法?C++ KJob::start怎么用?C++ KJob::start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KJob
的用法示例。
在下文中一共展示了KJob::start方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debug
void
IpodCopyTracksJob::slotStartOrTranscodeCopyJob( const KUrl &sourceUrl, const KUrl &destUrl )
{
KJob *job = 0;
if( m_transcodingConfig.isJustCopy() )
{
if( m_goingToRemoveSources && m_coll &&
sourceUrl.toLocalFile().startsWith( m_coll.data()->mountPoint() ) )
{
// special case for "add orphaned tracks" to either save space and significantly
// speed-up the process:
debug() << "Moving from" << sourceUrl << "to" << destUrl;
job = KIO::file_move( sourceUrl, destUrl, -1, KIO::HideProgressInfo | KIO::Overwrite );
}
else
{
debug() << "Copying from" << sourceUrl << "to" << destUrl;
job = KIO::file_copy( sourceUrl, destUrl, -1, KIO::HideProgressInfo | KIO::Overwrite );
}
}
else
{
debug() << "Transcoding from" << sourceUrl << "to" << destUrl;
job = new Transcoding::Job( sourceUrl, destUrl, m_transcodingConfig );
}
job->setUiDelegate( 0 ); // be non-interactive
job->setAutoDelete( true );
connect( job, SIGNAL(finished(KJob*)), // we must use this instead of result() to prevent deadlock
SLOT(slotCopyOrTranscodeJobFinished()) );
job->start(); // no-op for KIO job, but matters for transcoding job
}
示例2: init
void GitRunner::init()
{
QStringList command;
command << "init";
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleInit(KJob*)));
job->start();
}
示例3: start
void Task::start()
{
kDebug(14010) << "Executing children tasks for this task.";
KJob *subTask = 0;
foreach( subTask, subjobs() )
{
subTask->start();
}
}
示例4: deleteCommit
void GitRunner::deleteCommit(const QString &sha1hash)
{
QStringList command;
command << "reset" << "--hard" << sha1hash;
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleDeleteCommit(KJob*)));
job->start();
}
示例5: startRepairJob
void PlanExecutor::startRepairJob() {
if(mPlan->mBackupType != BackupPlan::BupType || busy() || !destinationAvailable()) {
return;
}
KJob *lJob = new BupRepairJob(*mPlan, mDestinationPath, mLogFilePath, mKupDaemon);
connect(lJob, SIGNAL(result(KJob*)), SLOT(repairFinished(KJob*)));
lJob->start();
mLastState = mState;
mState = REPAIRING;
emit stateChanged();
startSleepInhibit();
}
示例6: startIntegrityCheck
void PlanExecutor::startIntegrityCheck() {
if(mPlan->mBackupType != BackupPlan::BupType || busy() || !destinationAvailable()) {
return;
}
KJob *lJob = new BupVerificationJob(*mPlan, mDestinationPath, mLogFilePath, mKupDaemon);
connect(lJob, SIGNAL(result(KJob*)), SLOT(integrityCheckFinished(KJob*)));
lJob->start();
mLastState = mState;
mState = INTEGRITY_TESTING;
emit stateChanged();
startSleepInhibit();
}
示例7: start
void XmlValidatorJob::start()
{
if(m_documentUrl.isEmpty()) {
m_result = Failed;
m_errors.append(i18n("No document to validate"));
setError(m_result);
emitResult();
return;
}
QString localUrl;
KJob *copyJob = 0;
//DTD inline
if(m_dtdUrl.isEmpty() && m_schemaUrl.isEmpty()) {
emit signalReady(this);
return;
}
if(!m_dtdUrl.isEmpty()) {
localUrl = getLocalURLForSchema(m_documentUrl, m_dtdUrl);
if(QFile::exists(localUrl)) {
m_dtdUrl = localUrl;
emit signalReady(this);
return;
} else {
copyJob = KIO::copy(m_dtdUrl, localUrl, KIO::HideProgressInfo);
m_dtdUrl = localUrl;
}
}
if(!m_schemaUrl.isEmpty()) {
localUrl = getLocalURLForSchema(m_documentUrl, m_schemaUrl);
if(QFile::exists(localUrl)) {
m_schemaUrl = localUrl;
emit signalReady(this);
return;
} else {
copyJob = KIO::copy(m_schemaUrl, localUrl, KIO::HideProgressInfo);
m_schemaUrl = localUrl;
}
}
copyJob->setAutoDelete(true);
copyJob->setUiDelegate(0);
connect(copyJob, SIGNAL(result(KJob *)), this, SLOT(ready(KJob *)));
copyJob->start();
}
示例8: moveToCommit
void GitRunner::moveToCommit(const QString &sha1hash,
const QString &newBranch)
{
QStringList command;
command << "branch" << newBranch << sha1hash;
execSynchronously(command);
command.clear();
command << "checkout" << newBranch;
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleMoveToCommit(KJob*)));
job->start();
}
示例9: createWorkingCopy
void GitRunner::createWorkingCopy(const KUrl &repoOrigin,
const KUrl &repoDestination)
{
// TODO: now supports only cloning a local repo(not very useful, I know =P),
// so extend the method to be used over the Internet.
m_lastRepoRoot->setDirectory(repoDestination.pathOrUrl());
QStringList command;
command << "clone " + repoOrigin.pathOrUrl();
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleCreateWorkingCopy(KJob*)));
job->start();
}
示例10: remove
void GitRunner::remove(const KUrl::List &files)
{
if (files.empty()) {
return;
}
QStringList command;
command << "rm ";
QStringList stringFiles = files.toStringList();
while (!stringFiles.isEmpty()) {
command.append(m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0));
}
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleRemove(KJob*)));
job->start();
}
示例11: commit
void GitRunner::commit(const QString &message)
{
// NOTE: git doesn't allow empty commit !
if (message.isEmpty()) {
return;
}
QStringList command;
command << "commit";
command << "-m";
//Note: the message is quoted somewhere else
command << message;
KJob *job = initJob(command);
connect(job, SIGNAL(result(KJob*)), this, SLOT(handleCommit(KJob*)));
job->start();
}
示例12: run
void KwlImporterJob::run()
{
if ( !userHasWallets() ) {
qDebug() << "No wallets are found into the user directory";
return;
}
// Now look for existing wallets, check if there is not a collection with the same label, and start the conversion job(s)
QDir dir(KGlobal::dirs()->saveLocation("data", "kwallet", false), "*.kwl");
dir.setFilter(QDir::Files | QDir::Hidden);
uint amount = 0;
foreach(const QFileInfo & fi, dir.entryInfoList()) {
KJob *importJob = new ImportSingleWalletJob( fi.absoluteFilePath(), this);
if ( !addSubjob( importJob ) ) {
qDebug() << "Cannot add import subjob";
}
importJob->start();
amount++;
}
setTotalAmount( Files, amount );
}
示例13: triggerImpl
void SuspendSession::triggerImpl(const QVariantMap &args)
{
qCDebug(POWERDEVIL) << "Suspend session triggered with" << args;
const auto mode = static_cast<Mode>(args["Type"].toUInt());
if (mode == ToRamMode || mode == ToDiskMode || mode == SuspendHybridMode) {
// don't suspend if shutting down
if (KWorkSpace::isShuttingDown()) {
qCDebug(POWERDEVIL) << "Not suspending because a shutdown is in progress";
return;
}
if (!args["SkipFade"].toBool()) {
m_savedArgs = args;
m_fadeEffect->start();
return;
}
}
if (args["GraceFade"].toBool()) {
return;
}
// Switch for real action
KJob *suspendJob = 0;
switch ((Mode) (args["Type"].toUInt())) {
case ToRamMode:
Q_EMIT aboutToSuspend();
suspendJob = backend()->suspend(PowerDevil::BackendInterface::ToRam);
break;
case ToDiskMode:
Q_EMIT aboutToSuspend();
suspendJob = backend()->suspend(PowerDevil::BackendInterface::ToDisk);
break;
case SuspendHybridMode:
Q_EMIT aboutToSuspend();
suspendJob = backend()->suspend(PowerDevil::BackendInterface::HybridSuspend);
break;
case ShutdownMode:
KWorkSpace::requestShutDown(KWorkSpace::ShutdownConfirmNo, KWorkSpace::ShutdownTypeHalt);
break;
case LogoutDialogMode:
KWorkSpace::requestShutDown(KWorkSpace::ShutdownConfirmYes);
break;
case LockScreenMode: {
// TODO should probably go through the backend (logind perhaps) eventually
QDBusConnection::sessionBus().asyncCall(QDBusMessage::createMethodCall("org.freedesktop.ScreenSaver",
"/ScreenSaver",
"org.freedesktop.ScreenSaver",
"Lock"));
break;
}
default:
break;
}
if (suspendJob) {
// TODO connect(suspendJob, &KJob::error ??, this, [this]() { m_fadeEffect->stop(); });
suspendJob->start();
}
}