~artmello/gallery-app/gallery-app-start_on_event

« back to all changes in this revision

Viewing changes to src/media/media-source.cpp

  • Committer: CI bot
  • Author(s): Arthur Mello, Bill Filler, Ugo Riboni
  • Date: 2014-03-19 20:19:57 UTC
  • mfrom: (912.3.20 multiple-bug-fixes)
  • Revision ID: ps-jenkins@lists.canonical.com-20140319201957-32sglr01gx1xx9e0
multiple gallery-app bug fixes Bug #907870: [desktop] Gallery does not display photos in sub folders, Bug #1221968: use libthumbnailer for gallery thumbnails, Bug #1268748: videos are not displayed when running on desktop, Bug #1271327: disable switching between camera and gallery on desktop, Bug #1287272: Black flash at the end of the zoom animation" Fixes: 907870, 1221968, 1268748, 1271327, 1287272

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
// qml
27
27
#include "gallery-standard-image-provider.h"
28
 
#include "gallery-thumbnail-image-provider.h"
 
28
 
 
29
#include <QUrl>
29
30
 
30
31
/*!
31
32
 * \brief MediaSource::MediaSource
84
85
 */
85
86
QUrl MediaSource::galleryPath() const
86
87
{
87
 
    return GalleryStandardImageProvider::toURL(m_file);
 
88
    /* At the moment the only video files we recognize are mp4
 
89
     * files. This was maintained hardcoded from the previous
 
90
     * version of gallery app, and should be fixed in the future.
 
91
     * For those files the full image is the thumbnail/preview itself */
 
92
    if (m_file.suffix().toLower() == "mp4") {
 
93
        QString path("image://thumbnailer/");
 
94
        path.append(m_file.absoluteFilePath());
 
95
        return QUrl(path);
 
96
    } else {
 
97
        return GalleryStandardImageProvider::toURL(m_file);
 
98
    }
88
99
}
89
100
 
90
101
/*!
93
104
 */
94
105
QUrl MediaSource::galleryPreviewPath() const
95
106
{
96
 
    return GalleryStandardImageProvider::toURL(m_file);
 
107
    QString path("image://thumbnailer/");
 
108
    path.append(m_file.absoluteFilePath());
 
109
    return QUrl(path);
97
110
}
98
111
 
99
112
/*!
102
115
 */
103
116
QUrl MediaSource::galleryThumbnailPath() const
104
117
{
105
 
    return GalleryThumbnailImageProvider::toURL(m_file);
 
118
    QString path("image://thumbnailer/");
 
119
    path.append(m_file.absoluteFilePath());
 
120
    return QUrl(path);
106
121
}
107
122
 
108
123
/*!