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

« back to all changes in this revision

Viewing changes to tests/unittests/stubs/preview-manager_stub.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:
1
 
/*
2
 
 * Copyright (C) 2013 Canonical, Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Nicolas d'Offay <nicolas.doffay@canonical.com>
6
 
 *
7
 
 * This program is free software; you can redistribute it and/or modify
8
 
 * it under the terms of the GNU General Public License as published by
9
 
 * the Free Software Foundation; version 3.
10
 
 *
11
 
 * This program is distributed in the hope that it will be useful,
12
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
15
 
 *
16
 
 * You should have received a copy of the GNU General Public License
17
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
 
 *
19
 
 */
20
 
 
21
 
#include <QDir>
22
 
 
23
 
#include "preview-manager.h"
24
 
#include "media-collection.h"
25
 
 
26
 
const int PreviewManager::PREVIEW_SIZE = 360;
27
 
const QString PreviewManager::PREVIEW_DIR = ".thumbs";
28
 
const char* PreviewManager::PREVIEW_FILE_EXT = "JPG";
29
 
 
30
 
PreviewManager::PreviewManager(const QString &thumbnailDirectory, QObject *parent)
31
 
{
32
 
    Q_UNUSED(thumbnailDirectory);
33
 
}
34
 
 
35
 
bool PreviewManager::ensurePreview(QFileInfo file, bool regen)
36
 
{
37
 
    file = QFileInfo();
38
 
    regen = false;
39
 
 
40
 
    return regen;
41
 
}
42
 
 
43
 
void PreviewManager::onMediaAddedRemoved(const QSet<DataObject *> *, const QSet<DataObject *> *)
44
 
{
45
 
}
46
 
 
47
 
void PreviewManager::onMediaDestroying(const QSet<DataObject *> *)
48
 
{
49
 
}
50
 
 
51
 
void PreviewManager::updatePreview()
52
 
{
53
 
}
54
 
 
55
 
QString PreviewManager::previewFileName(const QFileInfo &file) const
56
 
{
57
 
    return QString(file.absolutePath() + QDir::separator() + PREVIEW_DIR +
58
 
                   QDir::separator() + file.completeBaseName() + "_th." + PREVIEW_FILE_EXT);
59
 
}
60
 
 
61
 
QString PreviewManager::thumbnailFileName(const QFileInfo& file) const
62
 
{
63
 
  return QString(file.absolutePath() + PREVIEW_DIR + QDir::separator() +
64
 
                 file.completeBaseName() + "_th_s." + PREVIEW_FILE_EXT);
65
 
}