当前位置: 首页>>代码示例>>C++>>正文


C++ List::isEmpty方法代码示例

本文整理汇总了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()) {
开发者ID:KDE,项目名称:kdepim,代码行数:58,代码来源:konsolekalendar.cpp

示例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;
}
开发者ID:pvuorela,项目名称:kcalcore,代码行数:14,代码来源:dndfactory.cpp

示例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;
}
开发者ID:pvuorela,项目名称:kcalcore,代码行数:15,代码来源:dndfactory.cpp


注:本文中的event::List::isEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。