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
1=== modified file 'rc/qml/PickerScreen.qml'
2--- rc/qml/PickerScreen.qml 2013-06-27 10:09:08 +0000
3+++ rc/qml/PickerScreen.qml 2013-08-27 06:51:32 +0000
4@@ -36,7 +36,7 @@
5 /// Holds the selection
6 property SelectionState selection: SelectionState {
7 inSelectionMode: true
8- singleSelect: true
9+ singleSelect: false
10 model: mediaLibrary
11 }
12
13
14=== modified file 'src/gallery-application.cpp'
15--- src/gallery-application.cpp 2013-08-26 10:44:00 +0000
16+++ src/gallery-application.cpp 2013-08-27 06:51:32 +0000
17@@ -162,10 +162,6 @@
18 rootContext->setContextProperty("DEVICE_HEIGHT", QVariant(size.height()));
19 rootContext->setContextProperty("FORM_FACTOR", QVariant(m_cmdLineParser->formFactor()));
20 rootContext->setContextProperty("PICK_MODE_ENABLED", QVariant(m_cmdLineParser->pickModeEnabled()));
21- if (m_cmdLineParser->pickPhoto())
22- rootContext->setContextProperty("PICK_TYPE", QVariant(MediaSource::Photo));
23- else
24- rootContext->setContextProperty("PICK_TYPE", QVariant(MediaSource::Video));
25 rootContext->setContextProperty("MAX_GL_TEXTURE_SIZE",
26 QVariant(m_galleryManager->resource()->maxTextureSize()));
27
28@@ -193,12 +189,6 @@
29 */
30 void GalleryApplication::initCollections()
31 {
32- if (m_cmdLineParser->pickModeEnabled()) {
33- MediaSource::MediaType filterType = MediaSource::Video;
34- if (m_cmdLineParser->pickPhoto())
35- filterType = MediaSource::Photo;
36- m_galleryManager->enableContentLoadFilter(filterType);
37- }
38 QApplication::processEvents();
39
40 m_galleryManager->postInit();
41
42=== modified file 'src/util/command-line-parser.cpp'
43--- src/util/command-line-parser.cpp 2013-06-24 11:09:38 +0000
44+++ src/util/command-line-parser.cpp 2013-08-27 06:51:32 +0000
45@@ -31,8 +31,6 @@
46 m_isPortrait(false),
47 m_picturesDir(""),
48 m_pickMode(false),
49- m_pickPhoto(false),
50- m_pickVideo(false),
51 m_logImageLoading(false),
52 m_formFactors(form_factors),
53 m_formFactor("desktop")
54@@ -71,13 +69,8 @@
55 else if (args[i] == "--log-image-loading") {
56 m_logImageLoading = true;
57 }
58- else if (args[i] == "--pick-photo") {
59- m_pickMode = true;
60- m_pickPhoto = true;
61- }
62- else if (args[i] == "--pick-video") {
63- m_pickMode = true;
64- m_pickVideo = true;
65+ else if (args[i] == "--pick-mode") {
66+ m_pickMode = true;
67 }
68 else {
69 QString form_factor = args[i].mid(2); // minus initial "--"
70@@ -118,8 +111,7 @@
71
72 out << " --startup-timer\n\t\tdebug-print startup time" << endl;
73 out << " --log-image-loading\n\t\tlog image loading" << endl;
74- out << " --pick-photo\n\t\tEnable mode to pick one photo" << endl;
75- out << " --pick-video\n\t\tEnable mode to pick one video" << endl;
76+ out << " --pick-mode\n\t\tEnable mode to pick photos" << endl;
77 out << "pictures_dir defaults to ~/Pictures, and must exist prior to running gallery" << endl;
78 }
79
80
81=== modified file 'src/util/command-line-parser.h'
82--- src/util/command-line-parser.h 2013-06-24 11:09:38 +0000
83+++ src/util/command-line-parser.h 2013-08-27 06:51:32 +0000
84@@ -42,8 +42,6 @@
85 bool startupTimer() const { return m_startupTimer; }
86 bool logImageLoading() const { return m_logImageLoading; }
87 bool pickModeEnabled() const { return m_pickMode; }
88- bool pickPhoto() const { return m_pickPhoto; }
89- bool pickVideo() const { return m_pickVideo; }
90 const QString &formFactor() const { return m_formFactor; }
91
92 private:
93@@ -55,8 +53,6 @@
94 bool m_isPortrait;
95 QString m_picturesDir;
96 bool m_pickMode;
97- bool m_pickPhoto;
98- bool m_pickVideo;
99 bool m_logImageLoading;
100
101 const QHash<QString, QSize> m_formFactors;
102
103=== modified file 'tests/autopilot/gallery_app/tests/test_picker_mode.py'
104--- tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-08-19 13:58:55 +0000
105+++ tests/autopilot/gallery_app/tests/test_picker_mode.py 2013-08-27 06:51:32 +0000
106@@ -24,7 +24,7 @@
107 return self.app.select_single(PickerScreen)
108
109 def setUp(self):
110- self.ARGS.append("--pick-photo")
111+ self.ARGS.append("--pick-mode")
112 super(TestPickerMode, self).setUp()
113
114 def select_first_event_media(self):
115
116=== modified file 'tests/unittests/command-line-parser/tst_commandlineparser.cpp'
117--- tests/unittests/command-line-parser/tst_commandlineparser.cpp 2013-06-24 11:09:38 +0000
118+++ tests/unittests/command-line-parser/tst_commandlineparser.cpp 2013-08-27 06:51:32 +0000
119@@ -88,8 +88,6 @@
120 QTest::addColumn<bool>("startup_timer");
121 QTest::addColumn<bool>("log_image_loading");
122 QTest::addColumn<bool>("pick_mode_enabled");
123- QTest::addColumn<bool>("pick_photo");
124- QTest::addColumn<bool>("pick_video");
125 QTest::addColumn<bool>("invalid_arg");
126
127 QStringList boolean_test;
128@@ -98,7 +96,7 @@
129 boolean_test.append("--fullscreen");
130 boolean_test.append("--startup-timer");
131 boolean_test.append("--log-image-loading");
132- boolean_test.append("--pick-photo");
133+ boolean_test.append("--pick-mode");
134
135 QStringList invalid_arg_test;
136 invalid_arg_test.append("gallery");
137@@ -110,11 +108,11 @@
138 help_test.append("--landscape");
139
140 QTest::newRow("Boolean member test") << boolean_test << true << true << true << true
141- << true << true << false << true;
142+ << true << true;
143 QTest::newRow("Invalid arg test") << invalid_arg_test << false << false << false << false
144- << false << false << false << false;
145+ << false << false;
146 QTest::newRow("Help test") << help_test << false << false << false << false
147- << false << false << false << false;
148+ << false << false;
149 }
150
151 void tst_CommandLineParser::process_args_test()
152@@ -129,8 +127,6 @@
153 QFETCH(bool, startup_timer);
154 QFETCH(bool, log_image_loading);
155 QFETCH(bool, pick_mode_enabled);
156- QFETCH(bool, pick_photo);
157- QFETCH(bool, pick_video);
158 QFETCH(bool, invalid_arg);
159
160 bool result = test.processArguments(process_args);
161@@ -140,8 +136,6 @@
162 QCOMPARE(test.startupTimer(), startup_timer);
163 QCOMPARE(test.logImageLoading(), log_image_loading);
164 QCOMPARE(test.pickModeEnabled(), pick_mode_enabled);
165- QCOMPARE(test.pickPhoto(), pick_photo);
166- QCOMPARE(test.pickVideo(), pick_video);
167 QCOMPARE(result, invalid_arg);
168 }
169

Subscribers

People subscribed via source and target branches