本文整理汇总了C++中kio::StoredTransferJob::setModificationTime方法的典型用法代码示例。如果您正苦于以下问题:C++ StoredTransferJob::setModificationTime方法的具体用法?C++ StoredTransferJob::setModificationTime怎么用?C++ StoredTransferJob::setModificationTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kio::StoredTransferJob
的用法示例。
在下文中一共展示了StoredTransferJob::setModificationTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: openFileReading
void JobRemoteTest::openFileReading()
{
const QString filePath = remoteTmpDir() + "openFileReading";
KUrl u(filePath);
const QByteArray putData("test1test2test3test4test5");
KIO::StoredTransferJob * putJob = KIO::storedPut( putData,
u,
0600, KIO::Overwrite | KIO::HideProgressInfo
);
QDateTime mtime = QDateTime::currentDateTime().addSecs( -30 ); // 30 seconds ago
mtime.setTime_t(mtime.toTime_t()); // hack for losing the milliseconds
putJob->setModificationTime(mtime);
putJob->setUiDelegate( 0 );
connect( putJob, SIGNAL( result(KJob*) ),
this, SLOT( slotResult(KJob*) ) );
m_result = -1;
enterLoop();
QVERIFY( m_result == 0 ); // no error
m_rwCount = 4;
m_data = QByteArray();
fileJob = KIO::open(u, QIODevice::ReadOnly);
fileJob->setUiDelegate( 0 );
connect( fileJob, SIGNAL( result(KJob*) ),
this, SLOT( slotResult(KJob*) ) );
connect( fileJob, SIGNAL(data(KIO::Job*, const QByteArray&)),
this, SLOT(slotFileJob2Data(KIO::Job*, const QByteArray&)) );
connect( fileJob, SIGNAL(open(KIO::Job*)),
this, SLOT(slotFileJob2Open(KIO::Job*)) );
connect( fileJob, SIGNAL(written(KIO::Job *, KIO::filesize_t)),
this, SLOT(slotFileJob2Written (KIO::Job *, KIO::filesize_t)) );
connect( fileJob, SIGNAL(position (KIO::Job *, KIO::filesize_t)),
this, SLOT(slotFileJob2Position (KIO::Job *, KIO::filesize_t)) );
connect( fileJob, SIGNAL(close(KIO::Job*)),
this, SLOT(slotFileJob2Close(KIO::Job*)) );
m_result = -1;
enterLoop();
QVERIFY( m_result == 0 ); // no error
kDebug() << "resulting m_data: " << QString(m_data);
QCOMPARE( m_data, QByteArray("test5test4test3test2test1"));
}