/* * Copyright (C) 2015 Christian Mollekopf * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "dummystore.h" #include static QMap createEvent(int i) { QMap event; event.insert("summary", QString("summary%1").arg(i)); static const size_t attachmentSize = 1024*2; // 2KB event.insert("attachment", QByteArray(attachmentSize, 'c')); return event; } static QMap createMail(int i) { QMap mail; mail.insert("subject", QString("subject%1").arg(i)); return mail; } QMap > populateEvents() { QMap> content; for (int i = 0; i < 2; i++) { content.insert(QString("key%1").arg(i), createEvent(i)); } return content; } QMap > populateMails() { QMap> content; for (int i = 0; i < 2; i++) { content.insert(QString("key%1").arg(i), createMail(i)); } return content; } static QMap > s_eventSource = populateEvents(); static QMap > s_mailSource = populateMails(); QMap > DummyStore::events() const { return s_eventSource; } QMap > DummyStore::mails() const { return s_mailSource; }