Subversion Repositories Kolibri OS

Rev

Rev 9651 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9651 Rev 9820
Line 42... Line 42...
42
 
42
 
43
#define API       "api.openweathermap.org/data/2.5/weather?q=%s&appid=%s&units=%s&lang=%s"
43
#define API       "api.openweathermap.org/data/2.5/weather?q=%s&appid=%s&units=%s&lang=%s"
Line 44... Line 44...
44
#define IMAGE_URL "openweathermap.org/img/w/%s.png"
44
#define IMAGE_URL "openweathermap.org/img/w/%s.png"
45
  
45
  
-
 
46
Image *blend=NULL;
Line 46... Line 47...
46
Image *blend=NULL;
47
const char *config1_name = "/sys/Settings/weather.json";
47
const char *config_name = "/sys/Settings/weather.json";
48
const char *config2_name = "/kolibrios/Settings/weather.json";
Line 48... Line 49...
48
 
49
 
Line 225... Line 226...
225
    _ksys_end_draw();
226
    _ksys_end_draw();
226
}
227
}
Line 227... Line 228...
227
 
228
 
228
void get_config(char **city, char **token, char **units) // Загружаем конфиг 
229
void get_config(char **city, char **token, char **units) // Загружаем конфиг 
-
 
230
{
-
 
231
    ksys_ufile_t config_j;
-
 
232
    config_j = _ksys_load_file(config1_name);
229
{
233
    if(!config_j.size){
230
    ksys_ufile_t config_j = _ksys_load_file(config_name);
234
        config_j = _ksys_load_file(config2_name);
231
    if(!config_j.size){
235
        if(!config_j.size){
232
        notify_show("'Configuration file not found!' -E");
236
            notify_show("'Configuration file not found!' -E");
233
        exit(0);
237
            exit(0);
-
 
238
        }
Line 234... Line 239...
234
    }
239
    }
235
 
240
 
236
    json_value* value =json_parse (config_j.data, config_j.size); // Парсим конфиг
241
    json_value* value =json_parse (config_j.data, config_j.size); // Парсим конфиг
237
    for(int i=0; iu.object.length; i++){
242
    for(int i=0; iu.object.length; i++){