Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/scripting/KReportScriptHandler.cpp
Show All 36 Lines | |||||
37 | class Q_DECL_HIDDEN KReportScriptHandler::Private | 37 | class Q_DECL_HIDDEN KReportScriptHandler::Private | ||
38 | { | 38 | { | ||
39 | public: | 39 | public: | ||
40 | Private(); | 40 | Private(); | ||
41 | ~Private(); | 41 | ~Private(); | ||
42 | KReportScriptConstants *constants; | 42 | KReportScriptConstants *constants; | ||
43 | KReportScriptDebug *debug; | 43 | KReportScriptDebug *debug; | ||
44 | KReportScriptDraw *draw; | 44 | KReportScriptDraw *draw; | ||
45 | | ||||
46 | Scripting::Report *report; | 45 | Scripting::Report *report; | ||
47 | | ||||
48 | const KReportData *reportData; | 46 | const KReportData *reportData; | ||
49 | | ||||
50 | QString source; | 47 | QString source; | ||
staniek: not needed, I propose to mark all these as false positives
or 3 of them can be changed to… | |||||
51 | KReportDocument *reportDocument; | 48 | KReportDocument *reportDocument; | ||
52 | | ||||
53 | QJSEngine engine; | 49 | QJSEngine engine; | ||
54 | QJSValue scriptValue; | 50 | QJSValue scriptValue; | ||
55 | | ||||
56 | QMap<QString, QVariant> groups; | 51 | QMap<QString, QVariant> groups; | ||
57 | QMap<KReportSectionData*, Scripting::Section*> sectionMap; | 52 | QMap<KReportSectionData*, Scripting::Section*> sectionMap; | ||
58 | }; | 53 | }; | ||
59 | 54 | | |||
60 | KReportScriptHandler::Private::Private() | 55 | KReportScriptHandler::Private::Private() : constants(new KReportScriptConstants), debug(new KReportScriptDebug), draw(new KReportScriptDraw) | ||
61 | { | 56 | { | ||
62 | //NOTE these are on the heap so that engine can delete them | | |||
63 | | ||||
64 | //Add constants object | | |||
65 | constants = new KReportScriptConstants(); | | |||
66 | | ||||
67 | //A simple debug function to allow printing from functions | | |||
68 | debug = new KReportScriptDebug(); | | |||
69 | | ||||
70 | //A simple drawing object | | |||
71 | draw = new KReportScriptDraw(); | | |||
72 | } | 57 | } | ||
73 | 58 | | |||
74 | KReportScriptHandler::Private::~Private() | 59 | KReportScriptHandler::Private::~Private() | ||
75 | { | 60 | { | ||
76 | } | 61 | } | ||
77 | 62 | | |||
78 | KReportScriptHandler::KReportScriptHandler(const KReportData* kodata, KReportDocument* doc) : d(new Private()) | 63 | KReportScriptHandler::KReportScriptHandler(const KReportData* kodata, KReportDocument* doc) : d(new Private()) | ||
79 | { | 64 | { | ||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |
not needed, I propose to mark all these as false positives
or 3 of them can be changed to initializers in Private()