public
Description: A Clutter-based Twitter client
Homepage: http://live.gnome.org/Tweet
Clone URL: git://github.com/ebassi/tweet.git
Search Repo:
Add setters for the TweetConfig properties

Tweet should ask the user about his/hers credentials in case the
configuration object is empty. In order to do so, TweetConfig
should have API for setting the configuration properties, as well
as for getting them.
Emmanuele Bassi (author)
Fri Apr 18 02:19:41 -0700 2008
commit  72ff55611b6b5df82e6d7a270c279644c7ba252b
tree    1855e455d31a3390c2cb58391388966aef46a7e2
parent  71f61b98e8def37beb32779fb89c6adf6ede534b
...
58
59
60
61
 
62
63
64
65
66
67
 
68
69
70
71
72
 
73
74
75
76
...
190
191
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
194
195
196
197
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
200
201
...
58
59
60
 
61
62
63
64
65
 
 
66
67
68
69
 
 
70
71
72
73
74
...
188
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
0
@@ -58,18 +58,16 @@
0
                            const GValue *value,
0
                            GParamSpec *pspec)
0
 {
0
- TweetConfigPrivate *priv = TWEET_CONFIG (gobject)->priv;
0
+ TweetConfig *config = TWEET_CONFIG (gobject);
0
 
0
   switch (prop_id)
0
     {
0
     case PROP_USERNAME:
0
- g_free (priv->username);
0
- priv->username = g_value_dup_string (value);
0
+ tweet_config_set_username (config, g_value_get_string (value));
0
       break;
0
 
0
     case PROP_PASSWORD:
0
- g_free (priv->password);
0
- priv->password = g_value_dup_string (value);
0
+ tweet_config_set_password (config, g_value_get_string (value));
0
       break;
0
 
0
     default:
0
0
@@ -190,12 +188,46 @@
0
   return default_config;
0
 }
0
 
0
+void
0
+tweet_config_set_username (TweetConfig *config,
0
+ const gchar *username)
0
+{
0
+ TweetConfigPrivate *priv;
0
+
0
+ g_return_if_fail (TWEET_IS_CONFIG (config));
0
+ g_return_if_fail (username != NULL);
0
+
0
+ priv = config->priv;
0
+
0
+ g_free (priv->username);
0
+ priv->username = g_strdup (username);
0
+
0
+ g_object_notify (G_OBJECT (config), "username");
0
+}
0
+
0
 G_CONST_RETURN gchar *
0
 tweet_config_get_username (TweetConfig *config)
0
 {
0
   g_return_val_if_fail (TWEET_IS_CONFIG (config), NULL);
0
 
0
   return config->priv->username;
0
+}
0
+
0
+void
0
+tweet_config_set_password (TweetConfig *config,
0
+ const gchar *password)
0
+{
0
+ TweetConfigPrivate *priv;
0
+
0
+ g_return_if_fail (TWEET_IS_CONFIG (config));
0
+ g_return_if_fail (password != NULL);
0
+
0
+ priv = config->priv;
0
+
0
+ g_free (priv->password);
0
+ priv->password = g_strdup (password);
0
+
0
+ g_object_notify (G_OBJECT (config), "password");
0
 }
0
 
0
 G_CONST_RETURN gchar *
...
34
35
36
 
 
37
 
 
38
39
40
...
34
35
36
37
38
39
40
41
42
43
44
0
@@ -34,7 +34,11 @@
0
 
0
 TweetConfig * tweet_config_get_default (void);
0
 
0
+void tweet_config_set_username (TweetConfig *config,
0
+ const gchar *username);
0
 G_CONST_RETURN gchar *tweet_config_get_username (TweetConfig *config);
0
+void tweet_config_set_password (TweetConfig *config,
0
+ const gchar *password);
0
 G_CONST_RETURN gchar *tweet_config_get_password (TweetConfig *config);
0
 
0
 void tweet_config_save (TweetConfig *config);

Comments

    No one has commented yet.