本文整理汇总了C++中kio::CopyJob::setInteractive方法的典型用法代码示例。如果您正苦于以下问题:C++ CopyJob::setInteractive方法的具体用法?C++ CopyJob::setInteractive怎么用?C++ CopyJob::setInteractive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::CopyJob
的用法示例。
在下文中一共展示了CopyJob::setInteractive方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotCheckDownload
void KSUpgradeManager::slotCheckDownload(KIO::Job*, const QString &download, const QString &url)
{
switch(m_downloadState)
{
case(REMOVE_BACKUP):
{
KIO::DeleteJob *temp = KIO::del(KURL(download+"~"), false, false);
m_localFile = download;
m_remoteFile = url;
connect(temp, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckDownload(KIO::Job*)));
temp->setInteractive(false);
m_downloadState = BACKUP;
break;
}
case(BACKUP):
{
KIO::CopyJob *temp = KIO::move(KURL(m_localFile), KURL(m_localFile+"~"), false);
connect(temp, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckDownload(KIO::Job*)));
temp->setInteractive(false);
m_downloadState = DOWNLOAD;
break;
}
case(DOWNLOAD):
{
KIO::CopyJob *temp = KIO::copy(KURL(m_remoteFile), KURL(m_localFile), false);
connect(temp, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckDownload(KIO::Job*)));
connect(temp, SIGNAL(percent(KIO::Job*, unsigned long)), this, SLOT(slotProgress(KIO::Job*, unsigned long)));
temp->setInteractive(false);
m_downloadState = COMPLETE;
break;
}
case(DELETE_VERSION):
{
KIO::DeleteJob *temp = KIO::del(KURL(locateLocal("appdata", "version")), false, false);
connect(temp, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckDownload(KIO::Job*)));
temp->setInteractive(false);
m_downloadState = MOVE_VERSION;
break;
}
case(MOVE_VERSION):
{
KIO::CopyJob *temp = KIO::move(KURL("/tmp/version"), KURL(locateLocal("appdata", "version")), false);
connect(temp, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckDownload(KIO::Job*)));
temp->setInteractive(false);
m_downloadState = -1;
break;
}
case(COMPLETE):
{
m_mainWidget->downloadProgress->setProgress(0);
m_mainWidget->currentLabel->setText(i18n("nothing"));
m_completedDownloads++;
m_downloadState = DELETE_VERSION;
slotCheckDownload(0);
KSlovar::KSInstance()->loadLanguages();
break;
}
}
}
示例2: moveFileNoPermissions
void JobTest::moveFileNoPermissions()
{
kdDebug() << k_funcinfo << endl;
const QString src = "/etc/passwd";
const QString dest = homeTmpDir() + "passwd";
assert(QFile::exists(src));
assert(QFileInfo(src).isFile());
KURL u;
u.setPath(src);
KURL d;
d.setPath(dest);
KIO::CopyJob *job = KIO::move(u, d, 0);
job->setInteractive(false); // no skip dialog, thanks
QMap< QString, QString > metaData;
bool ok = KIO::NetAccess::synchronousRun(job, 0, 0, 0, &metaData);
assert(!ok);
assert(KIO::NetAccess::lastError() == KIO::ERR_ACCESS_DENIED);
// OK this is fishy. Just like mv(1), KIO's behavior depends on whether
// a direct rename(2) was used, or a full copy+del. In the first case
// there is no destination file created, but in the second case the
// destination file remains.
// In fact we assume /home is a separate partition, in this test, so:
assert(QFile::exists(dest));
assert(QFile::exists(src));
}
示例3: slotFinish
void KSWizard::slotFinish()
{
Configuration::setMouseNavigation(m_mouseNavigation->isChecked());
Configuration::setScrollBar(m_scrollBar->isChecked());
Configuration::setSmoothScroll(m_smoothScroll->isChecked());
Configuration::setAutoUpdateLanguage(m_upgradeManager->isChecked());
// Configuration::setAuthorName(m_authorName->text());
// Configuration::setAuthorEmail(m_authorEmail->text());
Configuration::writeConfig();
if(m_remoteLanguages->isChecked())
{
m_downloadProgress->setShown(true);
m_downloadLabel->setShown(true);
KIO::copy(KURL("http://kslovar.berlios.de/version"), KURL(locateLocal("appdata", "version", false)))->setInteractive(false);
KIO::CopyJob *download = KIO::copy(KURL("http://kslovar.berlios.de/languages.ldft"), KURL(locateLocal("appdata", "languages.ldft", false)), false);
connect(download, SIGNAL(result(KIO::Job*)), this, SLOT(slotCompletedDownload(KIO::Job*)));
connect(download, SIGNAL(percent(KIO::Job*, unsigned long)), this, SLOT(slotProgress(KIO::Job*, unsigned long)));
download->setInteractive(false);
}
示例4: moveDirectoryNoPermissions
void JobTest::moveDirectoryNoPermissions()
{
kdDebug() << k_funcinfo << endl;
const QString src = "/etc/init.d";
const QString dest = homeTmpDir() + "init.d";
assert(QFile::exists(src));
assert(QFileInfo(src).isDir());
KURL u;
u.setPath(src);
KURL d;
d.setPath(dest);
KIO::CopyJob *job = KIO::move(u, d, 0);
job->setInteractive(false); // no skip dialog, thanks
QMap< QString, QString > metaData;
bool ok = KIO::NetAccess::synchronousRun(job, 0, 0, 0, &metaData);
assert(!ok);
assert(KIO::NetAccess::lastError() == KIO::ERR_ACCESS_DENIED);
assert(QFile::exists(dest)); // see moveFileNoPermissions
assert(QFile::exists(src));
}
示例5: KDialogBase
KSUpgradeManager::KSUpgradeManager(QWidget *parent, const QString &caption)
: KDialogBase(parent, "KSDownloadManager", true, caption, Ok|Cancel), m_completedDownloads(0)
{
KIO::CopyJob *copy;
//Setting up the basics...
setButtonText(ButtonCode(Ok), i18n("Upgrade"));
setButtonText(ButtonCode(Cancel), i18n("Close"));
enableButtonOK(false);
m_mainWidget = new KSUpgradeManagerWdt(this);
setMainWidget(m_mainWidget);
m_mainWidget->downloadList->addColumn(i18n("File"));
//Download versioning files...
m_mainWidget->currentLabel->setText(i18n("Version files"));
copy = KIO::copy(KURL("http://kslovar.berlios.de/version"), KURL("/tmp/version"), false);
connect(copy, SIGNAL(result(KIO::Job*)), this, SLOT(slotCheckVersion()));
connect(copy, SIGNAL(percent(KIO::Job*, unsigned long)), this, SLOT(slotProgress(KIO::Job*, unsigned long)));
copy->setInteractive(false);
}