// Have to define before use
QDataStream& operator<< ( QDataStream &s, const MailSummary &d )
{
  s << d.serialNumber();
  s << d.messageId();
  s << d.subject();
  s << d.from();
  s << d.to();
  KDateTime tempTime;
  tempTime.setTime_t( d.date() );
  s << tempTime.dateTime();
  return s;
}
void KNFolder::DynData::getData( KNLocalArticle::Ptr a )
{
  a->setId(id);
  KDateTime dt;
  dt.setTime_t( ti );
  a->date()->setDateTime( dt );
  a->setStartOffset(so);
  a->setEndOffset(eo);
  a->setServerId(sId);
  a->setDoMail(flags[0]);
  a->setMailed(flags[1]);
  a->setDoPost(flags[2]);
  a->setPosted(flags[3]);
  a->setCanceled(flags[4]);
  a->setEditDisabled(flags[5]);
}
示例#3
0
		void shouldPopulateCommittedAtCorrectly() {
			QStringList rawData;
			rawData << "tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904";
			rawData << "parent abffc0ae9ba476fe1e9a30fa2c8903113dbadb3d";
			rawData << "author Me 1234567890 -0230";
			rawData << "committer You 1234567890 -0230";
			rawData << "";
			rawData << "Some message.";
			rawData << "";
			commit->fillFromString(rawData.join("\n"));

			KDateTime committedAt;
			committedAt.setTime_t(1234567890);
			committedAt.setTimeSpec(KDateTime::Spec(KDateTime::OffsetFromUTC, -9000/*==2,5h*/));
			QCOMPARE(commit->committedAt().toString(), committedAt.toString());
			QCOMPARE(commit->committedAt().utcOffset(), -9000);
		}
示例#4
0
文件: another.cpp 项目: w5292c/test
void test()
{
  KDateTime time;
  time.setTime_t(12345678);
  qDebug() << "Type:" << time.timeType();
  QList<QVariant> list;
  list << 123ULL << "Hello";
  qDebug() << "List:" << list;
#if 0
  QMessageLogContext context;
  context.function = "void AClass::hello(void)";
  context.file = "../src/another.cpp";
  context.category = "[EAS]";
  context.line = __LINE__;
//  qDebug() << qCleanupFuncinfo("void hello(void)");
  qDebug() << qMessageFormatString(QtDebugMsg, context, "This is a debug string");
#endif
}
示例#5
0
bool AllNotesListJob::shouldStartNewJob(const KUrl &prev, const KUrl &next)
{
    Q_UNUSED(next);
    Q_D(AllNotesListJob);
    const QString since = prev.queryItem("since");
    if (since.isEmpty()) {
        kDebug() << "Aborting notes fetching, no date range found in URL!";
        return false;
    }
    KDateTime sinceTime;
    sinceTime.setTime_t(since.toLongLong());
    if (!sinceTime.isValid()) {
        kDebug() << "Aborting notes fetching, invalid date range found in URL!";
        return false;
    }

    return (sinceTime >= d->lowerLimit);
}