~ubuntu-branches/ubuntu/vivid/digikam/vivid

« back to all changes in this revision

Viewing changes to core/utilities/importui/items/camerafolderitem.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg
  • Date: 2012-11-26 18:24:20 UTC
  • mfrom: (1.9.1) (3.1.23 experimental)
  • Revision ID: package-import@ubuntu.com-20121126182420-qoy6z0nx4ai0wzcl
Tags: 4:3.0.0~beta3-0ubuntu1
* New upstream release
  - Add build-deps :  libhupnp-dev, libqtgstreamer-dev, libmagickcore-dev
* Merge from debian, remaining changes:
  - Make sure libqt4-opengl-dev, libgl1-mesa-dev and libglu1-mesa-dev only
    install on i386,amd64 and powerpc
  - Depend on libtiff-dev instead of libtiff4-dev
  - Drop digikam breaks/replaces kipi-plugins-common since we're past the
    LTS release now
  - digikam to recommend mplayerthumbs | ffmpegthumbs. We currently only
    have latter in the archives, even though former is also supposed to
    be part of kdemultimedia. (LP: #890059)
  - kipi-plugins to recommend www-browser rather than konqueror directly
    since 2.8 no direct usage of konqueror is present in the flickr
    plugin anymore (LP: #1011211)
  - Keep kubuntu_mysqld_executable_name.diff
  - Don't install libkipi translations
  - Keep deps on libcv-dev, libcvaux-dev
  - Keep split packaging of libraries
  - Replace icons from KDE 3 time in debian/xpm.d/*.xpm with the new
    versions (LP: #658047)
* Update debian/not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ============================================================
 
2
 *
 
3
 * This file is a part of digiKam project
 
4
 * http://www.digikam.org
 
5
 *
 
6
 * Date        : 2003-01-23
 
7
 * Description : A widget to display a camera folder.
 
8
 *
 
9
 * Copyright (C) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
 
10
 * Copyright (C) 2006-2012 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
11
 *
 
12
 * This program is free software; you can redistribute it
 
13
 * and/or modify it under the terms of the GNU General
 
14
 * Public License as published by the Free Software Foundation;
 
15
 * either version 2, or (at your option)
 
16
 * any later version.
 
17
 *
 
18
 * This program is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
21
 * GNU General Public License for more details.
 
22
 *
 
23
 * ============================================================ */
 
24
 
 
25
#include "camerafolderitem.h"
 
26
 
 
27
namespace Digikam
 
28
{
 
29
 
 
30
class CameraFolderItem::Private
 
31
{
 
32
public:
 
33
 
 
34
    Private() :
 
35
        virtualFolder(true),
 
36
        count(0)
 
37
    {
 
38
    }
 
39
 
 
40
    bool    virtualFolder;
 
41
    int     count;
 
42
 
 
43
    QString folderName;
 
44
    QString folderPath;
 
45
    QString name;
 
46
};
 
47
 
 
48
CameraFolderItem::CameraFolderItem(QTreeWidget* const parent, const QString& name, const QPixmap& pixmap)
 
49
    : QTreeWidgetItem(parent), d(new Private)
 
50
{
 
51
    d->name = name;
 
52
    setIcon(0, pixmap);
 
53
    setText(0, d->name);
 
54
}
 
55
 
 
56
CameraFolderItem::CameraFolderItem(QTreeWidgetItem* const parent, const QString& folderName,
 
57
                                   const QString& folderPath, const QPixmap& pixmap)
 
58
    : QTreeWidgetItem(parent), d(new Private)
 
59
{
 
60
    d->folderName    = folderName;
 
61
    d->folderPath    = folderPath;
 
62
    d->virtualFolder = false;
 
63
    d->name          = folderName;
 
64
    setIcon(0, pixmap);
 
65
    setText(0, d->name);
 
66
}
 
67
 
 
68
CameraFolderItem::~CameraFolderItem()
 
69
{
 
70
    delete d;
 
71
}
 
72
 
 
73
bool CameraFolderItem::isVirtualFolder() const
 
74
{
 
75
    return d->virtualFolder;
 
76
}
 
77
 
 
78
QString CameraFolderItem::folderName() const
 
79
{
 
80
    return d->folderName;
 
81
}
 
82
 
 
83
QString CameraFolderItem::folderPath() const
 
84
{
 
85
    return d->folderPath;
 
86
}
 
87
 
 
88
void CameraFolderItem::changeCount(int val)
 
89
{
 
90
    d->count += val;
 
91
    setText(0, QString("%1 (%2)").arg(d->name).arg(QString::number(d->count)));
 
92
}
 
93
 
 
94
void CameraFolderItem::setCount(int val)
 
95
{
 
96
    d->count = val;
 
97
    setText(0, QString("%1 (%2)").arg(d->name).arg(QString::number(d->count)));
 
98
}
 
99
 
 
100
int CameraFolderItem::count() const
 
101
{
 
102
    return d->count;
 
103
}
 
104
 
 
105
} // namespace Digikam