comparison pidgin/gtkstatusbox.c @ 26726:18543445e929

Reduce code duplication.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 23 Apr 2009 05:30:36 +0000
parents 0011cd06990a
children 5987aeb4b0a3
comparison
equal deleted inserted replaced
26725:0011cd06990a 26726:18543445e929
2143 if (saved) { 2143 if (saved) {
2144 prim = purple_savedstatus_get_type(saved); 2144 prim = purple_savedstatus_get_type(saved);
2145 } 2145 }
2146 } 2146 }
2147 2147
2148 switch (prim) { 2148 stock = pidgin_stock_id_from_status_primitive(prim);
2149 case PURPLE_STATUS_UNSET:
2150 stock = NULL;
2151 break;
2152 case PURPLE_STATUS_UNAVAILABLE:
2153 stock = PIDGIN_STOCK_STATUS_BUSY;
2154 break;
2155 case PURPLE_STATUS_AWAY:
2156 stock = PIDGIN_STOCK_STATUS_AWAY;
2157 break;
2158 case PURPLE_STATUS_EXTENDED_AWAY:
2159 stock = PIDGIN_STOCK_STATUS_XA;
2160 break;
2161 case PURPLE_STATUS_INVISIBLE:
2162 stock = PIDGIN_STOCK_STATUS_INVISIBLE;
2163 break;
2164 case PURPLE_STATUS_OFFLINE:
2165 stock = PIDGIN_STOCK_STATUS_OFFLINE;
2166 break;
2167 default:
2168 stock = PIDGIN_STOCK_STATUS_AVAILABLE;
2169 break;
2170 }
2171 } 2149 }
2172 2150
2173 gtk_list_store_append(status_box->dropdown_store, &iter); 2151 gtk_list_store_append(status_box->dropdown_store, &iter);
2174 gtk_list_store_set(status_box->dropdown_store, &iter, 2152 gtk_list_store_set(status_box->dropdown_store, &iter,
2175 TYPE_COLUMN, type, 2153 TYPE_COLUMN, type,