From 94a2cd6ec21bf0466a9a50d6e4a0a956ed47bc82 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 19 Nov 2015 23:23:56 +0100 Subject: Move implementations to the cpp file. I finally figured out how to do that with cpp files. It requires instantiating the code with all expected classes, but that's not a big problem since we know all types. This will hopefully greatly reduce the compiletimes... --- examples/dummyresource/dummystore.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'examples/dummyresource') diff --git a/examples/dummyresource/dummystore.cpp b/examples/dummyresource/dummystore.cpp index 0356ec0..39ecfe4 100644 --- a/examples/dummyresource/dummystore.cpp +++ b/examples/dummyresource/dummystore.cpp @@ -36,6 +36,13 @@ static QMap createMail(int i) return mail; } +static QMap createFolder(int i) +{ + QMap folder; + folder.insert("name", QString("folder%1").arg(i)); + return folder; +} + QMap > populateEvents() { QMap> content; @@ -54,8 +61,18 @@ QMap > populateMails() return content; } +QMap > populateFolders() +{ + QMap> content; + for (int i = 0; i < 5000; i++) { + content.insert(QString("key%1").arg(i), createFolder(i)); + } + return content; +} + static QMap > s_eventSource = populateEvents(); static QMap > s_mailSource = populateMails(); +static QMap > s_folderSource = populateFolders(); QMap > DummyStore::events() const { @@ -66,3 +83,8 @@ QMap > DummyStore::mails() const { return s_mailSource; } + +QMap > DummyStore::folders() const +{ + return s_folderSource; +} -- cgit v1.2.3