本文整理汇总了C++中event::List::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ List::isEmpty方法的具体用法?C++ List::isEmpty怎么用?C++ List::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类event::List
的用法示例。
在下文中一共展示了List::isEmpty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: showInstance
bool KonsoleKalendar::showInstance()
{
bool status = true;
QFile f;
QString title;
Event::Ptr event;
const KDateTime::Spec timeSpec = m_variables->getCalendar()->timeSpec();
Akonadi::CalendarBase::Ptr calendar = m_variables->getCalendar();
if (m_variables->isDryRun()) {
cout << i18n("View Events <Dry Run>:").toLocal8Bit().data()
<< endl;
printSpecs();
} else {
qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
<< "open export file";
if (m_variables->isExportFile()) {
f.setFileName(m_variables->getExportFile());
if (!f.open(QIODevice::WriteOnly)) {
status = false;
qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
<< "unable to open export file"
<< m_variables->getExportFile();
}
} else {
f.open(stdout, QIODevice::WriteOnly);
}
if (status) {
qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
<< "opened successful";
if (m_variables->isVerbose()) {
cout << i18n("View Event <Verbose>:").toLocal8Bit().data()
<< endl;
printSpecs();
}
QTextStream ts(&f);
if (m_variables->getExportType() != ExportTypeHTML &&
m_variables->getExportType() != ExportTypeMonthHTML) {
if (m_variables->getAll()) {
qCDebug(KONSOLEKALENDAR_LOG) << "konsolekalendar.cpp::showInstance() |"
<< "view all events sorted list";
Event::List sortedList = calendar->events(EventSortStartDate);
qCDebug(KONSOLEKALENDAR_LOG) << "Found" << sortedList.count() << "events";
if (!sortedList.isEmpty()) {
// The code that was here before the akonadi port was really slow with 200 events
// this is much faster:
foreach (const KCalCore::Event::Ptr &event, sortedList) {
status &= printEvent(&ts, event, event->dtStart().date());
}
}
} else if (m_variables->isUID()) {
示例2: createDropEvent
Event::Ptr DndFactory::createDropEvent( const QMimeData *mimeData )
{
//kDebug();
Event::Ptr event;
MemoryCalendar::Ptr calendar( createDropCalendar( mimeData ) );
if ( calendar ) {
Event::List events = calendar->events();
if ( !events.isEmpty() ) {
event = Event::Ptr( new Event( *events.first() ) );
}
}
return event;
}
示例3: kDebug
Event *DndFactory::createDropEvent( const QMimeData *md )
{
kDebug();
Event *ev = 0;
Calendar *cal = createDropCalendar( md );
if ( cal ) {
Event::List events = cal->events();
if ( !events.isEmpty() ) {
ev = new Event( *events.first() );
}
delete cal;
}
return ev;
}