~ubuntu-branches/ubuntu/quantal/libkipi/quantal

« back to all changes in this revision

Viewing changes to libkipi/imagecollectionshared.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rohan Garg, Rohan Garg, Felix Geyer
  • Date: 2011-07-11 14:25:37 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20110711142537-k37bb9e558uzw9fl
Tags: 4:4.6.90+repack-0ubuntu1
[ Rohan Garg ]
* Initial release
* Repacked tarball to include a copy of LGPL-2

[ Felix Geyer ]
* Bump Stadnards-Version to 3.9.2.
* Build-depend on kde-sc-dev-latest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** ===========================================================
 
2
 * @file
 
3
 *
 
4
 * This file is a part of digiKam project
 
5
 * <a href="http://www.digikam.org">http://www.digikam.org</a>
 
6
 *
 
7
 * @date   2004-02-01
 
8
 * @brief  image collection shared
 
9
 *
 
10
 * @author Copyright (C) 2004-2010 by Gilles Caulier
 
11
 *         <a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
 
12
 * @author Copyright (C) 2004-2005 by Renchi Raju
 
13
 *         <a href="mailto:renchi dot raju at gmail dot com">renchi dot raju at gmail dot com</a>
 
14
 * @author Copyright (C) 2004-2005 by Jesper K. Pedersen
 
15
 *         <a href="mailto:blackie at kde dot org">blackie at kde dot org</a>
 
16
 * @author Copyright (C) 2004-2005 by Aurelien Gateau
 
17
 *         <a href="mailto:aurelien dot gateau at free dot fr">aurelien dot gateau at free dot fr</a>
 
18
 *
 
19
 * This program is free software; you can redistribute it
 
20
 * and/or modify it under the terms of the GNU General
 
21
 * Public License as published by the Free Software Foundation;
 
22
 * either version 2, or (at your option)
 
23
 * any later version.
 
24
 *
 
25
 * This program is distributed in the hope that it will be useful,
 
26
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
27
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
28
 * GNU General Public License for more details.
 
29
 *
 
30
 * ============================================================ */
 
31
 
 
32
#include "imagecollectionshared.h"
 
33
 
 
34
// KDE Includes.
 
35
 
 
36
#include <kdebug.h>
 
37
 
 
38
namespace KIPI
 
39
{
 
40
 
 
41
ImageCollectionShared::ImageCollectionShared()
 
42
                     : m_count(1)
 
43
{
 
44
}
 
45
 
 
46
void ImageCollectionShared::addRef()
 
47
{
 
48
    m_count++;
 
49
}
 
50
 
 
51
void ImageCollectionShared::removeRef()
 
52
{
 
53
    m_count--;
 
54
    if ( m_count == 0 )
 
55
    {
 
56
        // kDebug() << "Deleting!" << endl;
 
57
        delete this;
 
58
    }
 
59
}
 
60
 
 
61
KUrl ImageCollectionShared::path()
 
62
{
 
63
    kWarning() << "This method should only be invoked if this imagecollection is a directory.\n"
 
64
               << "See KIPI::ImageCollectionShared::isDirectory()";
 
65
    return KUrl();
 
66
}
 
67
 
 
68
KUrl ImageCollectionShared::uploadPath()
 
69
{
 
70
    kWarning() << "This method should only be invoked if the host application supports the KIPI::Features\n"
 
71
                  "AcceptNewImages - if the host application do support that, then this function should\n"
 
72
                  "have been overridden in the host application.";
 
73
    return KUrl();
 
74
}
 
75
 
 
76
KUrl ImageCollectionShared::uploadRoot()
 
77
{
 
78
    KUrl path = uploadPath();
 
79
    if ( path.isValid() )
 
80
    {
 
81
        path.setPath("/");
 
82
        return path;
 
83
    }
 
84
    else
 
85
    {
 
86
        return KUrl( "file:/" );
 
87
    }
 
88
}
 
89
 
 
90
QString ImageCollectionShared::uploadRootName()
 
91
{
 
92
   return (QString("Images"));   // No i18n here. THis must be done on KIPI host interface.
 
93
}
 
94
 
 
95
bool ImageCollectionShared::isDirectory()
 
96
{
 
97
    return false;
 
98
}
 
99
 
 
100
QString ImageCollectionShared::comment()
 
101
{
 
102
    kWarning() << "KIPI::ImageCollectionShared::comment should only be invoked if the host application supports\n"
 
103
                  "the KIPI::Features AlbumsHaveComments - if the host application do support that, then this function should\n"
 
104
                  "have been overridden in the host application.";
 
105
    return QString();
 
106
}
 
107
 
 
108
QString ImageCollectionShared::category()
 
109
{
 
110
    kWarning() << "KIPI::ImageCollectionShared::category should only be invoked if the host application supports\n"
 
111
                  "the KIPI::Features AlbumsHaveCategory - if the host application do support that, then this function should\n"
 
112
                  "have been overridden in the host application.";
 
113
    return QString();
 
114
}
 
115
 
 
116
QDate ImageCollectionShared::date()
 
117
{
 
118
    kWarning() << "KIPI::ImageCollectionShared::date should only be invoked if the host application supports\n"
 
119
                  "the KIPI::Features AlbumsHaveCreationDate - if the host application do support that, then this function should\n"
 
120
                  "have been overridden in the host application.";
 
121
    return QDate();
 
122
}
 
123
 
 
124
bool ImageCollectionShared::operator==(ImageCollectionShared& ics)
 
125
{
 
126
    return images() == ics.images();
 
127
}
 
128
 
 
129
} // namespace KIPI