[gnome-maps/wip/contacts: 79/81] placeStore: Add contact type to place store
- From: Jonas Danielsson <jonasdn src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/contacts: 79/81] placeStore: Add contact type to place store
- Date: Sat, 31 Jan 2015 17:01:58 +0000 (UTC)
commit 08e4f9bdc154f136a7e9ce120ca275f10f8c2c14
Author: Jonas Danielsson <jonas threetimestwo org>
Date: Fri Jan 30 22:59:09 2015 +0100
placeStore: Add contact type to place store
https://bugzilla.gnome.org/show_bug.cgi?id=736803
src/placeStore.js | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/placeStore.js b/src/placeStore.js
index 8493ea5..f3be0bf 100644
--- a/src/placeStore.js
+++ b/src/placeStore.js
@@ -38,7 +38,8 @@ const _STALE_THRESHOLD = 7; // mark the osm information as stale after a week
const PlaceType = {
ANY: -1,
RECENT: 0,
- FAVORITE: 1
+ FAVORITE: 1,
+ CONTACT: 2
};
const Columns = {
@@ -75,6 +76,14 @@ const PlaceStore = new Lang.Class({
this._store();
},
+ _addContact: function(place) {
+ if (this.exists(place, PlaceType.CONTACT)) {
+ return;
+ }
+
+ this._addPlace(place, PlaceType.CONTACT);
+ },
+
_addFavorite: function(place) {
if (place instanceof ContactPlace.ContactPlace)
return;
@@ -152,6 +161,8 @@ const PlaceStore = new Lang.Class({
this._addFavorite(place, type);
else if (type === PlaceType.RECENT)
this._addRecent(place, type);
+ else if (type === PlaceType.CONTACT)
+ this._addContact(place, type);
},
removePlace: function(place, placeType) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]