Merge lp:~artmello/gallery-app/gallery-app-handle_gif_files into lp:gallery-app

Proposed by Arthur Mello on 2014-12-17
Status: Merged
Approved by: Bill Filler on 2015-01-09
Approved revision: 1124
Merged at revision: 1124
Proposed branch: lp:~artmello/gallery-app/gallery-app-handle_gif_files
Merge into: lp:gallery-app
Diff against target: 78 lines (+14/-7)
4 files modified
rc/qml/MediaViewer/MediaViewer.qml (+1/-0)
src/photo/photo.cpp (+6/-7)
src/photo/photo.h (+2/-0)
tests/unittests/stubs/photo_stub.cpp (+5/-0)
To merge this branch: bzr merge lp:~artmello/gallery-app/gallery-app-handle_gif_files
Reviewer Review Type Date Requested Status
Bill Filler (community) 2014-12-17 Approve on 2015-01-09
PS Jenkins bot continuous-integration Needs Fixing on 2014-12-17
Review via email: mp+244934@code.launchpad.net

Commit Message

Make gallery display files that are not supported by QImageWriter or that do not have metadata
Disable the editing options for files that are not supported by QImageWriter

Description of the Change

Make gallery display files that are not supported by QImageWriter or that do not have metadata
Disable the editing options for files that are not supported by QImageWriter

To post a comment you must log in.
1124. By Arthur Mello on 2014-12-17

Fix stub on unittests

Bill Filler (bfiller) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rc/qml/MediaViewer/MediaViewer.qml'
2--- rc/qml/MediaViewer/MediaViewer.qml 2014-11-06 14:43:21 +0000
3+++ rc/qml/MediaViewer/MediaViewer.qml 2014-12-17 10:40:49 +0000
4@@ -479,6 +479,7 @@
5 objectName: "editButton"
6 text: i18n.tr("Edit")
7 iconSource: "../../img/edit.png"
8+ enabled: galleryPhotoViewer.media.canBeEdited
9 onTriggered: PopupUtils.open(editPopoverComponent, null);
10 },
11 Action {
12
13=== modified file 'src/photo/photo.cpp'
14--- src/photo/photo.cpp 2014-02-11 19:56:40 +0000
15+++ src/photo/photo.cpp 2014-12-17 10:40:49 +0000
16@@ -169,13 +169,7 @@
17 return false;
18 }
19
20- PhotoMetadata* tmp = PhotoMetadata::fromFile(file);
21- if (tmp == NULL)
22- return false;
23-
24- delete tmp;
25- return reader.canRead() &&
26- QImageWriter::supportedImageFormats().contains(reader.format());
27+ return reader.canRead();
28 }
29
30 /*!
31@@ -394,6 +388,11 @@
32 return currentState().isOriginal();
33 }
34
35+bool Photo::canBeEdited() const
36+{
37+ return QImageWriter::supportedImageFormats().contains(m_fileFormat.toUtf8());
38+}
39+
40 /*!
41 * \brief Photo::rotateRight
42 */
43
44=== modified file 'src/photo/photo.h'
45--- src/photo/photo.h 2013-07-26 15:43:53 +0000
46+++ src/photo/photo.h 2014-12-17 10:40:49 +0000
47@@ -44,6 +44,7 @@
48 Q_PROPERTY(bool canUndo READ canUndo NOTIFY editStackChanged)
49 Q_PROPERTY(bool canRedo READ canRedo NOTIFY editStackChanged)
50 Q_PROPERTY(bool isOriginal READ isOriginal NOTIFY editStackChanged)
51+ Q_PROPERTY(bool canBeEdited READ canBeEdited)
52
53 public:
54 explicit Photo(const QFileInfo& file);
55@@ -69,6 +70,7 @@
56 bool canUndo() const;
57 bool canRedo() const;
58 bool isOriginal() const;
59+ bool canBeEdited() const;
60
61 Q_INVOKABLE void revertToOriginal();
62 Q_INVOKABLE void undo();
63
64=== modified file 'tests/unittests/stubs/photo_stub.cpp'
65--- tests/unittests/stubs/photo_stub.cpp 2013-07-26 15:43:53 +0000
66+++ tests/unittests/stubs/photo_stub.cpp 2014-12-17 10:40:49 +0000
67@@ -122,6 +122,11 @@
68 return true;
69 }
70
71+bool Photo::canBeEdited() const
72+{
73+ return true;
74+}
75+
76 void Photo::rotateRight()
77 {
78 }

Subscribers

People subscribed via source and target branches