SHOW:
|
|
- or go back to the newest paste.
1 | --- operator-name-cbs-home-item-old.c 2012-12-31 17:46:38.000000000 +0800 | |
2 | +++ operator-name-cbs-home-item.c 2012-12-31 17:49:10.000000000 +0800 | |
3 | @@ -99,23 +99,87 @@ | |
4 | int len = 0; | |
5 | ||
6 | if (priv->status < 0) | |
7 | + { | |
8 | + if (namelog) | |
9 | + { | |
10 | + FILE *f = fopen("/home/user/opername.log","at"); | |
11 | + fprintf(f,"%sset display name null status < 0'\n",get_timestamp()); | |
12 | + fclose(f); | |
13 | + } | |
14 | display_name = NULL; | |
15 | + } | |
16 | else if (priv->custom_name && custom) | |
17 | + { | |
18 | + if (namelog) | |
19 | + { | |
20 | + FILE *f = fopen("/home/user/opername.log","at"); | |
21 | + fprintf(f,"%sset display name custom '%s'\n",get_timestamp(),priv->custom_name); | |
22 | + fclose(f); | |
23 | + } | |
24 | display_name = priv->custom_name; | |
25 | + } | |
26 | else if (priv->display_name && priv->display_name[0]) | |
27 | + { | |
28 | + if (namelog) | |
29 | + { | |
30 | + FILE *f = fopen("/home/user/opername.log","at"); | |
31 | + fprintf(f,"%sset display name display_name '%s'\n",get_timestamp(),priv->display_name); | |
32 | + fclose(f); | |
33 | + } | |
34 | display_name = priv->display_name; | |
35 | + } | |
36 | else if (priv->operator_name && priv->operator_name[0]) | |
37 | + { | |
38 | + if (namelog) | |
39 | + { | |
40 | + FILE *f = fopen("/home/user/opername.log","at"); | |
41 | + fprintf(f,"%sset display name operator_name '%s'\n",get_timestamp(),priv->operator_name); | |
42 | + fclose(f); | |
43 | + } | |
44 | display_name = priv->operator_name; | |
45 | + } | |
46 | else if (priv->service_provider_name && priv->service_provider_name[0]) | |
47 | + { | |
48 | + if (namelog) | |
49 | + { | |
50 | + FILE *f = fopen("/home/user/opername.log","at"); | |
51 | + fprintf(f,"%sset display name service_provider_name '%s'\n",get_timestamp(),priv->service_provider_name); | |
52 | + fclose(f); | |
53 | + } | |
54 | display_name = priv->service_provider_name; | |
55 | + } | |
56 | ||
57 | if (priv->status < 0 || priv->service_provider_name == display_name) | |
58 | + { | |
59 | + if (namelog) | |
60 | + { | |
61 | + FILE *f = fopen("/home/user/opername.log","at"); | |
62 | + fprintf(f,"%sset service name null spn = dn status < 0\n",get_timestamp()); | |
63 | + fclose(f); | |
64 | + } | |
65 | service_name = NULL; | |
66 | + } | |
67 | else if (priv->show_service_provider && priv->service_provider_name[0]) | |
68 | + { | |
69 | + if (namelog) | |
70 | + { | |
71 | + FILE *f = fopen("/home/user/opername.log","at"); | |
72 | + fprintf(f,"%sset service name service_provider_name '%s'\n",get_timestamp(),priv->service_provider_name); | |
73 | + fclose(f); | |
74 | + } | |
75 | service_name = priv->service_provider_name; | |
76 | + } | |
77 | ||
78 | if (display_name && service_name && !strcasecmp(display_name, service_name)) | |
79 | + { | |
80 | + if (namelog) | |
81 | + { | |
82 | + FILE *f = fopen("/home/user/opername.log","at"); | |
83 | + fprintf(f,"%sset service name null dn,sn strcmp match\n",get_timestamp()); | |
84 | + fclose(f); | |
85 | + } | |
86 | service_name = NULL; | |
87 | + } | |
88 | ||
89 | if (priv->status < 0) | |
90 | cell_name = NULL; | |
91 | @@ -268,29 +332,6 @@ | |
92 | g_free(utf8); | |
93 | g_slist_free(l); | |
94 | } | |
95 | - else if(dbus_message_is_signal(message,"Phone.Net","operator_name_change")) | |
96 | - { | |
97 | - char network_service_status; | |
98 | - char *operator_name; | |
99 | - char *unknown; | |
100 | - int operator_code; | |
101 | - int country_code; | |
102 | - dbus_message_get_args(message,NULL,DBUS_TYPE_BYTE,&network_service_status, | |
103 | - DBUS_TYPE_STRING,&operator_name, | |
104 | - DBUS_TYPE_STRING,&unknown, | |
105 | - DBUS_TYPE_UINT32,&operator_code, | |
106 | - DBUS_TYPE_UINT32,&country_code, | |
107 | - DBUS_TYPE_INVALID); | |
108 | - if (namelog) | |
109 | - { | |
110 | - FILE *f = fopen("/home/user/opername.log","at"); | |
111 | - fprintf(f,"%soperator_name_change: set display name to %s\n",get_timestamp(),operator_name); | |
112 | - fclose(f); | |
113 | - } | |
114 | - g_free(priv->display_name); | |
115 | - priv->display_name = g_strdup(operator_name); | |
116 | - update_widget(priv); | |
117 | - } | |
118 | } | |
119 | } | |
120 | return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | |
121 | @@ -452,7 +493,6 @@ | |
122 | if(conn) | |
123 | { | |
124 | dbus_bus_add_match(conn,"type='signal',interface='Phone.SMS'", NULL); | |
125 | - dbus_bus_add_match(conn,"type='signal',interface='Phone.Net'", NULL); | |
126 | dbus_connection_add_filter(conn, _dbus_message_filter_func, plugin, NULL); | |
127 | } | |
128 | } | |
129 | @@ -594,7 +634,7 @@ | |
130 | if (!priv->operator_name || strcmp(priv->operator_name,operator)) | |
131 | { | |
132 | g_free(priv->operator_name); | |
133 | - priv->operator_name = g_strdup(state->operator_name); | |
134 | + priv->operator_name = g_strdup(operator); | |
135 | if (namelog) | |
136 | { | |
137 | FILE *f = fopen("/home/user/opername.log","at"); | |
138 | - | @@ -639,12 +679,20 @@ |
138 | + | @@ -639,12 +679,15 @@ |
139 | } | |
140 | if (!priv->service_provider_name_type & 1) | |
141 | { | |
142 | + g_free(priv->operator_name); | |
143 | + priv->operator_name = g_strdup(priv->service_provider_name); | |
144 | if (namelog) | |
145 | { | |
146 | FILE *f = fopen("/home/user/opername.log","at"); | |
147 | fprintf(f,"%sservice provider name type 1\n",get_timestamp()); | |
148 | + fprintf(f,"%spriv->operator_name changed to %s\n",get_timestamp(),priv->operator_name); | |
149 | fclose(f); | |
150 | - | + if (namelog) |
150 | + | |
151 | - | + { |
151 | + | |
152 | - | + FILE *f = fopen("/home/user/opername.log","at"); |
152 | + | |
153 | { |