public
Description: A Clutter-based Twitter client
Homepage: http://live.gnome.org/Tweet
Clone URL: git://github.com/ebassi/tweet.git
Search Repo:
Rename TwitterTimeline.get_status()

The get_status() method has been renamed to get_id(), preserving
the semantics.

A new method, get_pos(), will return the TwitterStatus at the
given index inside the TwitterTimeline.

This is needed to lazily iterate over the Timeline inside an idle
source, for instance.
Emmanuele Bassi (author)
Thu Apr 10 13:26:58 -0700 2008
commit  7f11a816d3300f6b690bc75537f23054299ba5ad
tree    c836460cb55a73e69d2b17f61d011dd14c6a8e3d
parent  2a6996e073f19fda2784609a079db10c84149971
...
189
190
191
192
193
 
 
194
195
196
197
198
199
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
201
202
...
189
190
191
 
 
192
193
194
195
 
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
0
@@ -189,14 +189,31 @@
0
 }
0
 
0
 TwitterStatus *
0
-twitter_timeline_get_status (TwitterTimeline *timeline,
0
- guint id)
0
+twitter_timeline_get_id (TwitterTimeline *timeline,
0
+ guint id)
0
 {
0
   g_return_val_if_fail (TWITTER_IS_TIMELINE (timeline), NULL);
0
- g_return_val_if_fail (index_ < twitter_timeline_get_count (timeline), NULL);
0
 
0
   return g_hash_table_lookup (timeline->priv->status_by_id,
0
                               GUINT_TO_POINTER (id));
0
+}
0
+
0
+TwitterStatus *
0
+twitter_timeline_get_pos (TwitterTimeline *timeline,
0
+ gint index_)
0
+{
0
+ g_return_val_if_fail (TWITTER_IS_TIMELINE (timeline), NULL);
0
+ g_return_val_if_fail (ABS (index_) < twitter_timeline_get_count (timeline), NULL);
0
+
0
+ if (index_ >= 0)
0
+ return g_list_nth_data (timeline->priv->status_list, index_);
0
+ else
0
+ {
0
+ guint roll = g_list_length (timeline->priv->status_list);
0
+
0
+ roll += index_;
0
+ return g_list_nth_data (timeline->priv->status_list, roll);
0
+ }
0
 }
0
 
0
 GList *
...
38
39
40
41
 
42
 
 
43
44
45
...
38
39
40
 
41
42
43
44
45
46
47
0
@@ -38,8 +38,10 @@
0
                                                   const gchar *buffer);
0
 
0
 guint twitter_timeline_get_count (TwitterTimeline *timeline);
0
-TwitterStatus * twitter_timeline_get_status (TwitterTimeline *timeline,
0
+TwitterStatus * twitter_timeline_get_id (TwitterTimeline *timeline,
0
                                                   guint id);
0
+TwitterStatus * twitter_timeline_get_pos (TwitterTimeline *timeline,
0
+ gint index_);
0
 GList * twitter_timeline_get_all (TwitterTimeline *timeline);
0
 
0
 G_END_DECLS

Comments

    No one has commented yet.