ui/common/properties.c

changeset 146
dd0ae1c62a72
parent 140
c03c338a7dcf
child 157
0b33b9396851
equal deleted inserted replaced
145:853685152c1d 146:dd0ae1c62a72
181 } 181 }
182 } 182 }
183 183
184 184
185 185
186 static char* uic_concat_path(char *base, char *p, char *ext) { 186 static char* uic_concat_path(const char *base, const char *p, const char *ext) {
187 size_t baselen = strlen(base); 187 size_t baselen = strlen(base);
188 188
189 UcxBuffer *buf = ucx_buffer_new(NULL, 32, UCX_BUFFER_AUTOEXTEND); 189 UcxBuffer *buf = ucx_buffer_new(NULL, 32, UCX_BUFFER_AUTOEXTEND);
190 if(baselen > 0) { 190 if(baselen > 0) {
191 ucx_buffer_write(base, 1, baselen, buf); 191 ucx_buffer_write(base, 1, baselen, buf);
211 211
212 void ui_pixmaps_dir(char *path) { 212 void ui_pixmaps_dir(char *path) {
213 pixmaps_dir = path; 213 pixmaps_dir = path;
214 } 214 }
215 215
216 char* uic_get_image_path(char *imgfilename) { 216 char* uic_get_image_path(const char *imgfilename) {
217 if(pixmaps_dir) { 217 if(pixmaps_dir) {
218 return uic_concat_path(pixmaps_dir, imgfilename, NULL); 218 return uic_concat_path(pixmaps_dir, imgfilename, NULL);
219 } else { 219 } else {
220 return NULL; 220 return NULL;
221 } 221 }
260 free(path); 260 free(path);
261 } 261 }
262 262
263 #endif 263 #endif
264 264
265 int uic_load_language_file(char *path) { 265 int uic_load_language_file(const char *path) {
266 UcxMap *lang = ucx_map_new(256); 266 UcxMap *lang = ucx_map_new(256);
267 267
268 FILE *file = fopen(path, "r"); 268 FILE *file = fopen(path, "r");
269 if(!file) { 269 if(!file) {
270 return 1; 270 return 1;

mercurial