Merge lp:~nik90/ubuntu-clock-app/backend-plugins-rename into lp:ubuntu-clock-app

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Bartosz Kosiorek
Approved revision: 369
Merged at revision: 363
Proposed branch: lp:~nik90/ubuntu-clock-app/backend-plugins-rename
Merge into: lp:ubuntu-clock-app
Diff against target: 917 lines (+106/-378)
28 files modified
app/alarm/AlarmSettingsPage.qml (+2/-2)
app/alarm/AlarmSound.qml (+1/-1)
app/alarm/EditAlarmPage.qml (+2/-2)
app/clock/ClockPage.qml (+1/-1)
app/ubuntu-clock-app.qml (+2/-2)
app/worldclock/UserWorldCityList.qml (+1/-1)
app/worldclock/WorldCityList.qml (+1/-1)
backend/CMakeLists.txt (+41/-107)
backend/modules/Alarm/backend.cpp (+5/-3)
backend/modules/Alarm/qmldir (+2/-2)
backend/modules/Alarm/settings.cpp (+13/-13)
backend/modules/Alarm/settings.h (+4/-4)
backend/modules/Alarm/sound.cpp (+10/-10)
backend/modules/Alarm/sound.h (+4/-4)
backend/modules/DateTime/backend.cpp (+0/-34)
backend/modules/DateTime/backend.h (+0/-35)
backend/modules/DateTime/qmldir (+0/-2)
backend/modules/GeoLocation/backend.cpp (+0/-34)
backend/modules/GeoLocation/backend.h (+0/-35)
backend/modules/GeoLocation/qmldir (+0/-2)
backend/modules/Timezone/backend.cpp (+0/-39)
backend/modules/Timezone/backend.h (+0/-35)
backend/modules/Timezone/qmldir (+0/-2)
backend/modules/WorldClock/backend.cpp (+12/-3)
backend/modules/WorldClock/qmldir (+2/-2)
debian/changelog (+1/-0)
tests/unit/MockClockApp.qml (+1/-1)
tests/unit/tst_alarm.qml (+1/-1)
To merge this branch: bzr merge lp:~nik90/ubuntu-clock-app/backend-plugins-rename
Reviewer Review Type Date Requested Status
Bartosz Kosiorek Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Abstain
Review via email: mp+269089@code.launchpad.net

Commit message

Renamed C++ plugins and grouped them by functionality. We have 3 main plugins Clock, Alarm and Stopwatch. Each plugin has its own classes like TimeZone, DateTime, LapHistory etc.

Description of the change

Rename backend plugins as we discussed

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Still need to add entry to debian changelog. However I just wanted to get your opinion on this.

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

renamed Clock to WorldClock

367. By Nekhelesh Ramananthan

Renamed Settings to AlarmSettings and also Sound to AlarmSound

368. By Nekhelesh Ramananthan

merged trunk

369. By Nekhelesh Ramananthan

Updated debian changelog

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Fixed the initial set of comments mentioned by bartosz on g+. Also updated debian changelog

review: Abstain
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 :

Nice job.

One small nitpick: Instead of Settings::Settings it should be AlarmSettings::AlarmSettings.
We decided that it is more clear for developers.

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

Everything is fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/alarm/AlarmSettingsPage.qml'
2--- app/alarm/AlarmSettingsPage.qml 2015-08-14 05:34:49 +0000
3+++ app/alarm/AlarmSettingsPage.qml 2015-08-26 23:37:55 +0000
4@@ -18,8 +18,8 @@
5
6 import QtQuick 2.4
7 import QtQuick.Layouts 1.1
8-import DateTime 1.0
9-import Alarm.Settings 1.0
10+import WorldClock 1.0
11+import Alarm 1.0
12 import Ubuntu.Components 1.2
13 import "../components"
14
15
16=== modified file 'app/alarm/AlarmSound.qml'
17--- app/alarm/AlarmSound.qml 2015-08-24 15:08:21 +0000
18+++ app/alarm/AlarmSound.qml 2015-08-26 23:37:55 +0000
19@@ -17,7 +17,7 @@
20 */
21
22 import QtQuick 2.4
23-import Clock.Utility 1.0
24+import Alarm 1.0
25 import QtMultimedia 5.0
26 import Ubuntu.Content 1.1
27 import Ubuntu.Components 1.2
28
29=== modified file 'app/alarm/EditAlarmPage.qml'
30--- app/alarm/EditAlarmPage.qml 2015-08-25 11:39:19 +0000
31+++ app/alarm/EditAlarmPage.qml 2015-08-26 23:37:55 +0000
32@@ -17,8 +17,8 @@
33 */
34
35 import QtQuick 2.4
36-import DateTime 1.0
37-import Clock.Utility 1.0
38+import WorldClock 1.0
39+import Alarm 1.0
40 import Ubuntu.Components 1.2
41 import Qt.labs.folderlistmodel 2.1
42 import Ubuntu.Components.Pickers 1.0
43
44=== modified file 'app/clock/ClockPage.qml'
45--- app/clock/ClockPage.qml 2015-08-17 14:09:09 +0000
46+++ app/clock/ClockPage.qml 2015-08-26 23:37:55 +0000
47@@ -20,7 +20,7 @@
48 import U1db 1.0 as U1db
49 import QtPositioning 5.2
50 import Ubuntu.Components 1.2
51-import GeoLocation 1.0
52+import WorldClock 1.0
53 import "../components"
54 import "../worldclock"
55
56
57=== modified file 'app/ubuntu-clock-app.qml'
58--- app/ubuntu-clock-app.qml 2015-08-24 15:08:21 +0000
59+++ app/ubuntu-clock-app.qml 2015-08-26 23:37:55 +0000
60@@ -17,9 +17,9 @@
61 */
62
63 import QtQuick 2.4
64-import DateTime 1.0
65+import WorldClock 1.0
66 import U1db 1.0 as U1db
67-import Clock.Utility 1.0
68+import Alarm 1.0
69 import Ubuntu.Components 1.2
70 import "components"
71
72
73=== modified file 'app/worldclock/UserWorldCityList.qml'
74--- app/worldclock/UserWorldCityList.qml 2015-08-17 12:27:20 +0000
75+++ app/worldclock/UserWorldCityList.qml 2015-08-26 23:37:55 +0000
76@@ -17,7 +17,7 @@
77 */
78
79 import QtQuick 2.4
80-import Timezone 1.0
81+import WorldClock 1.0
82 import U1db 1.0 as U1db
83 import Ubuntu.Components 1.2
84
85
86=== modified file 'app/worldclock/WorldCityList.qml'
87--- app/worldclock/WorldCityList.qml 2015-08-14 05:34:49 +0000
88+++ app/worldclock/WorldCityList.qml 2015-08-26 23:37:55 +0000
89@@ -17,7 +17,7 @@
90 */
91
92 import QtQuick 2.4
93-import Timezone 1.0
94+import WorldClock 1.0
95 import Ubuntu.Components 1.2
96 import "../components"
97 import "../upstreamcomponents"
98
99=== modified file 'backend/CMakeLists.txt'
100--- backend/CMakeLists.txt 2015-08-26 22:41:34 +0000
101+++ backend/CMakeLists.txt 2015-08-26 23:37:55 +0000
102@@ -8,36 +8,21 @@
103 )
104
105 set(
106- timezone_SRCS
107- modules/Timezone/backend.cpp
108- modules/Timezone/timezonemodel.cpp
109- modules/Timezone/generictimezonemodel.cpp
110- modules/Timezone/jsontimezonemodel.cpp
111- modules/Timezone/statictimezonemodel.cpp
112-)
113-
114-set(
115- datetime_SRCS
116- modules/DateTime/backend.cpp
117- modules/DateTime/datetime.cpp
118-)
119-
120-set(
121- alarmsettings_SRCS
122- modules/Alarm/Settings/backend.cpp
123- modules/Alarm/Settings/alarmsettings.cpp
124-)
125-
126-set(
127- geolocation_SRCS
128- modules/GeoLocation/backend.cpp
129- modules/GeoLocation/geolocation.cpp
130-)
131-
132-set(
133- clockutility_SRCS
134- modules/Clock/Utility/backend.cpp
135- modules/Clock/Utility/alarmsound.cpp
136+ alarm_SRCS
137+ modules/Alarm/backend.cpp
138+ modules/Alarm/settings.cpp
139+ modules/Alarm/sound.cpp
140+)
141+
142+set(
143+ worldclock_SRCS
144+ modules/WorldClock/backend.cpp
145+ modules/WorldClock/geolocation.cpp
146+ modules/WorldClock/datetime.cpp
147+ modules/WorldClock/timezonemodel.cpp
148+ modules/WorldClock/generictimezonemodel.cpp
149+ modules/WorldClock/jsontimezonemodel.cpp
150+ modules/WorldClock/statictimezonemodel.cpp
151 )
152
153 set(
154@@ -47,84 +32,42 @@
155 modules/Stopwatch/formattime.cpp
156 )
157
158-add_library(timezone MODULE
159- ${timezone_SRCS}
160-)
161-
162-add_library(datetime MODULE
163- ${datetime_SRCS}
164-)
165-
166-add_library(alarmsettings MODULE
167- ${alarmsettings_SRCS}
168-)
169-
170-add_library(geolocation MODULE
171- ${geolocation_SRCS}
172-)
173-
174-add_library(clockutility MODULE
175- ${clockutility_SRCS}
176+add_library(alarm MODULE
177+ ${alarm_SRCS}
178+)
179+
180+add_library(worldclock MODULE
181+ ${worldclock_SRCS}
182 )
183
184 add_library(stopwatch MODULE
185 ${stopwatch_SRCS}
186 )
187
188-set_target_properties(timezone PROPERTIES
189- LIBRARY_OUTPUT_DIRECTORY Timezone
190-)
191-
192-set_target_properties(datetime PROPERTIES
193- LIBRARY_OUTPUT_DIRECTORY DateTime
194-)
195-
196-set_target_properties(alarmsettings PROPERTIES
197- LIBRARY_OUTPUT_DIRECTORY Alarm/Settings
198-)
199-
200-set_target_properties(geolocation PROPERTIES
201- LIBRARY_OUTPUT_DIRECTORY GeoLocation
202-)
203-
204-set_target_properties(clockutility PROPERTIES
205- LIBRARY_OUTPUT_DIRECTORY Clock/Utility
206+set_target_properties(alarm PROPERTIES
207+ LIBRARY_OUTPUT_DIRECTORY Alarm
208+)
209+
210+set_target_properties(worldclock PROPERTIES
211+ LIBRARY_OUTPUT_DIRECTORY WorldClock
212 )
213
214 set_target_properties(stopwatch PROPERTIES
215 LIBRARY_OUTPUT_DIRECTORY Stopwatch/
216 )
217
218-qt5_use_modules(datetime Gui Qml Quick)
219-qt5_use_modules(timezone Gui Qml Quick)
220-qt5_use_modules(alarmsettings Gui Qml Quick DBus)
221-qt5_use_modules(geolocation Gui Qml Quick)
222-qt5_use_modules(clockutility Qml)
223+qt5_use_modules(alarm Gui Qml Quick DBus)
224+qt5_use_modules(worldclock Gui Qml Quick)
225 qt5_use_modules(stopwatch Qml)
226
227 # Copy qmldir file to build dir for running in QtCreator
228-add_custom_target(timezone-qmldir ALL
229- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Timezone/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Timezone
230- DEPENDS ${QMLFILES}
231-)
232-
233-add_custom_target(datetime-qmldir ALL
234- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/DateTime/qmldir ${CMAKE_CURRENT_BINARY_DIR}/DateTime
235- DEPENDS ${QMLFILES}
236-)
237-
238-add_custom_target(alarmsettings-qmldir ALL
239- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Alarm/Settings/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Alarm/Settings
240- DEPENDS ${QMLFILES}
241-)
242-
243-add_custom_target(geolocation-qmldir ALL
244- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/GeoLocation/qmldir ${CMAKE_CURRENT_BINARY_DIR}/GeoLocation
245- DEPENDS ${QMLFILES}
246-)
247-
248-add_custom_target(clockutility-qmldir ALL
249- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Clock/Utility/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Clock/Utility
250+add_custom_target(alarm-qmldir ALL
251+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/Alarm/qmldir ${CMAKE_CURRENT_BINARY_DIR}/Alarm
252+ DEPENDS ${QMLFILES}
253+)
254+
255+add_custom_target(worldclock-qmldir ALL
256+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/modules/WorldClock/qmldir ${CMAKE_CURRENT_BINARY_DIR}/WorldClock
257 DEPENDS ${QMLFILES}
258 )
259
260@@ -134,20 +77,11 @@
261 )
262
263 # Install plugin file
264-install(TARGETS timezone DESTINATION ${MODULE_PATH}/Timezone/)
265-install(FILES modules/Timezone/qmldir DESTINATION ${MODULE_PATH}/Timezone/)
266-
267-install(TARGETS datetime DESTINATION ${MODULE_PATH}/DateTime/)
268-install(FILES modules/DateTime/qmldir DESTINATION ${MODULE_PATH}/DateTime/)
269-
270-install(TARGETS alarmsettings DESTINATION ${MODULE_PATH}/Alarm/Settings/)
271-install(FILES modules/Alarm/Settings/qmldir DESTINATION ${MODULE_PATH}/Alarm/Settings/)
272-
273-install(TARGETS geolocation DESTINATION ${MODULE_PATH}/GeoLocation/)
274-install(FILES modules/GeoLocation/qmldir DESTINATION ${MODULE_PATH}/GeoLocation/)
275-
276-install(TARGETS clockutility DESTINATION ${MODULE_PATH}/Clock/Utility/)
277-install(FILES modules/Clock/Utility/qmldir DESTINATION ${MODULE_PATH}/Clock/Utility/)
278+install(TARGETS alarm DESTINATION ${MODULE_PATH}/Alarm/)
279+install(FILES modules/Alarm/qmldir DESTINATION ${MODULE_PATH}/Alarm/)
280+
281+install(TARGETS worldclock DESTINATION ${MODULE_PATH}/WorldClock/)
282+install(FILES modules/WorldClock/qmldir DESTINATION ${MODULE_PATH}/WorldClock/)
283
284 install(TARGETS stopwatch DESTINATION ${MODULE_PATH}/Stopwatch/)
285 install(FILES modules/Stopwatch/qmldir DESTINATION ${MODULE_PATH}/Stopwatch/)
286
287=== removed directory 'backend/modules/Alarm/Settings'
288=== renamed file 'backend/modules/Alarm/Settings/backend.cpp' => 'backend/modules/Alarm/backend.cpp'
289--- backend/modules/Alarm/Settings/backend.cpp 2015-08-14 05:34:49 +0000
290+++ backend/modules/Alarm/backend.cpp 2015-08-26 23:37:55 +0000
291@@ -19,13 +19,15 @@
292 #include <QtQml>
293 #include <QtQml/QQmlContext>
294 #include "backend.h"
295-#include "alarmsettings.h"
296+#include "settings.h"
297+#include "sound.h"
298
299 void BackendPlugin::registerTypes(const char *uri)
300 {
301- Q_ASSERT(uri == QLatin1String("Alarm.Settings"));
302+ Q_ASSERT(uri == QLatin1String("Alarm"));
303
304- qmlRegisterType<AlarmSettings>(uri, 1, 0, "AlarmSettings");
305+ qmlRegisterType<Settings>(uri, 1, 0, "AlarmSettings");
306+ qmlRegisterType<Sound>(uri, 1, 0, "AlarmSound");
307 }
308
309 void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
310
311=== renamed file 'backend/modules/Alarm/Settings/backend.h' => 'backend/modules/Alarm/backend.h'
312=== renamed file 'backend/modules/Alarm/Settings/qmldir' => 'backend/modules/Alarm/qmldir'
313--- backend/modules/Alarm/Settings/qmldir 2014-07-17 10:38:36 +0000
314+++ backend/modules/Alarm/qmldir 2015-08-26 23:37:55 +0000
315@@ -1,2 +1,2 @@
316-module Alarm.Settings
317-plugin alarmsettings
318+module Alarm
319+plugin alarm
320
321=== renamed file 'backend/modules/Alarm/Settings/alarmsettings.cpp' => 'backend/modules/Alarm/settings.cpp'
322--- backend/modules/Alarm/Settings/alarmsettings.cpp 2015-08-14 05:34:49 +0000
323+++ backend/modules/Alarm/settings.cpp 2015-08-26 23:37:55 +0000
324@@ -19,9 +19,9 @@
325 #include <QDebug>
326 #include <QtDBus>
327
328-#include "alarmsettings.h"
329+#include "settings.h"
330
331-AlarmSettings::AlarmSettings(QObject *parent):
332+Settings::Settings(QObject *parent):
333 QObject(parent)
334 {
335 // On startup, retrieve all the settings values from Dbus
336@@ -37,7 +37,7 @@
337 SLOT(onSettingsChanged(QString, QVariantMap, QStringList)));
338 }
339
340-void AlarmSettings::onSettingsChanged(const QString &interface,
341+void Settings::onSettingsChanged(const QString &interface,
342 const QVariantMap &properties,
343 const QStringList & /*valid*/)
344 {
345@@ -87,7 +87,7 @@
346 }
347 }
348
349-void AlarmSettings::refreshProperties()
350+void Settings::refreshProperties()
351 {
352 QDBusInterface handlerPropertiesInterface
353 ("com.canonical.indicator.datetime",
354@@ -111,7 +111,7 @@
355 m_vibration = map["HapticFeedback"].toString();
356 }
357
358-void AlarmSettings::setDBusProperty(const QString &name, const QVariant &value)
359+void Settings::setDBusProperty(const QString &name, const QVariant &value)
360 {
361 QDBusInterface handlerPropertiesInterface
362 ("com.canonical.indicator.datetime",
363@@ -125,27 +125,27 @@
364 QVariant::fromValue(QDBusVariant(value)));
365 }
366
367-int AlarmSettings::volume() const
368+int Settings::volume() const
369 {
370 return m_volume;
371 }
372
373-int AlarmSettings::duration() const
374+int Settings::duration() const
375 {
376 return m_duration;
377 }
378
379-int AlarmSettings::snoozeDuration() const
380+int Settings::snoozeDuration() const
381 {
382 return m_snoozeDuration;
383 }
384
385-QString AlarmSettings::vibration() const
386+QString Settings::vibration() const
387 {
388 return m_vibration;
389 }
390
391-void AlarmSettings::setVolume(int volume)
392+void Settings::setVolume(int volume)
393 {
394 if(m_volume == volume) {
395 // Don't send the volume over dbus if it is the same one already
396@@ -159,7 +159,7 @@
397 setDBusProperty("DefaultVolume", QVariant(m_volume));
398 }
399
400-void AlarmSettings::setDuration(int duration)
401+void Settings::setDuration(int duration)
402 {
403 if(m_duration == duration) {
404 // Don't send the duration over dbus if it is the same one already
405@@ -173,7 +173,7 @@
406 setDBusProperty("Duration", QVariant(m_duration));
407 }
408
409-void AlarmSettings::setSnoozeDuration(int snoozeDuration)
410+void Settings::setSnoozeDuration(int snoozeDuration)
411 {
412 if(m_snoozeDuration == snoozeDuration) {
413 // Don't send the snooze duration over dbus if it is the same one already
414@@ -187,7 +187,7 @@
415 setDBusProperty("SnoozeDuration", QVariant(m_snoozeDuration));
416 }
417
418-void AlarmSettings::setVibration(QString vibration)
419+void Settings::setVibration(QString vibration)
420 {
421 if(m_vibration == vibration) {
422 // Don't send the vibration mode over dbus if it is the same one already
423
424=== renamed file 'backend/modules/Alarm/Settings/alarmsettings.h' => 'backend/modules/Alarm/settings.h'
425--- backend/modules/Alarm/Settings/alarmsettings.h 2015-08-14 05:34:49 +0000
426+++ backend/modules/Alarm/settings.h 2015-08-26 23:37:55 +0000
427@@ -16,13 +16,13 @@
428 * along with this program. If not, see <http://www.gnu.org/licenses/>.
429 */
430
431-#ifndef ALARMSETTINGS_H
432-#define ALARMSETTINGS_H
433+#ifndef SETTINGS_H
434+#define SETTINGS_H
435
436 #include <QObject>
437 #include <QVariant>
438
439-class AlarmSettings: public QObject
440+class Settings: public QObject
441 {
442 Q_OBJECT
443
444@@ -51,7 +51,7 @@
445 NOTIFY vibrationChanged)
446
447 public:
448- AlarmSettings(QObject *parent = 0);
449+ Settings(QObject *parent = 0);
450
451 // Function to return the alarm volume
452 int volume() const;
453
454=== renamed file 'backend/modules/Clock/Utility/alarmsound.cpp' => 'backend/modules/Alarm/sound.cpp'
455--- backend/modules/Clock/Utility/alarmsound.cpp 2015-08-24 21:15:05 +0000
456+++ backend/modules/Alarm/sound.cpp 2015-08-26 23:37:55 +0000
457@@ -20,21 +20,21 @@
458 #include <QFileInfo>
459 #include <QStandardPaths>
460
461-#include "alarmsound.h"
462+#include "sound.h"
463
464-AlarmSound::AlarmSound(QObject *parent):
465+Sound::Sound(QObject *parent):
466 QObject(parent),
467 m_customAlarmDir(QStandardPaths::standardLocations(QStandardPaths::AppDataLocation).first() + "/CustomSounds/"),
468 m_defaultAlarmDir("/usr/share/sounds/ubuntu/ringtones/")
469 {
470 }
471
472-QString AlarmSound::customAlarmSoundDirectory() const
473+QString Sound::customAlarmSoundDirectory() const
474 {
475 return m_customAlarmDir;
476 }
477
478-void AlarmSound::deleteCustomAlarmSound(const QString &soundName)
479+void Sound::deleteCustomAlarmSound(const QString &soundName)
480 {
481 QDir dir(m_customAlarmDir);
482 if (dir.exists(soundName))
483@@ -43,14 +43,14 @@
484 }
485 }
486
487-void AlarmSound::prepareToAddAlarmSound(const QString &soundPath)
488+void Sound::prepareToAddAlarmSound(const QString &soundPath)
489 {
490 QFileInfo soundFile(soundPath);
491 QString soundFileName = soundFile.fileName();
492 deleteCustomAlarmSound(soundFileName);
493 }
494
495-void AlarmSound::createCustomAlarmSoundDirectory()
496+void Sound::createCustomAlarmSoundDirectory()
497 {
498 QDir dir(m_customAlarmDir);
499
500@@ -62,7 +62,7 @@
501 dir.mkpath(m_customAlarmDir);
502 }
503
504-bool AlarmSound::isAlarmSoundValid(const QString &soundFileName)
505+bool Sound::isAlarmSoundValid(const QString &soundFileName)
506 {
507 QFileInfo soundFile;
508
509@@ -82,18 +82,18 @@
510 }
511 }
512
513-bool AlarmSound::isAlarmSoundValid(const QUrl &soundUrl)
514+bool Sound::isAlarmSoundValid(const QUrl &soundUrl)
515 {
516 QFileInfo soundFile;
517 return soundFile.exists(soundUrl.path());
518 }
519
520-QString AlarmSound::getDefaultAlarmSoundPath(const QString &soundFileName) const
521+QString Sound::getDefaultAlarmSoundPath(const QString &soundFileName) const
522 {
523 return m_defaultAlarmDir + soundFileName;
524 }
525
526-QString AlarmSound::getSoundName(const QString &soundPath) const
527+QString Sound::getSoundName(const QString &soundPath) const
528 {
529 QFileInfo soundFile(soundPath);
530 return soundFile.baseName();
531
532=== renamed file 'backend/modules/Clock/Utility/alarmsound.h' => 'backend/modules/Alarm/sound.h'
533--- backend/modules/Clock/Utility/alarmsound.h 2015-08-24 16:32:44 +0000
534+++ backend/modules/Alarm/sound.h 2015-08-26 23:37:55 +0000
535@@ -16,13 +16,13 @@
536 * along with this program. If not, see <http://www.gnu.org/licenses/>.
537 */
538
539-#ifndef ALARMSOUND_H
540-#define ALARMSOUND_H
541+#ifndef SOUND_H
542+#define SOUND_H
543
544 #include <QObject>
545 #include <QUrl>
546
547-class AlarmSound: public QObject
548+class Sound: public QObject
549 {
550 Q_OBJECT
551
552@@ -32,7 +32,7 @@
553 CONSTANT)
554
555 public:
556- AlarmSound(QObject *parent = 0);
557+ Sound(QObject *parent = 0);
558
559 QString customAlarmSoundDirectory() const;
560
561
562=== removed directory 'backend/modules/Clock/Utility'
563=== removed directory 'backend/modules/DateTime'
564=== removed file 'backend/modules/DateTime/backend.cpp'
565--- backend/modules/DateTime/backend.cpp 2015-08-14 05:34:49 +0000
566+++ backend/modules/DateTime/backend.cpp 1970-01-01 00:00:00 +0000
567@@ -1,34 +0,0 @@
568-/*
569- * Copyright (C) 2014-2015 Canonical Ltd
570- *
571- * This file is part of Ubuntu Clock App
572- *
573- * Ubuntu Clock App is free software: you can redistribute it and/or modify
574- * it under the terms of the GNU General Public License version 3 as
575- * published by the Free Software Foundation.
576- *
577- * Ubuntu Clock App is distributed in the hope that it will be useful,
578- * but WITHOUT ANY WARRANTY; without even the implied warranty of
579- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
580- * GNU General Public License for more details.
581- *
582- * You should have received a copy of the GNU General Public License
583- * along with this program. If not, see <http://www.gnu.org/licenses/>.
584- */
585-
586-#include <QtQml>
587-#include <QtQml/QQmlContext>
588-#include "backend.h"
589-#include "datetime.h"
590-
591-void BackendPlugin::registerTypes(const char *uri)
592-{
593- Q_ASSERT(uri == QLatin1String("DateTime"));
594-
595- qmlRegisterType<DateTime>(uri, 1, 0, "DateTime");
596-}
597-
598-void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
599-{
600- QQmlExtensionPlugin::initializeEngine(engine, uri);
601-}
602
603=== removed file 'backend/modules/DateTime/backend.h'
604--- backend/modules/DateTime/backend.h 2015-08-14 05:34:49 +0000
605+++ backend/modules/DateTime/backend.h 1970-01-01 00:00:00 +0000
606@@ -1,35 +0,0 @@
607-/*
608- * Copyright (C) 2014-2015 Canonical Ltd
609- *
610- * This file is part of Ubuntu Clock App
611- *
612- * Ubuntu Clock App is free software: you can redistribute it and/or modify
613- * it under the terms of the GNU General Public License version 3 as
614- * published by the Free Software Foundation.
615- *
616- * Ubuntu Clock App is distributed in the hope that it will be useful,
617- * but WITHOUT ANY WARRANTY; without even the implied warranty of
618- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
619- * GNU General Public License for more details.
620- *
621- * You should have received a copy of the GNU General Public License
622- * along with this program. If not, see <http://www.gnu.org/licenses/>.
623- */
624-
625-#ifndef BACKEND_PLUGIN_H
626-#define BACKEND_PLUGIN_H
627-
628-#include <QtQml/QQmlEngine>
629-#include <QtQml/QQmlExtensionPlugin>
630-
631-class BackendPlugin : public QQmlExtensionPlugin
632-{
633- Q_OBJECT
634- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
635-
636-public:
637- void registerTypes(const char *uri);
638- void initializeEngine(QQmlEngine *engine, const char *uri);
639-};
640-#endif // BACKEND_PLUGIN_H
641-
642
643=== removed file 'backend/modules/DateTime/qmldir'
644--- backend/modules/DateTime/qmldir 2014-07-26 09:34:15 +0000
645+++ backend/modules/DateTime/qmldir 1970-01-01 00:00:00 +0000
646@@ -1,2 +0,0 @@
647-module DateTime
648-plugin datetime
649
650=== removed directory 'backend/modules/GeoLocation'
651=== removed file 'backend/modules/GeoLocation/backend.cpp'
652--- backend/modules/GeoLocation/backend.cpp 2015-08-14 05:34:49 +0000
653+++ backend/modules/GeoLocation/backend.cpp 1970-01-01 00:00:00 +0000
654@@ -1,34 +0,0 @@
655-/*
656- * Copyright (C) 2014-2015 Canonical Ltd
657- *
658- * This file is part of Ubuntu Clock App
659- *
660- * Ubuntu Clock App is free software: you can redistribute it and/or modify
661- * it under the terms of the GNU General Public License version 3 as
662- * published by the Free Software Foundation.
663- *
664- * Ubuntu Clock App is distributed in the hope that it will be useful,
665- * but WITHOUT ANY WARRANTY; without even the implied warranty of
666- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
667- * GNU General Public License for more details.
668- *
669- * You should have received a copy of the GNU General Public License
670- * along with this program. If not, see <http://www.gnu.org/licenses/>.
671- */
672-
673-#include <QtQml>
674-#include <QtQml/QQmlContext>
675-#include "backend.h"
676-#include "geolocation.h"
677-
678-void BackendPlugin::registerTypes(const char *uri)
679-{
680- Q_ASSERT(uri == QLatin1String("GeoLocation"));
681-
682- qmlRegisterType<GeoLocation>(uri, 1, 0, "GeoLocation");
683-}
684-
685-void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
686-{
687- QQmlExtensionPlugin::initializeEngine(engine, uri);
688-}
689
690=== removed file 'backend/modules/GeoLocation/backend.h'
691--- backend/modules/GeoLocation/backend.h 2015-08-14 05:34:49 +0000
692+++ backend/modules/GeoLocation/backend.h 1970-01-01 00:00:00 +0000
693@@ -1,35 +0,0 @@
694-/*
695- * Copyright (C) 2014-2015 Canonical Ltd
696- *
697- * This file is part of Ubuntu Clock App
698- *
699- * Ubuntu Clock App is free software: you can redistribute it and/or modify
700- * it under the terms of the GNU General Public License version 3 as
701- * published by the Free Software Foundation.
702- *
703- * Ubuntu Clock App is distributed in the hope that it will be useful,
704- * but WITHOUT ANY WARRANTY; without even the implied warranty of
705- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
706- * GNU General Public License for more details.
707- *
708- * You should have received a copy of the GNU General Public License
709- * along with this program. If not, see <http://www.gnu.org/licenses/>.
710- */
711-
712-#ifndef BACKEND_PLUGIN_H
713-#define BACKEND_PLUGIN_H
714-
715-#include <QtQml/QQmlEngine>
716-#include <QtQml/QQmlExtensionPlugin>
717-
718-class BackendPlugin : public QQmlExtensionPlugin
719-{
720- Q_OBJECT
721- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
722-
723-public:
724- void registerTypes(const char *uri);
725- void initializeEngine(QQmlEngine *engine, const char *uri);
726-};
727-#endif // BACKEND_PLUGIN_H
728-
729
730=== removed file 'backend/modules/GeoLocation/qmldir'
731--- backend/modules/GeoLocation/qmldir 2014-11-04 15:58:05 +0000
732+++ backend/modules/GeoLocation/qmldir 1970-01-01 00:00:00 +0000
733@@ -1,2 +0,0 @@
734-module GeoLocation
735-plugin geolocation
736
737=== removed directory 'backend/modules/Timezone'
738=== removed file 'backend/modules/Timezone/backend.cpp'
739--- backend/modules/Timezone/backend.cpp 2015-08-14 05:34:49 +0000
740+++ backend/modules/Timezone/backend.cpp 1970-01-01 00:00:00 +0000
741@@ -1,39 +0,0 @@
742-/*
743- * Copyright (C) 2014-2015 Canonical Ltd
744- *
745- * This file is part of Ubuntu Clock App
746- *
747- * Ubuntu Clock App is free software: you can redistribute it and/or modify
748- * it under the terms of the GNU General Public License version 3 as
749- * published by the Free Software Foundation.
750- *
751- * Ubuntu Clock App is distributed in the hope that it will be useful,
752- * but WITHOUT ANY WARRANTY; without even the implied warranty of
753- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754- * GNU General Public License for more details.
755- *
756- * You should have received a copy of the GNU General Public License
757- * along with this program. If not, see <http://www.gnu.org/licenses/>.
758- */
759-
760-#include <QtQml>
761-#include <QtQml/QQmlContext>
762-#include "backend.h"
763-#include "timezonemodel.h"
764-#include "generictimezonemodel.h"
765-#include "jsontimezonemodel.h"
766-#include "statictimezonemodel.h"
767-
768-void BackendPlugin::registerTypes(const char *uri)
769-{
770- Q_ASSERT(uri == QLatin1String("Timezone"));
771-
772- qmlRegisterType<GenericTimeZoneModel>(uri, 1, 0, "GenericTimeZoneModel");
773- qmlRegisterType<JsonTimeZoneModel>(uri, 1, 0, "JsonTimeZoneModel");
774- qmlRegisterType<StaticTimeZoneModel>(uri, 1, 0, "StaticTimeZoneModel");
775-}
776-
777-void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
778-{
779- QQmlExtensionPlugin::initializeEngine(engine, uri);
780-}
781
782=== removed file 'backend/modules/Timezone/backend.h'
783--- backend/modules/Timezone/backend.h 2015-08-14 05:34:49 +0000
784+++ backend/modules/Timezone/backend.h 1970-01-01 00:00:00 +0000
785@@ -1,35 +0,0 @@
786-/*
787- * Copyright (C) 2014-2015 Canonical Ltd
788- *
789- * This file is part of Ubuntu Clock App
790- *
791- * Ubuntu Clock App is free software: you can redistribute it and/or modify
792- * it under the terms of the GNU General Public License version 3 as
793- * published by the Free Software Foundation.
794- *
795- * Ubuntu Clock App is distributed in the hope that it will be useful,
796- * but WITHOUT ANY WARRANTY; without even the implied warranty of
797- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
798- * GNU General Public License for more details.
799- *
800- * You should have received a copy of the GNU General Public License
801- * along with this program. If not, see <http://www.gnu.org/licenses/>.
802- */
803-
804-#ifndef BACKEND_PLUGIN_H
805-#define BACKEND_PLUGIN_H
806-
807-#include <QtQml/QQmlEngine>
808-#include <QtQml/QQmlExtensionPlugin>
809-
810-class BackendPlugin : public QQmlExtensionPlugin
811-{
812- Q_OBJECT
813- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
814-
815-public:
816- void registerTypes(const char *uri);
817- void initializeEngine(QQmlEngine *engine, const char *uri);
818-};
819-#endif // BACKEND_PLUGIN_H
820-
821
822=== removed file 'backend/modules/Timezone/qmldir'
823--- backend/modules/Timezone/qmldir 2014-07-17 10:38:36 +0000
824+++ backend/modules/Timezone/qmldir 1970-01-01 00:00:00 +0000
825@@ -1,2 +0,0 @@
826-module Timezone
827-plugin timezone
828
829=== renamed directory 'backend/modules/Clock' => 'backend/modules/WorldClock'
830=== renamed file 'backend/modules/Clock/Utility/backend.cpp' => 'backend/modules/WorldClock/backend.cpp'
831--- backend/modules/Clock/Utility/backend.cpp 2015-08-24 15:08:21 +0000
832+++ backend/modules/WorldClock/backend.cpp 2015-08-26 23:37:55 +0000
833@@ -19,13 +19,22 @@
834 #include <QtQml>
835 #include <QtQml/QQmlContext>
836 #include "backend.h"
837-#include "alarmsound.h"
838+#include "geolocation.h"
839+#include "datetime.h"
840+#include "timezonemodel.h"
841+#include "generictimezonemodel.h"
842+#include "jsontimezonemodel.h"
843+#include "statictimezonemodel.h"
844
845 void BackendPlugin::registerTypes(const char *uri)
846 {
847- Q_ASSERT(uri == QLatin1String("Clock.Utility"));
848+ Q_ASSERT(uri == QLatin1String("WorldClock"));
849
850- qmlRegisterType<AlarmSound>(uri, 1, 0, "AlarmSound");
851+ qmlRegisterType<GeoLocation>(uri, 1, 0, "GeoLocation");
852+ qmlRegisterType<DateTime>(uri, 1, 0, "DateTime");
853+ qmlRegisterType<GenericTimeZoneModel>(uri, 1, 0, "GenericTimeZoneModel");
854+ qmlRegisterType<JsonTimeZoneModel>(uri, 1, 0, "JsonTimeZoneModel");
855+ qmlRegisterType<StaticTimeZoneModel>(uri, 1, 0, "StaticTimeZoneModel");
856 }
857
858 void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
859
860=== renamed file 'backend/modules/Clock/Utility/backend.h' => 'backend/modules/WorldClock/backend.h'
861=== renamed file 'backend/modules/DateTime/datetime.cpp' => 'backend/modules/WorldClock/datetime.cpp'
862=== renamed file 'backend/modules/DateTime/datetime.h' => 'backend/modules/WorldClock/datetime.h'
863=== renamed file 'backend/modules/Timezone/generictimezonemodel.cpp' => 'backend/modules/WorldClock/generictimezonemodel.cpp'
864=== renamed file 'backend/modules/Timezone/generictimezonemodel.h' => 'backend/modules/WorldClock/generictimezonemodel.h'
865=== renamed file 'backend/modules/GeoLocation/geolocation.cpp' => 'backend/modules/WorldClock/geolocation.cpp'
866=== renamed file 'backend/modules/GeoLocation/geolocation.h' => 'backend/modules/WorldClock/geolocation.h'
867=== renamed file 'backend/modules/Timezone/jsontimezonemodel.cpp' => 'backend/modules/WorldClock/jsontimezonemodel.cpp'
868=== renamed file 'backend/modules/Timezone/jsontimezonemodel.h' => 'backend/modules/WorldClock/jsontimezonemodel.h'
869=== renamed file 'backend/modules/Clock/Utility/qmldir' => 'backend/modules/WorldClock/qmldir'
870--- backend/modules/Clock/Utility/qmldir 2015-08-19 13:29:52 +0000
871+++ backend/modules/WorldClock/qmldir 2015-08-26 23:37:55 +0000
872@@ -1,2 +1,2 @@
873-module Clock.Utility
874-plugin clockutility
875+module WorldClock
876+plugin worldclock
877
878=== renamed file 'backend/modules/Timezone/statictimezonemodel.cpp' => 'backend/modules/WorldClock/statictimezonemodel.cpp'
879=== renamed file 'backend/modules/Timezone/statictimezonemodel.h' => 'backend/modules/WorldClock/statictimezonemodel.h'
880=== renamed file 'backend/modules/Timezone/timezonemodel.cpp' => 'backend/modules/WorldClock/timezonemodel.cpp'
881=== renamed file 'backend/modules/Timezone/timezonemodel.h' => 'backend/modules/WorldClock/timezonemodel.h'
882=== modified file 'debian/changelog'
883--- debian/changelog 2015-08-25 11:36:52 +0000
884+++ debian/changelog 2015-08-26 23:37:55 +0000
885@@ -29,6 +29,7 @@
886 * Fixed edited alarm not being saveable if at any point of editing the alarm
887 clock app loses focus (LP: #1487789)
888 * Fixed edited alarms when saved not updating the alarms listview (LP: #1488439)
889+ * Reorganized backend c++ plugins with proper naming and folder structures.
890
891 [Victor Thompson]
892 * Show all README files in QtCreator
893
894=== modified file 'tests/unit/MockClockApp.qml'
895--- tests/unit/MockClockApp.qml 2015-08-17 12:27:20 +0000
896+++ tests/unit/MockClockApp.qml 2015-08-26 23:37:55 +0000
897@@ -17,7 +17,7 @@
898 */
899
900 import QtQuick 2.4
901-import DateTime 1.0
902+import WorldClock 1.0
903 import U1db 1.0 as U1db
904 import Ubuntu.Components 1.2
905 import "../../app"
906
907=== modified file 'tests/unit/tst_alarm.qml'
908--- tests/unit/tst_alarm.qml 2015-08-12 16:57:29 +0000
909+++ tests/unit/tst_alarm.qml 2015-08-26 23:37:55 +0000
910@@ -17,7 +17,7 @@
911 */
912
913 import QtQuick 2.4
914-import DateTime 1.0
915+import WorldClock 1.0
916 import Ubuntu.Components 1.2
917 import "../../app/alarm"
918

Subscribers

People subscribed via source and target branches