summaryrefslogtreecommitdiff
path: root/src/location/places/qplace.cpp
diff options
context:
space:
mode:
authorJean Gressmann <jean.gressmann@nokia.com>2012-02-28 09:26:53 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-29 01:11:15 +0100
commit36bb8ce507ecfe9f6fbed75882b10d9da8e5df06 (patch)
treeb0891deeda8d238b489fcf3c99f4483c28c487a6 /src/location/places/qplace.cpp
parentcb4f4d65f4d85820da7478181234b23fffbc1e55 (diff)
downloadqtlocation-36bb8ce507ecfe9f6fbed75882b10d9da8e5df06.tar.gz
isEmpty() functions for place data classes
Added isEmpty() method to QPlace, QPlaceSupplier, and QPlaceRatings. Bugfix for QTBUG-23557 Change-Id: I49d71ac2428003ef3127bbab2e46f83a8bb6ecd3 Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com>
Diffstat (limited to 'src/location/places/qplace.cpp')
-rw-r--r--src/location/places/qplace.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/location/places/qplace.cpp b/src/location/places/qplace.cpp
index b82eb685..27fa1781 100644
--- a/src/location/places/qplace.cpp
+++ b/src/location/places/qplace.cpp
@@ -603,6 +603,15 @@ QtLocation::Visibility QPlace::visibility() const
return d->visibility;
}
+/*!
+ Returns a boolean indicating whether the all the fields of the place are empty or not.
+*/
+bool QPlace::isEmpty() const
+{
+ Q_D(const QPlace);
+ return d->isEmpty();
+}
+
/*******************************************************************************
*******************************************************************************/
@@ -686,4 +695,23 @@ bool QPlacePrivate::operator== (const QPlacePrivate &other) const
);
}
+
+bool QPlacePrivate::isEmpty() const
+{
+ return (categories.isEmpty()
+ && location.isEmpty()
+ && ratings.isEmpty()
+ && supplier.isEmpty()
+ && contentCollections.isEmpty()
+ && contentCounts.isEmpty()
+ && name.isEmpty()
+ && placeId.isEmpty()
+ && attribution.isEmpty()
+ && contacts.isEmpty()
+ && extendedAttributes.isEmpty()
+ && QtLocation::UnspecifiedVisibility == visibility
+ && icon.isEmpty()
+ );
+}
+
QT_END_NAMESPACE