2
* Copyright (C) 2013 Canonical, Ltd.
5
* Nicolas d'Offay <nicolas.doffay@canonical.com>
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.
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.
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/>.
23
#include "preview-manager.h"
24
#include "media-collection.h"
26
const int PreviewManager::PREVIEW_SIZE = 360;
27
const QString PreviewManager::PREVIEW_DIR = ".thumbs";
28
const char* PreviewManager::PREVIEW_FILE_EXT = "JPG";
30
PreviewManager::PreviewManager(const QString &thumbnailDirectory, QObject *parent)
32
Q_UNUSED(thumbnailDirectory);
35
bool PreviewManager::ensurePreview(QFileInfo file, bool regen)
43
void PreviewManager::onMediaAddedRemoved(const QSet<DataObject *> *, const QSet<DataObject *> *)
47
void PreviewManager::onMediaDestroying(const QSet<DataObject *> *)
51
void PreviewManager::updatePreview()
55
QString PreviewManager::previewFileName(const QFileInfo &file) const
57
return QString(file.absolutePath() + QDir::separator() + PREVIEW_DIR +
58
QDir::separator() + file.completeBaseName() + "_th." + PREVIEW_FILE_EXT);
61
QString PreviewManager::thumbnailFileName(const QFileInfo& file) const
63
return QString(file.absolutePath() + PREVIEW_DIR + QDir::separator() +
64
file.completeBaseName() + "_th_s." + PREVIEW_FILE_EXT);