~midori/midori/cmake-make-dist

« back to all changes in this revision

Viewing changes to extensions/transfers.vala

  • Committer: Tarmac
  • Author(s): Paweł Forysiuk, Christian Dywan
  • Date: 2013-11-05 18:00:59 UTC
  • mfrom: (6448.1.33 less-warnings)
  • Revision ID: tarmac-20131105180059-dypdrl07lyejesr3
Resolve compiler warnings in current trunk

Add EXTRA_WARNINGS flag to increase verbosity
Respect VALAC for the Vala compiler if defined
Sort out Vala 0.16 build issues
Make warnings fatal for bzr builds

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
                Transfer transfer;
175
175
                store.get (iter, 0, out transfer);
176
176
 
177
 
                if (Midori.Download.action_clear (transfer.download, treeview))
178
 
                    transfer.remove ();
 
177
                try {
 
178
                    if (Midori.Download.action_clear (transfer.download, treeview))
 
179
                        transfer.remove ();
 
180
                } catch (Error error) {
 
181
                    // Failure to open is the only known possibility here
 
182
                    GLib.warning (_("Failed to open download: %s"), error.message);
 
183
                }
179
184
            }
180
185
        }
181
186
 
198
203
                var menu = new Gtk.Menu ();
199
204
                var menuitem = new Gtk.ImageMenuItem.from_stock (Gtk.STOCK_OPEN, null);
200
205
                menuitem.activate.connect (() => {
201
 
                    Midori.Download.open (transfer.download, treeview);
 
206
                    try {
 
207
                        Midori.Download.open (transfer.download, treeview);
 
208
                    } catch (Error error_open) {
 
209
                        GLib.warning (_("Failed to open download: %s"), error_open.message);
 
210
                    }
202
211
                });
203
212
                menuitem.sensitive = transfer.succeeded;
204
213
                menu.append (menuitem);
205
214
                menuitem = new Gtk.ImageMenuItem.with_mnemonic (_("Open Destination _Folder"));
206
215
                menuitem.image = new Gtk.Image.from_stock (Gtk.STOCK_DIRECTORY, Gtk.IconSize.MENU);
207
216
                menuitem.activate.connect (() => {
208
 
                    var folder = GLib.File.new_for_uri (transfer.destination);
209
 
                    Sokoke.show_uri (get_screen (), folder.get_parent ().get_uri (), 0);
 
217
                    try {
 
218
                        var folder = GLib.File.new_for_uri (transfer.destination);
 
219
                        Sokoke.show_uri (get_screen (), folder.get_parent ().get_uri (), 0);
 
220
                    } catch (Error error_folder) {
 
221
                        GLib.warning (_("Failed to open download: %s"), error_folder.message);
 
222
                    }
210
223
                });
211
224
                menu.append (menuitem);
212
225
                menuitem = new Gtk.ImageMenuItem.with_mnemonic (_("Copy Link Loc_ation"));
336
349
        }
337
350
 
338
351
        void button_clicked () {
339
 
            if (Midori.Download.action_clear (transfer.download, button))
340
 
                transfer.remove ();
 
352
            try {
 
353
                if (Midori.Download.action_clear (transfer.download, button))
 
354
                    transfer.remove ();
 
355
            } catch (Error error) {
 
356
                // Failure to open is the only known possibility here
 
357
                GLib.warning (_("Failed to open download: %s"), error.message);
 
358
            }
341
359
        }
342
360
 
343
361
        void transfer_changed () {
441
459
            if (transfer.succeeded) {
442
460
                /* FIXME: The following 2 blocks ought to be done in core */
443
461
                if (transfer.action == Midori.DownloadType.OPEN) {
444
 
                    if (Midori.Download.action_clear (transfer.download, widgets.nth_data (0)))
445
 
                        transfer.remove ();
 
462
                    try {
 
463
                        if (Midori.Download.action_clear (transfer.download, widgets.nth_data (0)))
 
464
                            transfer.remove ();
 
465
                    } catch (Error error) {
 
466
                        // Failure to open is the only known possibility here
 
467
                        GLib.warning (_("Failed to open download: %s"), error.message);
 
468
                    }
446
469
                }
447
470
 
448
471
                string uri = transfer.destination;