Merge lp:~schwann/gallery-app/gallery-unified-multi-pick into lp:gallery-app

Proposed by Günter Schwann
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 825
Merged at revision: 825
Proposed branch: lp:~schwann/gallery-app/gallery-unified-multi-pick
Merge into: lp:gallery-app
Diff against target: 168 lines (+9/-37)
6 files modified
rc/qml/PickerScreen.qml (+1/-1)
src/gallery-application.cpp (+0/-10)
src/util/command-line-parser.cpp (+3/-11)
src/util/command-line-parser.h (+0/-4)
tests/autopilot/gallery_app/tests/test_picker_mode.py (+1/-1)
tests/unittests/command-line-parser/tst_commandlineparser.cpp (+4/-10)
To merge this branch: bzr merge lp:~schwann/gallery-app/gallery-unified-multi-pick
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+182278@code.launchpad.net

Commit message

Pick mode always shows photos and videos and is multiselection

Description of the change

Pick mode always shows photos and videos and is multiselection

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

Not sure how to test functionally (further than running the app with --pick-mode), but the change looks good and seems to work.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'rc/qml/PickerScreen.qml'
--- rc/qml/PickerScreen.qml 2013-06-27 10:09:08 +0000
+++ rc/qml/PickerScreen.qml 2013-08-27 06:51:32 +0000
@@ -36,7 +36,7 @@
36 /// Holds the selection36 /// Holds the selection
37 property SelectionState selection: SelectionState {37 property SelectionState selection: SelectionState {
38 inSelectionMode: true38 inSelectionMode: true
39 singleSelect: true39 singleSelect: false
40 model: mediaLibrary40 model: mediaLibrary
41 }41 }
4242
4343
=== modified file 'src/gallery-application.cpp'
--- src/gallery-application.cpp 2013-08-26 10:44:00 +0000
+++ src/gallery-application.cpp 2013-08-27 06:51:32 +0000
@@ -162,10 +162,6 @@
162 rootContext->setContextProperty("DEVICE_HEIGHT", QVariant(size.height()));162 rootContext->setContextProperty("DEVICE_HEIGHT", QVariant(size.height()));
163 rootContext->setContextProperty("FORM_FACTOR", QVariant(m_cmdLineParser->formFactor()));163 rootContext->setContextProperty("FORM_FACTOR", QVariant(m_cmdLineParser->formFactor()));
164 rootContext->setContextProperty("PICK_MODE_ENABLED", QVariant(m_cmdLineParser->pickModeEnabled()));164 rootContext->setContextProperty("PICK_MODE_ENABLED", QVariant(m_cmdLineParser->pickModeEnabled()));
165 if (m_cmdLineParser->pickPhoto())
166 rootContext->setContextProperty("PICK_TYPE", QVariant(MediaSource::Photo));
167 else
168 rootContext->setContextProperty("PICK_TYPE", QVariant(MediaSource::Video));
169 rootContext->setContextProperty("MAX_GL_TEXTURE_SIZE",165 rootContext->setContextProperty("MAX_GL_TEXTURE_SIZE",
170 QVariant(m_galleryManager->resource()->maxTextureSize()));166 QVariant(m_galleryManager->resource()->maxTextureSize()));
171167
@@ -193,12 +189,6 @@
193 */189 */
194void GalleryApplication::initCollections()190void GalleryApplication::initCollections()
195{191{
196 if (m_cmdLineParser->pickModeEnabled()) {
197 MediaSource::MediaType filterType = MediaSource::Video;
198 if (m_cmdLineParser->pickPhoto())
199 filterType = MediaSource::Photo;
200 m_galleryManager->enableContentLoadFilter(filterType);
201 }
202 QApplication::processEvents();192 QApplication::processEvents();
203193
204 m_galleryManager->postInit();194 m_galleryManager->postInit();
205195
=== modified file 'src/util/command-line-parser.cpp'
--- src/util/command-line-parser.cpp 2013-06-24 11:09:38 +0000
+++ src/util/command-line-parser.cpp 2013-08-27 06:51:32 +0000
@@ -31,8 +31,6 @@
31 m_isPortrait(false),31 m_isPortrait(false),
32 m_picturesDir(""),32 m_picturesDir(""),
33 m_pickMode(false),33 m_pickMode(false),
34 m_pickPhoto(false),
35 m_pickVideo(false),
36 m_logImageLoading(false),34 m_logImageLoading(false),
37 m_formFactors(form_factors),35 m_formFactors(form_factors),
38 m_formFactor("desktop")36 m_formFactor("desktop")
@@ -71,13 +69,8 @@
71 else if (args[i] == "--log-image-loading") {69 else if (args[i] == "--log-image-loading") {
72 m_logImageLoading = true;70 m_logImageLoading = true;
73 }71 }
74 else if (args[i] == "--pick-photo") {72 else if (args[i] == "--pick-mode") {
75 m_pickMode = true;73 m_pickMode = true;
76 m_pickPhoto = true;
77 }
78 else if (args[i] == "--pick-video") {
79 m_pickMode = true;
80 m_pickVideo = true;
81 }74 }
82 else {75 else {
83 QString form_factor = args[i].mid(2); // minus initial "--"76 QString form_factor = args[i].mid(2); // minus initial "--"
@@ -118,8 +111,7 @@
118111
119 out << " --startup-timer\n\t\tdebug-print startup time" << endl;112 out << " --startup-timer\n\t\tdebug-print startup time" << endl;
120 out << " --log-image-loading\n\t\tlog image loading" << endl;113 out << " --log-image-loading\n\t\tlog image loading" << endl;
121 out << " --pick-photo\n\t\tEnable mode to pick one photo" << endl;114 out << " --pick-mode\n\t\tEnable mode to pick photos" << endl;
122 out << " --pick-video\n\t\tEnable mode to pick one video" << endl;
123 out << "pictures_dir defaults to ~/Pictures, and must exist prior to running gallery" << endl;115 out << "pictures_dir defaults to ~/Pictures, and must exist prior to running gallery" << endl;
124}116}
125117
126118
=== modified file 'src/util/command-line-parser.h'
--- src/util/command-line-parser.h 2013-06-24 11:09:38 +0000
+++ src/util/command-line-parser.h 2013-08-27 06:51:32 +0000
@@ -42,8 +42,6 @@
42 bool startupTimer() const { return m_startupTimer; }42 bool startupTimer() const { return m_startupTimer; }
43 bool logImageLoading() const { return m_logImageLoading; }43 bool logImageLoading() const { return m_logImageLoading; }
44 bool pickModeEnabled() const { return m_pickMode; }44 bool pickModeEnabled() const { return m_pickMode; }
45 bool pickPhoto() const { return m_pickPhoto; }
46 bool pickVideo() const { return m_pickVideo; }
47 const QString &formFactor() const { return m_formFactor; }45 const QString &formFactor() const { return m_formFactor; }
4846
49private:47private:
@@ -55,8 +53,6 @@
55 bool m_isPortrait;53 bool m_isPortrait;
56 QString m_picturesDir;54 QString m_picturesDir;
57 bool m_pickMode;55 bool m_pickMode;
58 bool m_pickPhoto;
59 bool m_pickVideo;
60 bool m_logImageLoading;56 bool m_logImageLoading;
6157
62 const QHash<QString, QSize> m_formFactors;58 const QHash<QString, QSize> m_formFactors;
6359
=== modified file 'tests/autopilot/gallery_app/tests/test_picker_mode.py'
--- tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-08-19 13:58:55 +0000
+++ tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-08-27 06:51:32 +0000
@@ -24,7 +24,7 @@
24 return self.app.select_single(PickerScreen)24 return self.app.select_single(PickerScreen)
2525
26 def setUp(self):26 def setUp(self):
27 self.ARGS.append("--pick-photo")27 self.ARGS.append("--pick-mode")
28 super(TestPickerMode, self).setUp()28 super(TestPickerMode, self).setUp()
2929
30 def select_first_event_media(self):30 def select_first_event_media(self):
3131
=== modified file 'tests/unittests/command-line-parser/tst_commandlineparser.cpp'
--- tests/unittests/command-line-parser/tst_commandlineparser.cpp 2013-06-24 11:09:38 +0000
+++ tests/unittests/command-line-parser/tst_commandlineparser.cpp 2013-08-27 06:51:32 +0000
@@ -88,8 +88,6 @@
88 QTest::addColumn<bool>("startup_timer");88 QTest::addColumn<bool>("startup_timer");
89 QTest::addColumn<bool>("log_image_loading");89 QTest::addColumn<bool>("log_image_loading");
90 QTest::addColumn<bool>("pick_mode_enabled");90 QTest::addColumn<bool>("pick_mode_enabled");
91 QTest::addColumn<bool>("pick_photo");
92 QTest::addColumn<bool>("pick_video");
93 QTest::addColumn<bool>("invalid_arg");91 QTest::addColumn<bool>("invalid_arg");
9492
95 QStringList boolean_test;93 QStringList boolean_test;
@@ -98,7 +96,7 @@
98 boolean_test.append("--fullscreen");96 boolean_test.append("--fullscreen");
99 boolean_test.append("--startup-timer");97 boolean_test.append("--startup-timer");
100 boolean_test.append("--log-image-loading");98 boolean_test.append("--log-image-loading");
101 boolean_test.append("--pick-photo");99 boolean_test.append("--pick-mode");
102100
103 QStringList invalid_arg_test;101 QStringList invalid_arg_test;
104 invalid_arg_test.append("gallery");102 invalid_arg_test.append("gallery");
@@ -110,11 +108,11 @@
110 help_test.append("--landscape");108 help_test.append("--landscape");
111109
112 QTest::newRow("Boolean member test") << boolean_test << true << true << true << true110 QTest::newRow("Boolean member test") << boolean_test << true << true << true << true
113 << true << true << false << true;111 << true << true;
114 QTest::newRow("Invalid arg test") << invalid_arg_test << false << false << false << false112 QTest::newRow("Invalid arg test") << invalid_arg_test << false << false << false << false
115 << false << false << false << false;113 << false << false;
116 QTest::newRow("Help test") << help_test << false << false << false << false114 QTest::newRow("Help test") << help_test << false << false << false << false
117 << false << false << false << false;115 << false << false;
118}116}
119117
120void tst_CommandLineParser::process_args_test()118void tst_CommandLineParser::process_args_test()
@@ -129,8 +127,6 @@
129 QFETCH(bool, startup_timer);127 QFETCH(bool, startup_timer);
130 QFETCH(bool, log_image_loading);128 QFETCH(bool, log_image_loading);
131 QFETCH(bool, pick_mode_enabled);129 QFETCH(bool, pick_mode_enabled);
132 QFETCH(bool, pick_photo);
133 QFETCH(bool, pick_video);
134 QFETCH(bool, invalid_arg);130 QFETCH(bool, invalid_arg);
135131
136 bool result = test.processArguments(process_args);132 bool result = test.processArguments(process_args);
@@ -140,8 +136,6 @@
140 QCOMPARE(test.startupTimer(), startup_timer);136 QCOMPARE(test.startupTimer(), startup_timer);
141 QCOMPARE(test.logImageLoading(), log_image_loading);137 QCOMPARE(test.logImageLoading(), log_image_loading);
142 QCOMPARE(test.pickModeEnabled(), pick_mode_enabled);138 QCOMPARE(test.pickModeEnabled(), pick_mode_enabled);
143 QCOMPARE(test.pickPhoto(), pick_photo);
144 QCOMPARE(test.pickVideo(), pick_video);
145 QCOMPARE(result, invalid_arg);139 QCOMPARE(result, invalid_arg);
146}140}
147141

Subscribers

People subscribed via source and target branches