[Kde-imaging] [libkipi] libkipi: libkipi : new method deprecated.
Gilles Caulier
caulier.gilles at gmail.com
Tue Feb 7 12:10:00 UTC 2012
Git commit c41890db220f2db164f2220b3881655b5a717641 by Gilles Caulier.
Committed on 07/02/2012 at 13:05.
Pushed by cgilles into branch 'master'.
libkipi : new method deprecated.
Uopdate list of attributes usable between plugins and host application
Note : do not use KIPI::ImageInfo class directly in plugins but wrapper class KIPIPlugins::KPImageInfo wrapper instead,
to preserve binary compatibility in libkipi. KPImageInfo can be extended as we want without to touch libkipi...
CCMAIL: digikam-devel at kde.org
CCMAIL: kde-imaging at kde.org
M +33 -24 libkipi/imageinfo.h
M +13 -13 libkipi/imageinfoshared.cpp
M +1 -2 libkipi/imageinfoshared.h
http://commits.kde.org/libkipi/c41890db220f2db164f2220b3881655b5a717641
diff --git a/libkipi/imageinfo.h b/libkipi/imageinfo.h
index 33c6f35..4ae3286 100644
--- a/libkipi/imageinfo.h
+++ b/libkipi/imageinfo.h
@@ -87,18 +87,22 @@ public:
In case the host application supports some special attributes of the image
this function can be used to return them. Following attributes are supported by these features:
- QString("comment") :: QString() with default comment [same than description()].
- QString("date") :: QDateTime() with date [same than time()].
- QString("angle") :: integer value (orientation information. See KExiv2::ImageOrientation value for details).
- QString("title") :: QString() with default title.
- QString("rating") :: integer value (ususally 0 <= rate <= 5).
- QString("colorlabel"):: integer value (ususally 0 <= colorlabel <= 9).
- QString("picklabel") :: integer value (ususally 0 <= picklabel <= 4).
- QString("latitude") :: double value in degrees (-90.0 >= lat <=90.0).
- QString("longitude") :: double value in degrees (-180.0 >= long <=180.0).
- QString("altitude") :: double value in meters.
- QString("tagspath") :: QStringList() with tags path list formated as "Country/France/City/Paris" for ex.
- QString("tags") :: QStringList() with tags name list (keywords).
+ QString("comment") :: QString() with default comment [same than description()].
+ QString("date") :: QDateTime() with date [same than time()].
+ QString("orientation") :: integer value (orientation information. See KExiv2::ImageOrientation value for details).
+ QString("title") :: QString() with default title.
+ QString("rating") :: integer value (ususally 0 <= rate <= 5).
+ QString("colorlabel") :: integer value (ususally 0 <= colorlabel <= 9).
+ QString("picklabel") :: integer value (ususally 0 <= picklabel <= 4).
+ QString("latitude") :: double value in degrees (-90.0 >= lat <=90.0).
+ QString("longitude") :: double value in degrees (-180.0 >= long <=180.0).
+ QString("altitude") :: double value in meters.
+ QString("tagspath") :: QStringList() with tags path list formated as "Country/France/City/Paris" for ex.
+ QString("keywords") :: QStringList() with tags name list.
+ QString("filesize") :: qlonglong value in bytes.
+
+ QString("tags") :: DEPRECATED: for compatibility. Deprecated and replaced by "keywords" attribute.
+ QString("angle") :: DEPRECATED: for compatibility. Deprecated and replaced by "orientation" attribute.
*/
QMap<QString, QVariant> attributes() const;
@@ -108,15 +112,18 @@ public:
void addAttributes(const QMap<QString, QVariant>&);
/** Remove attributes listed from the image. Following values can be used:
- QString("comment") :: Remove all comments.
- QString("date") :: Remove date info.
- QString("angle") :: Remove orientation info.
- QString("title") :: Remove all titles.
- QString("tags") :: Remove all tags.
- QString("rating") :: Remove rating info.
- QString("colorlabel") :: Remove color labels info.
- QString("picklabel") :: Remove pick labels info.
- QString("gpslocation"):: Remove latitude, longitude, and altitude values.
+ QString("comment") :: Remove all comments.
+ QString("date") :: Remove date info.
+ QString("orientation") :: Remove orientation info.
+ QString("title") :: Remove all titles.
+ QString("tagspath") :: Remove all tags path.
+ QString("rating") :: Remove rating info.
+ QString("colorlabel") :: Remove color labels info.
+ QString("picklabel") :: Remove pick labels info.
+ QString("gpslocation") :: Remove latitude, longitude, and altitude values.
+
+ QString("tags") :: DEPRECATED: for compatibility. Deprecated and replaced by "tagspath" attribute.
+ QString("angle") :: DEPRECATED: for compatibility. Deprecated and replaced by "orientation" attribute.
*/
void delAttributes( const QStringList& );
@@ -129,15 +136,12 @@ public:
*/
void cloneData( const ImageInfo& other );
- int size() const;
-
// -------------------------------------------------------------------------------------------------------
// NOTE: Deprecated Methods. Do not use it, they will be removed in the future...
//
// More universal methods based on attributes must be used instead to extend more easily data exange between
// kipi-plugins and kipi host without to break binary compatibility.
-
/**
Replaced by attributes(QString("date"))
*/
@@ -175,6 +179,11 @@ public:
*/
KDE_DEPRECATED KUrl path() const;
+ /**
+ replaced by attributes(QString("filesize"))
+ */
+ KDE_DEPRECATED int size() const;
+
private:
// Disabled operator and constructor.
diff --git a/libkipi/imageinfoshared.cpp b/libkipi/imageinfoshared.cpp
index ca507ef..8bbb98d 100644
--- a/libkipi/imageinfoshared.cpp
+++ b/libkipi/imageinfoshared.cpp
@@ -98,19 +98,6 @@ QString ImageInfoShared::name()
return QString::null;
}
-int ImageInfoShared::size()
-{
- if ( ! _url.isLocalFile() )
- {
- kFatal() << "KIPI::ImageInfoShared::size does not yet support non local files, please fix\n";
- return 0;
- }
- else
- {
- return QFileInfo( _url.toLocalFile() ).size();
- }
-}
-
// Deprecated methods --------------------------------------------------------------------
QString ImageInfoShared::description()
@@ -158,4 +145,17 @@ KUrl ImageInfoShared::path()
return _url;
}
+int ImageInfoShared::size()
+{
+ if ( ! _url.isLocalFile() )
+ {
+ kFatal() << "KIPI::ImageInfoShared::size does not yet support non local files, please fix\n";
+ return 0;
+ }
+ else
+ {
+ return QFileInfo( _url.toLocalFile() ).size();
+ }
+}
+
} // namespace KIPI
diff --git a/libkipi/imageinfoshared.h b/libkipi/imageinfoshared.h
index 23840f3..ebaf2cf 100644
--- a/libkipi/imageinfoshared.h
+++ b/libkipi/imageinfoshared.h
@@ -74,8 +74,6 @@ public:
virtual void cloneData(ImageInfoShared* const other);
- virtual int size();
-
// ---------------------------------------------------------------------------------------
// Deprecated methods. Do not use it. See Imageinfo for details.
@@ -90,6 +88,7 @@ public:
KDE_DEPRECATED virtual void setAngle(int);
KDE_DEPRECATED virtual KUrl path();
+ KDE_DEPRECATED virtual int size();
protected:
More information about the Kde-imaging
mailing list