Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportAsyncItemManager_p.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | |||||
48 | void AsyncItemManager::addItem(KReportAsyncItemBase* item, OROPage* page, OROSection* section, QPointF offset, QVariant data, KReportScriptHandler* script) | 48 | void AsyncItemManager::addItem(KReportAsyncItemBase* item, OROPage* page, OROSection* section, QPointF offset, QVariant data, KReportScriptHandler* script) | ||
49 | { | 49 | { | ||
50 | RenderData *rdata = new RenderData(); | 50 | RenderData *rdata = new RenderData(); | ||
51 | rdata->item = item; | 51 | rdata->item = item; | ||
52 | rdata->page = page; | 52 | rdata->page = page; | ||
53 | rdata->section = section; | 53 | rdata->section = section; | ||
54 | rdata->offset = offset; | 54 | rdata->offset = offset; | ||
55 | rdata->data = data; | 55 | rdata->data = data; | ||
56 | | ||||
56 | #ifdef KREPORT_SCRIPTING | 57 | #ifdef KREPORT_SCRIPTING | ||
57 | rdata->script = script; | 58 | rdata->script = script; | ||
58 | #else | 59 | #else | ||
59 | Q_UNUSED(script); | 60 | Q_UNUSED(script); | ||
60 | #endif | 61 | #endif | ||
61 | m_renderList.enqueue(rdata); | 62 | m_renderList.enqueue(rdata); | ||
62 | 63 | | |||
63 | //Just connect the first instance | 64 | //Just connect the first instance | ||
64 | if (!m_itemList.contains(item)) { | 65 | if (!m_itemList.contains(item)) { | ||
65 | m_itemList.append(item); | 66 | m_itemList.append(item); | ||
66 | connect(item, SIGNAL(finishedRendering()), this, SLOT(itemFinished())); | 67 | connect(item, SIGNAL(finishedRendering()), this, SLOT(itemFinished())); | ||
67 | } | 68 | } | ||
68 | //kreportDebug() << m_renderList.count(); | 69 | //kreportDebug() << m_renderList.count(); | ||
69 | } | 70 | } | ||
70 | 71 | | |||
71 | void AsyncItemManager::itemFinished() | 72 | void AsyncItemManager::itemFinished() | ||
72 | { | 73 | { | ||
74 | m_curDoc->updated(m_curPage->pageNumber()); | ||||
73 | //kreportDebug(); | 75 | //kreportDebug(); | ||
74 | if (m_renderList.count() > 0) { | 76 | if (m_renderList.count() > 0) { | ||
75 | RenderData *rdata = m_renderList.dequeue(); | 77 | RenderData *rdata = m_renderList.dequeue(); | ||
78 | m_curPage = rdata->page; | ||||
79 | m_curDoc = m_curPage->document(); | ||||
76 | rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script); | 80 | rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script); | ||
77 | } else { | 81 | } else { | ||
78 | emit(finished()); | 82 | emit(finished()); | ||
79 | } | 83 | } | ||
80 | } | 84 | } | ||
81 | 85 | | |||
82 | void AsyncItemManager::startRendering() | 86 | void AsyncItemManager::startRendering() | ||
83 | { | 87 | { | ||
84 | //kreportDebug(); | 88 | //kreportDebug(); | ||
85 | if (m_renderList.count() > 0) { | 89 | if (m_renderList.count() > 0) { | ||
86 | RenderData *rdata = m_renderList.dequeue(); | 90 | RenderData *rdata = m_renderList.dequeue(); | ||
91 | m_curPage = rdata->page; | ||||
92 | m_curDoc = m_curPage->document(); | ||||
87 | rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script); | 93 | rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script); | ||
88 | } else { | 94 | } else { | ||
89 | emit(finished()); | 95 | emit(finished()); | ||
90 | } | 96 | } | ||
91 | } | 97 | } | ||
92 | 98 | | |||
93 | } | 99 | } |