Merge lp:~nik90/ubuntu-clock-app/add-utility-backend into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Bartosz Kosiorek
Approved revision: 349
Merged at revision: 341
Proposed branch: lp:~nik90/ubuntu-clock-app/add-utility-backend
Merge into: lp:ubuntu-clock-app
Diff against target: 275 lines (+182/-2)
7 files modified
backend/CMakeLists.txt (+24/-2)
backend/modules/Clock/Utility/backend.cpp (+34/-0)
backend/modules/Clock/Utility/backend.h (+35/-0)
backend/modules/Clock/Utility/customalarmsound.cpp (+39/-0)
backend/modules/Clock/Utility/customalarmsound.h (+46/-0)
backend/modules/Clock/Utility/qmldir (+2/-0)
debian/changelog (+2/-0)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/add-utility-backend
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+268490@code.launchpad.net

Commit message

Added a clock utility c++ plugin housing customalarmsound type which is needed for the upcoming custom alarm sound feature.

Description of the change

Added a c++ backend plugin for
a) deleting files
b) returning the QStandardPath /home/phablet/.local/share/com.ubuntu.clock

This is necessary for the upcoming custom-alarm-sound feature implementation which requires the above mentioned functionalities.

To post a comment you must log in.
343. By Nekhelesh Ramananthan

removed clock utility import

344. By Nekhelesh Ramananthan

Fixed copyright year in backend.h

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
345. By Nekhelesh Ramananthan

Remove qCritical statement

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bartosz Kosiorek (gang65) wrote :

some inline comments.

review: Needs Information
346. By Nekhelesh Ramananthan

Merged standardpath and filemanagement into customalarmsound

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
347. By Nekhelesh Ramananthan

Updated debian changelog

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
348. By Nekhelesh Ramananthan

Removed Quick and GUI module loading for clock utility

349. By Nekhelesh Ramananthan

Merged lp:ubuntu-clock-app

Revision history for this message
Bartosz Kosiorek (gang65) wrote :

* Does the MP add/remove user visible strings? If Yes, has the pot file been
    updated?

No strings changed.

* Does the MP change the UI? If Yes, has it been approved by design?

No UX change

* Did you perform an exploratory manual test run of your code change and any
    related functionality?

Extensive testing done on desktop and phone

* If the MP fixes a bug or implements a feature, are there accompanying unit
    and autopilot tests?

Not required

* Is the clock app trunk buildable and runnable using Qtcreator?

Yes
* Was the debian changelog updated?

Yes

* Was the copyright years updated if necessary?

Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'backend/CMakeLists.txt'
--- backend/CMakeLists.txt 2015-08-18 05:03:59 +0000
+++ backend/CMakeLists.txt 2015-08-20 21:15:16 +0000
@@ -35,6 +35,12 @@
35)35)
3636
37set(37set(
38 clockutility_SRCS
39 modules/Clock/Utility/backend.cpp
40 modules/Clock/Utility/customalarmsound.cpp
41)
42
43set(
38 stopwatchlaphistory_SRCS44 stopwatchlaphistory_SRCS
39 modules/Stopwatch/LapHistory/backend.cpp45 modules/Stopwatch/LapHistory/backend.cpp
40 modules/Stopwatch/LapHistory/history.cpp46 modules/Stopwatch/LapHistory/history.cpp
@@ -56,11 +62,14 @@
56 ${geolocation_SRCS}62 ${geolocation_SRCS}
57)63)
5864
65add_library(clockutility MODULE
66 ${clockutility_SRCS}
67)
68
59add_library(stopwatchlaphistory MODULE69add_library(stopwatchlaphistory MODULE
60 ${stopwatchlaphistory_SRCS}70 ${stopwatchlaphistory_SRCS}
61)71)
6272
63
64set_target_properties(timezone PROPERTIES73set_target_properties(timezone PROPERTIES
65 LIBRARY_OUTPUT_DIRECTORY Timezone74 LIBRARY_OUTPUT_DIRECTORY Timezone
66)75)
@@ -77,6 +86,10 @@
77 LIBRARY_OUTPUT_DIRECTORY GeoLocation86 LIBRARY_OUTPUT_DIRECTORY GeoLocation
78)87)
7988
89set_target_properties(clockutility PROPERTIES
90 LIBRARY_OUTPUT_DIRECTORY Clock/Utility
91)
92
80set_target_properties(stopwatchlaphistory PROPERTIES93set_target_properties(stopwatchlaphistory PROPERTIES
81 LIBRARY_OUTPUT_DIRECTORY Stopwatch/LapHistory94 LIBRARY_OUTPUT_DIRECTORY Stopwatch/LapHistory
82)95)
@@ -85,6 +98,7 @@
85qt5_use_modules(timezone Gui Qml Quick)98qt5_use_modules(timezone Gui Qml Quick)
86qt5_use_modules(alarmsettings Gui Qml Quick DBus)99qt5_use_modules(alarmsettings Gui Qml Quick DBus)
87qt5_use_modules(geolocation Gui Qml Quick)100qt5_use_modules(geolocation Gui Qml Quick)
101qt5_use_modules(clockutility Qml)
88qt5_use_modules(stopwatchlaphistory Qml)102qt5_use_modules(stopwatchlaphistory Qml)
89103
90# Copy qmldir file to build dir for running in QtCreator104# Copy qmldir file to build dir for running in QtCreator
@@ -108,12 +122,16 @@
108 DEPENDS ${QMLFILES}122 DEPENDS ${QMLFILES}
109)123)
110124
125add_custom_target(clockutility-qmldir ALL
126 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Clock/Utility/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Clock/Utility
127 DEPENDS ${QMLFILES}
128)
129
111add_custom_target(stopwatchlaphistory-qmldir ALL130add_custom_target(stopwatchlaphistory-qmldir ALL
112 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Stopwatch/LapHistory/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Stopwatch/LapHistory131 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Stopwatch/LapHistory/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Stopwatch/LapHistory
113 DEPENDS ${QMLFILES}132 DEPENDS ${QMLFILES}
114)133)
115134
116
117# Install plugin file135# Install plugin file
118install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/)136install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/)
119install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/)137install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/)
@@ -127,5 +145,9 @@
127install(TARGETS geolocation DESTINATION ${MODULE_PATH}/GeoLocation/)145install(TARGETS geolocation DESTINATION ${MODULE_PATH}/GeoLocation/)
128install(FILES modules/GeoLocation/qmldir DESTINATION ${MODULE_PATH}/GeoLocation/)146install(FILES modules/GeoLocation/qmldir DESTINATION ${MODULE_PATH}/GeoLocation/)
129147
148install(TARGETS clockutility DESTINATION ${MODULE_PATH}/Clock/Utility/)
149install(FILES modules/Clock/Utility/qmldir DESTINATION ${MODULE_PATH}/Clock/Utility/)
150
130install(TARGETS stopwatchlaphistory DESTINATION ${MODULE_PATH}/Stopwatch/LapHistory/)151install(TARGETS stopwatchlaphistory DESTINATION ${MODULE_PATH}/Stopwatch/LapHistory/)
131install(FILES modules/Stopwatch/LapHistory/qmldir DESTINATION ${MODULE_PATH}/Stopwatch/LapHistory/)152install(FILES modules/Stopwatch/LapHistory/qmldir DESTINATION ${MODULE_PATH}/Stopwatch/LapHistory/)
153
132154
=== added directory 'backend/modules/Clock'
=== added directory 'backend/modules/Clock/Utility'
=== added file 'backend/modules/Clock/Utility/backend.cpp'
--- backend/modules/Clock/Utility/backend.cpp 1970-01-01 00:00:00 +0000
+++ backend/modules/Clock/Utility/backend.cpp 2015-08-20 21:15:16 +0000
@@ -0,0 +1,34 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <QtQml>
20#include <QtQml/QQmlContext>
21#include "backend.h"
22#include "customalarmsound.h"
23
24void BackendPlugin::registerTypes(const char *uri)
25{
26 Q_ASSERT(uri == QLatin1String("Clock.Utility"));
27
28 qmlRegisterType<CustomAlarmSound>(uri, 1, 0, "CustomAlarmSound");
29}
30
31void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
32{
33 QQmlExtensionPlugin::initializeEngine(engine, uri);
34}
035
=== added file 'backend/modules/Clock/Utility/backend.h'
--- backend/modules/Clock/Utility/backend.h 1970-01-01 00:00:00 +0000
+++ backend/modules/Clock/Utility/backend.h 2015-08-20 21:15:16 +0000
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef BACKEND_PLUGIN_H
20#define BACKEND_PLUGIN_H
21
22#include <QtQml/QQmlEngine>
23#include <QtQml/QQmlExtensionPlugin>
24
25class BackendPlugin : public QQmlExtensionPlugin
26{
27 Q_OBJECT
28 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
29
30public:
31 void registerTypes(const char *uri);
32 void initializeEngine(QQmlEngine *engine, const char *uri);
33};
34#endif // BACKEND_PLUGIN_H
35
036
=== added file 'backend/modules/Clock/Utility/customalarmsound.cpp'
--- backend/modules/Clock/Utility/customalarmsound.cpp 1970-01-01 00:00:00 +0000
+++ backend/modules/Clock/Utility/customalarmsound.cpp 2015-08-20 21:15:16 +0000
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include <QDir>
20#include <QStandardPaths>
21
22#include "customalarmsound.h"
23
24CustomAlarmSound::CustomAlarmSound(QObject *parent):
25 QObject(parent),
26 m_customAlarmDir(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first())
27{
28}
29
30QString CustomAlarmSound::alarmSoundDirectory() const
31{
32 return m_customAlarmDir;
33}
34
35void CustomAlarmSound::deleteAlarmSound(const QString &soundName)
36{
37 QDir dir(m_customAlarmDir);
38 dir.remove(soundName);
39}
040
=== added file 'backend/modules/Clock/Utility/customalarmsound.h'
--- backend/modules/Clock/Utility/customalarmsound.h 1970-01-01 00:00:00 +0000
+++ backend/modules/Clock/Utility/customalarmsound.h 2015-08-20 21:15:16 +0000
@@ -0,0 +1,46 @@
1/*
2 * Copyright (C) 2015 Canonical Ltd
3 *
4 * This file is part of Ubuntu Clock App
5 *
6 * Ubuntu Clock App is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 3 as
8 * published by the Free Software Foundation.
9 *
10 * Ubuntu Clock App is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef CUSTOMALARMSOUND_H
20#define CUSTOMALARMSOUND_H
21
22#include <QObject>
23
24class CustomAlarmSound: public QObject
25{
26 Q_OBJECT
27
28 // READONLY Property to return the custom alarm sound directory path
29 Q_PROPERTY( QString alarmSoundDirectory
30 READ alarmSoundDirectory)
31
32public:
33 CustomAlarmSound(QObject *parent = 0);
34
35 // Function to return the custom alarm sound directory path
36 QString alarmSoundDirectory() const;
37
38public slots:
39 // Function to delete a custom alarm sound
40 void deleteAlarmSound(const QString &soundName);
41
42private:
43 QString m_customAlarmDir;
44};
45
46#endif
047
=== added file 'backend/modules/Clock/Utility/qmldir'
--- backend/modules/Clock/Utility/qmldir 1970-01-01 00:00:00 +0000
+++ backend/modules/Clock/Utility/qmldir 2015-08-20 21:15:16 +0000
@@ -0,0 +1,2 @@
1module Clock.Utility
2plugin clockutility
03
=== modified file 'debian/changelog'
--- debian/changelog 2015-08-20 20:37:03 +0000
+++ debian/changelog 2015-08-20 21:15:16 +0000
@@ -16,6 +16,8 @@
16 * Added README.mergeproposal checklist to help with the review process.16 * Added README.mergeproposal checklist to help with the review process.
17 * Fix alarm interval information being inconsistent (LP: #1466000)17 * Fix alarm interval information being inconsistent (LP: #1466000)
18 * Changed default alarm sound (LP: #1354370)18 * Changed default alarm sound (LP: #1354370)
19 * Added Clock Utility C++ plugin housing CustomAlarmSound type required
20 for custom alarm sound feature
1921
20 [Victor Thompson]22 [Victor Thompson]
21 * Show all README files in QtCreator 23 * Show all README files in QtCreator

Subscribers

People subscribed via source and target branches