Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/views/reports/reportsview.cpp
- This file was moved from kmymoney/plugins/forecast/forecastview.cpp.
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | forecastview.cpp | 2 | reportsview.cpp | ||
3 | ------------------- | 3 | ------------------- | ||
4 | 4 | | |||
5 | copyright : (C) 2018 by Łukasz Wojniłowicz | 5 | copyright : (C) 2018 by Łukasz Wojniłowicz | ||
6 | email : lukasz.wojnilowicz@gmail.com | 6 | email : lukasz.wojnilowicz@gmail.com | ||
7 | ***************************************************************************/ | 7 | ***************************************************************************/ | ||
8 | 8 | | |||
9 | /*************************************************************************** | 9 | /*************************************************************************** | ||
10 | * * | 10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * | ||
15 | * * | 15 | * * | ||
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #include "forecastview.h" | 18 | #include "reportsview.h" | ||
19 | 19 | | |||
20 | // ---------------------------------------------------------------------------- | 20 | // ---------------------------------------------------------------------------- | ||
21 | // QT Includes | 21 | // QT Includes | ||
22 | 22 | | |||
23 | // ---------------------------------------------------------------------------- | 23 | // ---------------------------------------------------------------------------- | ||
24 | // KDE Includes | 24 | // KDE Includes | ||
25 | 25 | | |||
26 | #include <KPluginFactory> | 26 | #include <KPluginFactory> | ||
27 | #include <KLocalizedString> | 27 | #include <KLocalizedString> | ||
28 | 28 | | |||
29 | // ---------------------------------------------------------------------------- | 29 | // ---------------------------------------------------------------------------- | ||
30 | // Project Includes | 30 | // Project Includes | ||
31 | 31 | | |||
32 | #include "viewinterface.h" | 32 | #include "viewinterface.h" | ||
33 | #include "kforecastview.h" | 33 | #include "kreportsview.h" | ||
34 | 34 | | |||
35 | ForecastView::ForecastView(QObject *parent, const QVariantList &args) : | 35 | ReportsView::ReportsView(QObject *parent, const QVariantList &args) : | ||
36 | KMyMoneyPlugin::Plugin(parent, "forecastview"/*must be the same as X-KDE-PluginInfo-Name*/), | 36 | KMyMoneyPlugin::Plugin(parent, "reportsview"/*must be the same as X-KDE-PluginInfo-Name*/), | ||
37 | m_view(nullptr) | 37 | m_view(nullptr) | ||
38 | { | 38 | { | ||
39 | Q_UNUSED(args) | 39 | Q_UNUSED(args) | ||
40 | setComponentName("forecastview", i18n("Forecast view")); | 40 | setComponentName("reportsview", i18n("Reports view")); | ||
41 | // For information, announce that we have been loaded. | 41 | // For information, announce that we have been loaded. | ||
42 | qDebug("Plugins: forecastview loaded"); | 42 | qDebug("Plugins: reportsview loaded"); | ||
43 | } | 43 | } | ||
44 | 44 | | |||
45 | ForecastView::~ForecastView() | 45 | ReportsView::~ReportsView() | ||
46 | { | 46 | { | ||
47 | qDebug("Plugins: forecastview unloaded"); | 47 | qDebug("Plugins: reportsview unloaded"); | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | void ForecastView::plug() | 50 | void ReportsView::plug() | ||
51 | { | 51 | { | ||
52 | m_view = new KForecastView; | 52 | m_view = new KReportsView; | ||
53 | viewInterface()->addView(m_view, i18n("Forecast"), View::Forecast); | 53 | viewInterface()->addView(m_view, i18n("Reports"), View::Reports); | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | void ForecastView::unplug() | 56 | void ReportsView::unplug() | ||
57 | { | 57 | { | ||
58 | viewInterface()->removeView(View::Forecast); | 58 | viewInterface()->removeView(View::Reports); | ||
59 | } | 59 | } | ||
60 | 60 | | |||
61 | K_PLUGIN_FACTORY_WITH_JSON(ForecastViewFactory, "forecastview.json", registerPlugin<ForecastView>();) | 61 | K_PLUGIN_FACTORY_WITH_JSON(ReportsViewFactory, "reportsview.json", registerPlugin<ReportsView>();) | ||
62 | 62 | | |||
63 | #include "forecastview.moc" | 63 | #include "reportsview.moc" |