on xenial help sign in
Cleanups from review.
commitb9dd4e2756ac4c3ba629a06934d9a821fd35fce1 authorRodney Dawes <rodney.dawes@canonical.com> dateFri 27 Jun 2014, 11:23 (12 years ago) parented28e0c
4 files changed+10−26
plugins/Ubuntu/Payments/Payments.cpp+5−9 plugins/Ubuntu/Payments/Payments.h−3 plugins/Ubuntu/Payments/plugin.cpp+1−8 plugins/Ubuntu/Payments/plugin.h+4−6
plugins/Ubuntu/Payments/Payments.cpp+5−9
@@ -16,9 +16,7 @@
1616 * License along with this program. If not, see <http://www.gnu.org/licenses/>
1717 */
1818
19−#include <QDebug>
2019#include <QLocale>
21−#include <QTimer>
2220
2321#include <libpay/pay-package.h>
2422
@@ -86,7 +84,7 @@ QString Payments::formattedPrice() const
8684
8785void Payments::setCurrency(const QString &currency)
8886{
89− if(m_currency != currency){
87+ if(m_currency != currency) {
9088 m_currency = currency;
9189 Q_EMIT currencyChanged(currency);
9290 Q_EMIT formattedPriceChanged(formattedPrice());
@@ -95,7 +93,7 @@ void Payments::setCurrency(const QString &currency)
9593
9694void Payments::setPrice(const double price)
9795{
98− if(m_price != price){
96+ if(m_price != price) {
9997 m_price = price;
10098 Q_EMIT priceChanged(price);
10199 Q_EMIT formattedPriceChanged(formattedPrice());
@@ -104,7 +102,7 @@ void Payments::setPrice(const double price)
104102
105103void Payments::setStoreItemId(const QString &store_item_id)
106104{
107− if (m_store_item_id != store_item_id){
105+ if (m_store_item_id != store_item_id) {
108106 m_store_item_id = store_item_id;
109107 Q_EMIT storeItemIdChanged(m_store_item_id);
110108 }
@@ -113,12 +111,10 @@ void Payments::setStoreItemId(const QString &store_item_id)
113111 return;
114112 }
115113
116− pay_package_item_start_verification(m_package,
117− m_store_item_id.toLocal8Bit().data());
114+ pay_package_item_start_verification(m_package, m_store_item_id.toLocal8Bit().data());
118115}
119116
120117void Payments::start()
121118{
122− pay_package_item_start_purchase(m_package,
123− m_store_item_id.toLocal8Bit().data());
119+ pay_package_item_start_purchase(m_package, m_store_item_id.toLocal8Bit().data());
124120}
plugins/Ubuntu/Payments/Payments.h−3
@@ -21,7 +21,6 @@
2121#define PAYMENTS_H
2222
2323#include <QObject>
24−#include <QDBusObjectPath>
2524
2625#include <libpay/pay-package.h>
2726
@@ -65,8 +64,6 @@ private:
6564 QString m_store_item_id;
6665
6766 PayPackage *m_package;
68−
69− void startService();
7067};
7168
7269#endif // PAYMENTS_H
plugins/Ubuntu/Payments/plugin.cpp+1−8
@@ -16,13 +16,11 @@
1616 * License along with this program. If not, see <http://www.gnu.org/licenses/>
1717 */
1818
19+#include <QtQml>
1920
2021#include "plugin.h"
2122#include "Payments.h"
2223
23−#include <QtQml/qqml.h>
24−#include <QtQml/QQmlContext>
25−
2624
2725void BackendPlugin::registerTypes(const char *uri)
2826{
@@ -30,8 +28,3 @@ void BackendPlugin::registerTypes(const char *uri)
3028
3129 qmlRegisterType<Payments>(uri, 0, 1, "Payments");
3230}
33−
34−void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
35−{
36− QQmlExtensionPlugin::initializeEngine(engine, uri);
37−}
plugins/Ubuntu/Payments/plugin.h+4−6
@@ -16,11 +16,9 @@
1616 * License along with this program. If not, see <http://www.gnu.org/licenses/>
1717 */
1818
19+#ifndef PAYMENTS_PLUGIN_H
20+#define PAYMENTS_PLUGIN_H
1921
20−#ifndef BACKEND_PLUGIN_H
21−#define BACKEND_PLUGIN_H
22−
23−#include <QQmlEngine>
2422#include <QQmlExtensionPlugin>
2523
2624class BackendPlugin : public QQmlExtensionPlugin
@@ -30,6 +28,6 @@ class BackendPlugin : public QQmlExtensionPlugin
3028
3129public:
3230 void registerTypes(const char *uri);
33− void initializeEngine(QQmlEngine *engine, const char *uri);
3431};
35−#endif // BACKEND_PLUGIN_H
32+
33+#endif // PAYMENTS_PLUGIN_H