[gnome-maps] placeStore: Add contact type to place store



commit 22c8681a09eabc0273f8879ede841f7dae7776eb
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]