Changeset View
Changeset View
Standalone View
Standalone View
autotests/loadcalendar.cpp
Show All 35 Lines | 33 | { | |||
---|---|---|---|---|---|
36 | 36 | | |||
37 | QCoreApplication app(argc, argv); | 37 | QCoreApplication app(argc, argv); | ||
38 | QCoreApplication::setApplicationName(QStringLiteral("testincidence")); | 38 | QCoreApplication::setApplicationName(QStringLiteral("testincidence")); | ||
39 | QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); | 39 | QCoreApplication::setApplicationVersion(QStringLiteral("0.1")); | ||
40 | parser.process(app); | 40 | parser.process(app); | ||
41 | 41 | | |||
42 | MemoryCalendar::Ptr cal(new MemoryCalendar(QTimeZone::utc())); | 42 | MemoryCalendar::Ptr cal(new MemoryCalendar(QTimeZone::utc())); | ||
43 | FileStorage store(cal, QStringLiteral("cal")); | 43 | FileStorage store(cal, QStringLiteral("cal")); | ||
44 | store.load(); | 44 | if (!store.load()) { | ||
45 | qWarning() << "Error storing into memory calendar"; | ||||
46 | return 1; | ||||
47 | } | ||||
45 | 48 | | |||
46 | Todo::List todoList; | 49 | Todo::List todoList; | ||
47 | 50 | | |||
48 | // Build dictionary to look up Task object from Todo uid. Each task is a | 51 | // Build dictionary to look up Task object from Todo uid. Each task is a | ||
49 | // QListViewItem, and is initially added with the view as the parent. | 52 | // QListViewItem, and is initially added with the view as the parent. | ||
50 | todoList = cal->rawTodos(); | 53 | todoList = cal->rawTodos(); | ||
51 | 54 | | |||
52 | if (todoList.isEmpty()) { | 55 | if (todoList.isEmpty()) { | ||
Show All 15 Lines |