Mercurial > mplayer.hg
annotate gui/cfg.c @ 33179:218edd8fc782
Cosmetic: Format to MPlayer coding style.
Additionally: remove needless includes, group and sort includes, group
and sort variables, rename gtkAOFakeSurround declaration gtkAOSurround,
add #ifdefs to variable declarations, group statements by adding or
removing new lines to ease reading, move assignments outside conditions,
add parentheses, avoid mixing declaration and code, revise comments and
add new ones.
author | ib |
---|---|
date | Fri, 15 Apr 2011 14:30:58 +0000 |
parents | 6e22bcc85ac5 |
children | 422e5d306d44 |
rev | line source |
---|---|
26458 | 1 /* |
2 * This file is part of MPlayer. | |
3 * | |
4 * MPlayer is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
9 * MPlayer is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License along | |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 */ | |
23077 | 18 |
19 #include <stdlib.h> | |
20 #include <stdio.h> | |
21 #include <string.h> | |
22 | |
33179 | 23 #include "cfg.h" |
24 #include "interface.h" | |
25 | |
23077 | 26 #include "config.h" |
27 #include "help_mp.h" | |
30653
3d23e24c5c60
Declare externally used variables from vd.c as extern in vd.h.
diego
parents:
30633
diff
changeset
|
28 #include "libmpcodecs/vd.h" |
23077 | 29 #include "libvo/video_out.h" |
31385
f2aebe1309b2
Declare stop_xscreensaver extern in x11_common.h instead of all over the code.
diego
parents:
30901
diff
changeset
|
30 #include "libvo/x11_common.h" |
33179 | 31 #include "m_config.h" |
32 #include "m_option.h" | |
33 #include "mixer.h" | |
34 #include "mp_msg.h" | |
35 #include "mpcommon.h" | |
36 #include "mplayer.h" | |
37 #include "parser-cfg.h" | |
38 #include "path.h" | |
32981 | 39 #include "sub/font_load.h" |
33179 | 40 #include "sub/sub.h" |
23077 | 41 |
33179 | 42 int gtkEnableAudioEqualizer = 0; |
23077 | 43 |
33179 | 44 int gtkVfPP = 0; |
45 int gtkVfLAVC = 0; | |
23077 | 46 |
33179 | 47 int gtkAONorm = 0; |
48 int gtkAOSurround = 0; | |
49 int gtkAOExtraStereo = 0; | |
50 float gtkAOExtraStereoMul = 1.0; | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
51 #ifdef CONFIG_OSS_AUDIO |
33179 | 52 char *gtkAOOSSMixer; |
53 char *gtkAOOSSMixerChannel; | |
54 char *gtkAOOSSDevice; | |
23077 | 55 #endif |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
56 #ifdef CONFIG_ALSA |
33179 | 57 char *gtkAOALSAMixer; |
58 char *gtkAOALSAMixerChannel; | |
59 char *gtkAOALSADevice; | |
23077 | 60 #endif |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
61 #ifdef CONFIG_SDL |
33179 | 62 char *gtkAOSDLDriver; |
23077 | 63 #endif |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
64 #ifdef CONFIG_ESD |
33179 | 65 char *gtkAOESDDevice; |
23077 | 66 #endif |
67 | |
33179 | 68 int gtkCacheOn = 0; |
69 int gtkCacheSize = 2048; | |
23077 | 70 |
33179 | 71 int gtkAutoSyncOn = 0; |
72 int gtkAutoSync = 0; | |
23077 | 73 |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
74 #ifdef CONFIG_DXR3 |
33179 | 75 char *gtkDXR3Device; |
23077 | 76 #endif |
77 | |
33179 | 78 int gtkSubDumpMPSub = 0; |
79 int gtkSubDumpSrt = 0; | |
23077 | 80 |
33179 | 81 int gtkLoadFullscreen = 0; |
82 int gtkShowVideoWindow = 1; | |
83 int gtkEnablePlayBar = 1; | |
23077 | 84 |
33179 | 85 int gui_save_pos = 1; |
86 int gui_main_pos_x = -2; | |
87 int gui_main_pos_y = -2; | |
88 int gui_sub_pos_x = -1; | |
89 int gui_sub_pos_y = -1; | |
23077 | 90 |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
91 #ifdef CONFIG_ASS |
23077 | 92 gtkASS_t gtkASS; |
93 #endif | |
33179 | 94 |
95 static m_config_t *gui_conf; | |
23077 | 96 |
33179 | 97 // NOTE TO MYSELF: Do we really need all/any non-gtkOptions, i.e. override mplayer's ones? |
98 static const m_option_t gui_opts[] = { | |
99 { "enable_audio_equ", >kEnableAudioEqualizer, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28051
diff
changeset
|
100 |
33179 | 101 { "vo_driver", &video_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, |
102 { "vo_panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 1.0, NULL }, | |
103 { "vo_doublebuffering", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
104 { "vo_direct_render", &vo_directrendering, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
105 #ifdef CONFIG_DXR3 |
33179 | 106 { "vo_dxr3_device", >kDXR3Device, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
23077 | 107 #endif |
108 | |
33179 | 109 { "v_framedrop", &frame_dropping, CONF_TYPE_INT, CONF_RANGE, 0, 2, NULL }, |
110 { "v_flip", &flip, CONF_TYPE_INT, CONF_RANGE, -1, 1, NULL }, | |
111 { "v_ni", &force_ni, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
112 { "v_idx", &index_mode, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL }, | |
113 { "v_vfm", &video_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, | |
114 { "a_afm", &audio_fm_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, | |
23077 | 115 |
33179 | 116 { "vf_pp", >kVfPP, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
117 { "vf_autoq", &auto_quality, CONF_TYPE_INT, CONF_RANGE, 0, 100, NULL }, | |
118 { "vf_lavc", >kVfLAVC, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
23077 | 119 |
33179 | 120 { "ao_driver", &audio_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL }, |
121 { "ao_volnorm", >kAONorm, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
122 { "softvol", &soft_vol, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
123 { "ao_surround", >kAOSurround, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
124 { "ao_extra_stereo", >kAOExtraStereo, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
125 { "ao_extra_stereo_coefficient", >kAOExtraStereoMul, CONF_TYPE_FLOAT, CONF_RANGE, -10, 10, NULL }, | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
126 #ifdef CONFIG_OSS_AUDIO |
33179 | 127 { "ao_oss_mixer", >kAOOSSMixer, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
128 { "ao_oss_mixer_channel", >kAOOSSMixerChannel, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
129 { "ao_oss_device", >kAOOSSDevice, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
23077 | 130 #endif |
27390
9d95dc936e66
Introduce CONFIG_ALSA preprocessor directive for ALSA 0.9 and 1.x.
diego
parents:
27387
diff
changeset
|
131 #ifdef CONFIG_ALSA |
33179 | 132 { "ao_alsa_mixer", >kAOALSAMixer, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
133 { "ao_alsa_mixer_channel", >kAOALSAMixerChannel, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
134 { "ao_alsa_device", >kAOALSADevice, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
23077 | 135 #endif |
27370
14c5017f40d2
Change a bunch of video/audio-output-specific preprocessor directives from
diego
parents:
27359
diff
changeset
|
136 #ifdef CONFIG_SDL |
33179 | 137 { "ao_sdl_subdriver", >kAOSDLDriver, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
23077 | 138 #endif |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
139 #ifdef CONFIG_ESD |
33179 | 140 { "ao_esd_device", >kAOESDDevice, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
23077 | 141 #endif |
142 | |
33179 | 143 { "dvd_device", &dvd_device, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
144 { "cdrom_device", &cdrom_device, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28051
diff
changeset
|
145 |
33179 | 146 { "osd_level", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL }, |
147 { "sub_auto_load", &sub_auto, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
148 { "sub_unicode", &sub_unicode, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
27341
e7c989f7a7c9
Start unifying names of internal preprocessor directives.
diego
parents:
26458
diff
changeset
|
149 #ifdef CONFIG_ASS |
33179 | 150 { "ass_enabled", &ass_enabled, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
151 { "ass_use_margins", &ass_use_margins, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
152 { "ass_top_margin", &ass_top_margin, CONF_TYPE_INT, CONF_RANGE, 0, 512, NULL }, | |
153 { "ass_bottom_margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 512, NULL }, | |
23077 | 154 #endif |
33179 | 155 { "sub_pos", &sub_pos, CONF_TYPE_INT, CONF_RANGE, 0, 200, NULL }, |
156 { "sub_overlap", &suboverlap_enabled, CONF_TYPE_FLAG, 0, 0, 0, NULL }, | |
27393 | 157 #ifdef CONFIG_ICONV |
33179 | 158 { "sub_cp", &sub_cp, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
23077 | 159 #endif |
33179 | 160 { "font_factor", &font_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 10.0, NULL }, |
161 { "font_name", &font_name, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
27393 | 162 #ifdef CONFIG_FREETYPE |
33179 | 163 { "font_encoding", &subtitle_font_encoding, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
164 { "font_text_scale", &text_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL }, | |
165 { "font_osd_scale", &osd_font_scale_factor, CONF_TYPE_FLOAT, CONF_RANGE, 0, 100, NULL }, | |
166 { "font_blur", &subtitle_font_radius, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL }, | |
167 { "font_outline", &subtitle_font_thickness, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL }, | |
168 { "font_autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL }, | |
23077 | 169 #endif |
170 | |
33179 | 171 { "cache", >kCacheOn, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
172 { "cache_size", >kCacheSize, CONF_TYPE_INT, CONF_RANGE, -1, 65535, NULL }, | |
23077 | 173 |
33179 | 174 { "playbar", >kEnablePlayBar, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
175 { "load_fullscreen", >kLoadFullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
176 { "show_videowin", >kShowVideoWindow, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
177 { "stopxscreensaver", &stop_xscreensaver, CONF_TYPE_FLAG, 0, 0, 1, NULL }, | |
23077 | 178 |
33179 | 179 { "autosync", >kAutoSyncOn, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
180 { "autosync_size", >kAutoSync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL }, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28051
diff
changeset
|
181 |
33179 | 182 { "gui_skin", &skinName, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
23077 | 183 |
33179 | 184 { "gui_save_pos", &gui_save_pos, CONF_TYPE_FLAG, 0, 0, 1, NULL }, |
185 { "gui_main_pos_x", &gui_main_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL }, | |
186 { "gui_main_pos_y", &gui_main_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL }, | |
187 { "gui_video_out_pos_x", &gui_sub_pos_x, CONF_TYPE_INT, 0, 0, 0, NULL }, | |
188 { "gui_video_out_pos_y", &gui_sub_pos_y, CONF_TYPE_INT, 0, 0, 0, NULL }, | |
23077 | 189 |
33179 | 190 { "equ_channel_1", >kEquChannel1, CONF_TYPE_STRING, 0, 0, 0, NULL }, |
191 { "equ_channel_2", >kEquChannel2, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
192 { "equ_channel_3", >kEquChannel3, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
193 { "equ_channel_4", >kEquChannel4, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
194 { "equ_channel_5", >kEquChannel5, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
195 { "equ_channel_6", >kEquChannel6, CONF_TYPE_STRING, 0, 0, 0, NULL }, | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28051
diff
changeset
|
196 |
33179 | 197 #define audio_equ_row(i, j) { "equ_band_" # i # j, >kEquChannels[i][j], CONF_TYPE_FLOAT, CONF_RANGE, -15.0, 15.0, NULL }, |
198 audio_equ_row(0, 0) audio_equ_row(0, 1) audio_equ_row(0, 2) audio_equ_row(0, 3) audio_equ_row(0, 4) audio_equ_row(0, 5) audio_equ_row(0, 6) audio_equ_row(0, 7) audio_equ_row(0, 8) audio_equ_row(0, 9) | |
199 audio_equ_row(1, 0) audio_equ_row(1, 1) audio_equ_row(1, 2) audio_equ_row(1, 3) audio_equ_row(1, 4) audio_equ_row(1, 5) audio_equ_row(1, 6) audio_equ_row(1, 7) audio_equ_row(1, 8) audio_equ_row(1, 9) | |
200 audio_equ_row(2, 0) audio_equ_row(2, 1) audio_equ_row(2, 2) audio_equ_row(2, 3) audio_equ_row(2, 4) audio_equ_row(2, 5) audio_equ_row(2, 6) audio_equ_row(2, 7) audio_equ_row(2, 8) audio_equ_row(2, 9) | |
201 audio_equ_row(3, 0) audio_equ_row(3, 1) audio_equ_row(3, 2) audio_equ_row(3, 3) audio_equ_row(3, 4) audio_equ_row(3, 5) audio_equ_row(3, 6) audio_equ_row(3, 7) audio_equ_row(3, 8) audio_equ_row(3, 9) | |
202 audio_equ_row(4, 0) audio_equ_row(4, 1) audio_equ_row(4, 2) audio_equ_row(4, 3) audio_equ_row(4, 4) audio_equ_row(4, 5) audio_equ_row(4, 6) audio_equ_row(4, 7) audio_equ_row(4, 8) audio_equ_row(4, 9) | |
203 audio_equ_row(5, 0) audio_equ_row(5, 1) audio_equ_row(5, 2) audio_equ_row(5, 3) audio_equ_row(5, 4) audio_equ_row(5, 5) audio_equ_row(5, 6) audio_equ_row(5, 7) audio_equ_row(5, 8) audio_equ_row(5, 9) | |
23077 | 204 #undef audio_equ_row |
205 | |
33179 | 206 { NULL, NULL, 0, 0, 0, 0, NULL } |
23077 | 207 }; |
208 | |
33179 | 209 static char *gfgets(char *str, int size, FILE *f) |
23077 | 210 { |
33179 | 211 char *s, c; |
212 | |
213 s = fgets(str, size, f); | |
214 | |
215 if (s) { | |
216 c = s[strlen(s) - 1]; | |
217 | |
218 if (c == '\n' || c == '\r') | |
219 s[strlen(s) - 1] = 0; | |
220 | |
221 c = s[strlen(s) - 1]; | |
222 | |
223 if (c == '\n' || c == '\r') | |
224 s[strlen(s) - 1] = 0; | |
225 } | |
226 | |
227 return s; | |
23077 | 228 } |
229 | |
33179 | 230 int cfg_read(void) |
23077 | 231 { |
33179 | 232 char *cfg; |
233 FILE *f; | |
234 | |
235 // configuration | |
236 | |
237 cfg = get_path("gui.conf"); | |
238 | |
239 mp_msg(MSGT_GPLAYER, MSGL_V, "[cfg] reading config file: %s\n", cfg); | |
240 | |
241 gui_conf = m_config_new(); | |
242 m_config_register_options(gui_conf, gui_opts); | |
243 | |
244 if (!disable_gui_conf && (m_config_parse_config_file(gui_conf, cfg) < 0)) { | |
245 mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_ConfigFileError); | |
246 // exit(1); | |
247 } | |
248 | |
249 free(cfg); | |
23077 | 250 |
33179 | 251 // playlist |
252 | |
253 cfg = get_path("gui.pl"); | |
254 f = fopen(cfg, "rt"); | |
255 | |
256 if (f) { | |
257 while (!feof(f)) { | |
258 char tmp[512]; | |
259 plItem *item; | |
23077 | 260 |
33179 | 261 if (gfgets(tmp, 512, f) == NULL) |
262 continue; | |
263 | |
264 item = calloc(1, sizeof(plItem)); | |
265 item->path = strdup(tmp); | |
266 gfgets(tmp, 512, f); | |
267 item->name = strdup(tmp); | |
268 gtkSet(gtkAddPlItem, 0, (void *)item); | |
269 } | |
270 | |
271 fclose(f); | |
23077 | 272 } |
33179 | 273 |
274 free(cfg); | |
275 | |
276 // URL list | |
277 | |
278 cfg = get_path("gui.url"); | |
279 f = fopen(cfg, "rt"); | |
23077 | 280 |
33179 | 281 if (f) { |
282 while (!feof(f)) { | |
283 char tmp[512]; | |
284 URLItem *item; | |
285 | |
286 if (gfgets(tmp, 512, f) == NULL) | |
287 continue; | |
288 | |
289 item = calloc(1, sizeof(URLItem)); | |
290 item->url = strdup(tmp); | |
291 gtkSet(gtkAddURLItem, 0, (void *)item); | |
292 } | |
293 | |
294 fclose(f); | |
23077 | 295 } |
33179 | 296 |
297 free(cfg); | |
298 | |
299 // directory history | |
300 | |
301 cfg = get_path("gui.history"); | |
302 f = fopen(cfg, "rt+"); | |
303 | |
304 if (f) { | |
305 int i = 0; | |
23077 | 306 |
33179 | 307 while (!feof(f)) { |
308 char tmp[512]; | |
309 | |
310 if (gfgets(tmp, 512, f) == NULL) | |
311 continue; | |
312 | |
313 fsHistory[i++] = gstrdup(tmp); | |
314 } | |
315 | |
316 fclose(f); | |
23077 | 317 } |
318 | |
33179 | 319 free(cfg); |
320 | |
321 return 0; | |
23077 | 322 } |
323 | |
33179 | 324 int cfg_write(void) |
23077 | 325 { |
33179 | 326 char *cfg; |
327 FILE *f; | |
328 int i; | |
329 | |
330 // configuration | |
331 | |
332 cfg = get_path("gui.conf"); | |
333 f = fopen(cfg, "wt+"); | |
334 | |
335 if (f) { | |
336 for (i = 0; gui_opts[i].name; i++) { | |
337 char *v = m_option_print(&gui_opts[i], gui_opts[i].p); | |
338 | |
339 if (v == (char *)-1) { | |
340 mp_msg(MSGT_GPLAYER, MSGL_WARN, MSGTR_UnableToSaveOption, gui_opts[i].name); | |
341 v = NULL; | |
342 } | |
23077 | 343 |
33179 | 344 if (v) { |
345 fprintf(f, "%s = \"%s\"\n", gui_opts[i].name, v); | |
346 free(v); | |
347 } | |
348 } | |
349 | |
350 fclose(f); | |
23077 | 351 } |
33179 | 352 |
353 free(cfg); | |
354 | |
355 // playlist | |
356 | |
357 cfg = get_path("gui.pl"); | |
358 f = fopen(cfg, "wt+"); | |
359 | |
360 if (f) { | |
361 plCurrent = plList; | |
362 | |
363 while (plCurrent) { | |
364 if (plCurrent->path && plCurrent->name) { | |
365 fprintf(f, "%s\n", plCurrent->path); | |
366 fprintf(f, "%s\n", plCurrent->name); | |
367 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
28051
diff
changeset
|
368 |
33179 | 369 plCurrent = plCurrent->next; |
370 } | |
371 | |
372 fclose(f); | |
23077 | 373 } |
33179 | 374 |
375 free(cfg); | |
376 | |
377 // URL list | |
378 | |
379 cfg = get_path("gui.url"); | |
380 f = fopen(cfg, "wt+"); | |
381 | |
382 if (f) { | |
383 while (URLList) { | |
384 if (URLList->url) | |
385 fprintf(f, "%s\n", URLList->url); | |
386 | |
387 URLList = URLList->next; | |
388 } | |
23077 | 389 |
33179 | 390 fclose(f); |
23077 | 391 } |
33179 | 392 |
393 free(cfg); | |
394 | |
395 // directory history | |
396 | |
397 cfg = get_path("gui.history"); | |
398 f = fopen(cfg, "wt+"); | |
399 | |
400 if (f) { | |
401 int i = 0; | |
23077 | 402 |
33179 | 403 // while (fsHistory[i] != NULL) |
404 for (i = 0; i < 5; i++) | |
405 if (fsHistory[i]) | |
406 fprintf(f, "%s\n", fsHistory[i]); | |
23077 | 407 |
33179 | 408 fclose(f); |
409 } | |
410 | |
411 free(cfg); | |
412 | |
413 return 0; | |
23077 | 414 } |