[Digikam-devel] branches/extragear/graphics/digikam
Marcel Wiesweg
marcel.wiesweg at gmx.de
Tue Jul 6 19:58:22 BST 2010
SVN commit 1146837 by mwiesweg:
In ImageInfo, provide methods to
- retrieve and set a DImageHistory from the database
- retrieve and set the image UUID (*)
- convenience methods to get ImageTagPair objects
Cleanup the imageinfo.h header, use implicit declarations.
CCMAIL: digikam-devel at kde.org
M +1 -0 digikam/metadatahub.cpp
M +1 -0 digikam/tooltipfiller.cpp
M +61 -1 libs/database/imageinfo.cpp
M +32 -8 libs/database/imageinfo.h
M +1 -0 libs/imageproperties/imagedescedittab.cpp
M +2 -0 libs/imageproperties/imagepropertiessidebardb.cpp
M +1 -0 utilities/advancedrename/common/parsesettings.h
M +1 -0 utilities/advancedrename/parser/options/database/keys/commonkeys.cpp
M +1 -0 utilities/advancedrename/parser/options/database/keys/metadatakeys.cpp
M +2 -0 utilities/advancedrename/parser/options/database/keys/positionkeys.cpp
M +1 -0 utilities/gpssearch/gpssearchview.cpp
M +2 -0 utilities/kipiiface/kipiimageinfo.cpp
M +1 -0 utilities/nepomuk/digikamnepomukservice.cpp
--- branches/extragear/graphics/digikam/digikam/metadatahub.cpp #1146836:1146837
@@ -41,6 +41,7 @@
// Local includes
#include "imageinfo.h"
+#include "imagecomments.h"
#include "template.h"
#include "templatemanager.h"
#include "albumsettings.h"
--- branches/extragear/graphics/digikam/digikam/tooltipfiller.cpp #1146836:1146837
@@ -40,6 +40,7 @@
#include "albummanager.h"
#include "albumsettings.h"
#include "album.h"
+#include "databaseinfocontainers.h"
#include "ditemtooltip.h"
#include "imageinfo.h"
--- branches/extragear/graphics/digikam/libs/database/imageinfo.cpp #1146836:1146837
@@ -35,13 +35,24 @@
#include "albumdb.h"
#include "databaseaccess.h"
+#include "databaseinfocontainers.h"
+#include "dimagehistory.h"
#include "collectionmanager.h"
#include "collectionlocation.h"
-#include "imagelister.h"
#include "imageinfodata.h"
#include "imageinfocache.h"
+#include "imagelister.h"
+#include "imagelisterrecord.h"
+#include "imageinfolist.h"
+#include "imagecomments.h"
+#include "imagecopyright.h"
+#include "imageextendedproperties.h"
+#include "imageposition.h"
#include "imagescanner.h"
+#include "imagetagpair.h"
#include "tagscache.h"
+#include "template.h"
+#include "photoinfocontainer.h"
namespace Digikam
{
@@ -480,6 +491,55 @@
return ImagePosition(m_data->id);
}
+ImageTagPair ImageInfo::imageTagPair(int tagId) const
+{
+ if (!m_data)
+ return ImageTagPair();
+
+ return ImageTagPair(*this, tagId);
+}
+
+QList<ImageTagPair> ImageInfo::availableImageTagPairs() const
+{
+ if (!m_data)
+ return QList<ImageTagPair>();
+
+ return ImageTagPair::availablePairs(*this);
+}
+
+DImageHistory ImageInfo::imageHistory() const
+{
+ if (!m_data)
+ return DImageHistory();
+
+ ImageHistoryEntry entry = DatabaseAccess().db()->getImageHistory(m_data->id);
+ return DImageHistory::fromXml(entry.history);
+}
+
+void ImageInfo::setImageHistory(const DImageHistory& history)
+{
+ if (!m_data)
+ return;
+
+ DatabaseAccess().db()->setImageHistory(m_data->id, history.toXml());
+}
+
+QString ImageInfo::uuid() const
+{
+ if (!m_data)
+ return QString();
+
+ return DatabaseAccess().db()->getImageUuid(m_data->id);
+}
+
+void ImageInfo::setUuid(const QString& uuid)
+{
+ if (!m_data)
+ return;
+
+ DatabaseAccess().db()->setImageUuid(m_data->id, uuid);
+}
+
ImageCommonContainer ImageInfo::imageCommonContainer() const
{
if (!m_data)
--- branches/extragear/graphics/digikam/libs/database/imageinfo.h #1146836:1146837
@@ -39,23 +39,27 @@
// Local includes
+#include "albuminfo.h"
#include "digikam_export.h"
#include "dshareddata.h"
#include "databaseurl.h"
-#include "imagelisterrecord.h"
#include "imageinfolist.h"
-#include "imagecomments.h"
-#include "imagecopyright.h"
-#include "imageextendedproperties.h"
-#include "imageposition.h"
-#include "template.h"
-#include "photoinfocontainer.h"
-#include "databaseinfocontainers.h"
namespace Digikam
{
+class DImageHistory;
+class ImageComments;
+class ImageCommonContainer;
+class ImageCopyright;
+class ImageExtendedProperties;
class ImageInfoData;
+class ImageListerRecord;
+class ImageMetadataContainer;
+class ImagePosition;
+class ImageTagPair;
+class PhotoInfoContainer;
+class Template;
/**
* The ImageInfo class contains provides access to the database for a single image.
@@ -224,6 +228,26 @@
ImagePosition imagePosition() const;
/**
+ * Retrieve an ImageTagPair object for a single tag, or for all
+ * image/tag pairs for which properties are available
+ * (not necessarily the assigned tags)
+ */
+ ImageTagPair imageTagPair(int tagId) const;
+ QList<ImageTagPair> availableImageTagPairs() const;
+
+ /**
+ * Retrieves and sets the image history from the database
+ */
+ DImageHistory imageHistory() const;
+ void setImageHistory(const DImageHistory& history);
+
+ /**
+ * Retrieves and sets this' images UUID
+ */
+ QString uuid() const;
+ void setUuid(const QString& uuid);
+
+ /**
* Retrieve information about the image,
* in form of numbers and user presentable strings,
* for certain defined fields of information (see databaseinfocontainers.h)
--- branches/extragear/graphics/digikam/libs/imageproperties/imagedescedittab.cpp #1146836:1146837
@@ -65,6 +65,7 @@
#include "imageattributeswatch.h"
#include "statusprogressbar.h"
#include "tagmodificationhelper.h"
+#include "template.h"
namespace Digikam
{
--- branches/extragear/graphics/digikam/libs/imageproperties/imagepropertiessidebardb.cpp #1146836:1146837
@@ -53,6 +53,8 @@
#include "imagepropertiestab.h"
#include "imagepropertiesmetadatatab.h"
#include "imagepropertiescolorstab.h"
+#include "databaseinfocontainers.h"
+#include "imageposition.h"
namespace Digikam
{
--- branches/extragear/graphics/digikam/utilities/advancedrename/common/parsesettings.h #1146836:1146837
@@ -34,6 +34,7 @@
#include "imageinfo.h"
#include "parseresults.h"
+#include "photoinfocontainer.h"
namespace Digikam
{
--- branches/extragear/graphics/digikam/utilities/advancedrename/parser/options/database/keys/commonkeys.cpp #1146836:1146837
@@ -29,6 +29,7 @@
// local includes
+#include "databaseinfocontainers.h"
#include "imageinfo.h"
#include "imagecopyright.h"
--- branches/extragear/graphics/digikam/utilities/advancedrename/parser/options/database/keys/metadatakeys.cpp #1146836:1146837
@@ -29,6 +29,7 @@
// local includes
+#include "databaseinfocontainers.h"
#include "imageinfo.h"
static const QString KEY_MAKE("CameraMake");
--- branches/extragear/graphics/digikam/utilities/advancedrename/parser/options/database/keys/positionkeys.cpp #1146836:1146837
@@ -29,7 +29,9 @@
// local includes
+#include "databaseinfocontainers.h"
#include "imageinfo.h"
+#include "imageposition.cpp"
static const QString KEY_LATITUDE("Latitude");
static const QString KEY_LONGITUDE("Longitude");
--- branches/extragear/graphics/digikam/utilities/gpssearch/gpssearchview.cpp #1146836:1146837
@@ -57,6 +57,7 @@
#include "gpssearchwidget.h"
#include "imageinfo.h"
#include "imageinfojob.h"
+#include "imageposition.h"
#include "searchtextbar.h"
#include "searchxml.h"
--- branches/extragear/graphics/digikam/utilities/kipiiface/kipiimageinfo.cpp #1146836:1146837
@@ -45,6 +45,8 @@
#include "databaseaccess.h"
#include "dmetadata.h"
#include "imageattributeswatch.h"
+#include "imagecomments.h"
+#include "imageposition.h"
#include "globals.h"
#include "tagscache.h"
--- branches/extragear/graphics/digikam/utilities/nepomuk/digikamnepomukservice.cpp #1146836:1146837
@@ -62,6 +62,7 @@
#include "databaseparameters.h"
#include "databasetransaction.h"
#include "databasewatch.h"
+#include "imagecomments.h"
#include "imageinfo.h"
#include "imagelister.h"
#include "tagscache.h"
More information about the Digikam-devel
mailing list