diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -49,7 +49,7 @@ struct Impl_App { | |||
49 | iWindow * window; | 49 | iWindow * window; |
50 | iSortedArray tickers; | 50 | iSortedArray tickers; |
51 | iBool pendingRefresh; | 51 | iBool pendingRefresh; |
52 | iHistory history; | 52 | iHistory * history; |
53 | /* Preferences: */ | 53 | /* Preferences: */ |
54 | iBool retainWindowSize; | 54 | iBool retainWindowSize; |
55 | float uiScale; | 55 | float uiScale; |
@@ -146,9 +146,9 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
146 | d->window = NULL; | 146 | d->window = NULL; |
147 | d->retainWindowSize = iTrue; | 147 | d->retainWindowSize = iTrue; |
148 | d->pendingRefresh = iFalse; | 148 | d->pendingRefresh = iFalse; |
149 | init_History(&d->history); | 149 | d->history = new_History(); |
150 | loadPrefs_App_(d); | 150 | loadPrefs_App_(d); |
151 | load_History(&d->history, historyFileName_()); | 151 | load_History(d->history, historyFileName_()); |
152 | #if defined (iHaveLoadEmbed) | 152 | #if defined (iHaveLoadEmbed) |
153 | /* Load the resources from a file. */ { | 153 | /* Load the resources from a file. */ { |
154 | if (!load_Embed( | 154 | if (!load_Embed( |
@@ -166,8 +166,8 @@ static void init_App_(iApp *d, int argc, char **argv) { | |||
166 | 166 | ||
167 | static void deinit_App(iApp *d) { | 167 | static void deinit_App(iApp *d) { |
168 | savePrefs_App_(d); | 168 | savePrefs_App_(d); |
169 | save_History(&d->history, historyFileName_()); | 169 | save_History(d->history, historyFileName_()); |
170 | deinit_History(&d->history); | 170 | delete_History(d->history); |
171 | deinit_SortedArray(&d->tickers); | 171 | deinit_SortedArray(&d->tickers); |
172 | delete_Window(d->window); | 172 | delete_Window(d->window); |
173 | d->window = NULL; | 173 | d->window = NULL; |
@@ -328,16 +328,16 @@ iBool handleCommand_App(const char *cmd) { | |||
328 | if (!argLabel_Command(cmd, "history")) { | 328 | if (!argLabel_Command(cmd, "history")) { |
329 | if (argLabel_Command(cmd, "redirect")) { | 329 | if (argLabel_Command(cmd, "redirect")) { |
330 | /* Update in the history. */ | 330 | /* Update in the history. */ |
331 | iHistoryItem *item = item_History(&d->history); | 331 | iHistoryItem *item = item_History(d->history); |
332 | if (item) { | 332 | if (item) { |
333 | set_String(&item->url, url); | 333 | set_String(&item->url, url); |
334 | } | 334 | } |
335 | } | 335 | } |
336 | else { | 336 | else { |
337 | addUrl_History(&d->history, url); | 337 | addUrl_History(d->history, url); |
338 | } | 338 | } |
339 | } | 339 | } |
340 | print_History(&d->history); | 340 | print_History(d->history); |
341 | setUrl_DocumentWidget(findChild_Widget(root, "document"), url); | 341 | setUrl_DocumentWidget(findChild_Widget(root, "document"), url); |
342 | } | 342 | } |
343 | else if (equal_Command(cmd, "document.request.cancelled")) { | 343 | else if (equal_Command(cmd, "document.request.cancelled")) { |
@@ -379,11 +379,11 @@ iBool handleCommand_App(const char *cmd) { | |||
379 | return iFalse; | 379 | return iFalse; |
380 | } | 380 | } |
381 | else if (equal_Command(cmd, "navigate.back")) { | 381 | else if (equal_Command(cmd, "navigate.back")) { |
382 | goBack_History(&d->history); | 382 | goBack_History(d->history); |
383 | return iTrue; | 383 | return iTrue; |
384 | } | 384 | } |
385 | else if (equal_Command(cmd, "navigate.forward")) { | 385 | else if (equal_Command(cmd, "navigate.forward")) { |
386 | goForward_History(&d->history); | 386 | goForward_History(d->history); |
387 | return iTrue; | 387 | return iTrue; |
388 | } | 388 | } |
389 | else if (equal_Command(cmd, "navigate.home")) { | 389 | else if (equal_Command(cmd, "navigate.home")) { |