UbuntuBudgie / budgie-extras

Additional Budgie Desktop enhancements for user experience
https://ubuntubudgie.org
GNU General Public License v3.0
175 stars 34 forks source link

Code Cleanup #137

Open fossfreedom opened 5 years ago

fossfreedom commented 5 years ago

zero hurry on this - at a suitable opportunity lets have a go cleaning up the compiler warnings. Should make things more robust.

Run against package v0.7.1-2

[3/31] valac -C --debug --pkg libpeas-gtk-1.0 --pkg gdk-3.0 --pkg gio-2.0 --pkg json-glib-1.0 --pkg budgie-1.0 --pkg gtk+-3.0 --color=always --directory budgie-hotcorners/src/cd12c00@@hotcorners@sha --basedir ../budgie-hotcorners/src --library hotcorners --header budgie-hotcorners/src/hotcorners.h --vapi ../hotcorners.vapi --pkg=config --vapidir=/build/budgie-extras-0.7.1/budgie-hotcorners/vapi --target-glib=2.38 ../budgie-hotcorners/src/HotCornersApplet.vala
../budgie-hotcorners/src/HotCornersApplet.vala:446.13-446.43: warning: unhandled error `GLib.Error'
            parser.load_from_data (command);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-hotcorners/src/HotCornersApplet.vala:472.13-472.43: warning: unhandled error `GLib.Error'
            parser.load_from_data (command);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-hotcorners/src/HotCornersApplet.vala:320.13-320.53: warning: unhandled error `GLib.SpawnError'
            Process.spawn_command_line_async(command);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-hotcorners/src/HotCornersApplet.vala:224.13-224.49: warning: unhandled error `GLib.Error'
            css_provider.load_from_data(css_data);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation succeeded - 4 warning(s)

[11/31] valac -C --debug --pkg libpeas-gtk-1.0 --pkg json-glib-1.0 --pkg libpeas-gtk-1.0 --pkg libsoup-2.4 --pkg gee-0.8 --pkg budgie-1.0 --pkg gtk+-3.0 --color=always --directory budgie-weathershow/src/weathershow/60c3394@@weathershow@sha --basedir ../budgie-weathershow/src/weathershow --library weathershow --header budgie-weathershow/src/weathershow/weathershow.h --vapi ../weathershow.vapi --pkg=config --vapidir=/build/budgie-extras-0.7.1/budgie-weathershow/vapi --target-glib=2.38 ../budgie-weathershow/src/weathershow/WeatherShow.vala
../budgie-weathershow/src/weathershow/WeatherShow.vala:41.13-41.29: warning: unhandled error `GLib.Error'
            datasrc.delete ();
            ^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:43.27-43.63: warning: unhandled error `GLib.Error'
        var file_stream = datasrc.create (FileCreateFlags.NONE);
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:45.9-45.37: warning: unhandled error `GLib.IOError'
        data_stream.put_string (data);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:391.31-391.67: warning: unhandled error `GLib.Error'
            var file_stream = logfile.create (FileCreateFlags.NONE);
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:397.9-397.62: warning: unhandled error `GLib.FileError'
        FileUtils.get_contents(loglocation, out file_contents);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:413.13-413.29: warning: unhandled error `GLib.Error'
            logfile.delete ();
            ^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:415.27-415.63: warning: unhandled error `GLib.Error'
        var file_stream = logfile.create (FileCreateFlags.NONE);
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:417.9-417.39: warning: unhandled error `GLib.IOError'
        data_stream.put_string (newlog);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:488.13-488.39: warning: unhandled error `GLib.Error'
            parser.load_from_data(data);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:646.13-646.40: warning: unhandled error `GLib.Error'
            parser.load_from_data (data);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:349.21-349.37: warning: unhandled error `GLib.Error'
                    datasrc.delete ();
                    ^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:351.35-351.71: warning: unhandled error `GLib.Error'
                var file_stream = datasrc.create (FileCreateFlags.NONE);
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:353.17-353.55: warning: unhandled error `GLib.IOError'
                data_stream.put_string (result_current);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:1043.13-1043.50: warning: unhandled error `GLib.Error'
            css_provider.load_from_data(css_data2);
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:1375.36-1377.21: warning: unhandled error `GLib.Error'
../budgie-weathershow/src/weathershow/WeatherShow.vala:1378.42-1380.21: warning: unhandled error `GLib.Error'
../budgie-weathershow/src/weathershow/WeatherShow.vala:1340.21-1340.38: warning: Access to static member `GLib.Thread.exit' with an instance reference
                    update_thread.exit(true);
                    ^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:1322.29-1322.80: warning: unhandled error `GLib.Error'
            update_thread = new Thread<bool>.try ("oldtimer", run_periodiccheck);
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/weathershow/WeatherShow.vala:391.17-391.67: warning: local variable `file_stream' declared but never used
            var file_stream = logfile.create (FileCreateFlags.NONE);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation succeeded - 19 warning(s)

[17/31] valac -C --debug --pkg gtk+-3.0 --color=always --directory budgie-weathershow/src/desktop_weather/4cd174a@@desktop_weather@exe --basedir ../budgie-weathershow/src/desktop_weather --pkg=config --vapidir=/build/budgie-extras-0.7.1/budgie-weathershow/vapi --target-glib=2.38 ../budgie-weathershow/src/desktop_weather/desktop_weather.vala
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:275.34-277.17: warning: unhandled error `GLib.Error'
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:278.34-280.17: warning: unhandled error `GLib.Error'
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:281.34-283.17: warning: unhandled error `GLib.Error'
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:156.5-156.38: warning: DesktopWeather.get_settings hides inherited method `Gtk.Widget.get_settings'. Use the `new' keyword if hiding was intentional
    private GLib.Settings get_settings(string path) {
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:224.9-224.45: warning: unhandled error `GLib.Error'
        css_provider.load_from_data(css_data);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:115.9-115.45: warning: unhandled error `GLib.Error'
        css_provider.load_from_data(css_data);
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../budgie-weathershow/src/desktop_weather/desktop_weather.vala:126.19-126.62: warning: unhandled error `GLib.Error'
        monitor = datasrc.monitor(FileMonitorFlags.NONE, null);
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation succeeded - 7 warning(s)

[29/31] valac -C --debug --pkg gee-0.8 --pkg libpeas-gtk-1.0 --pkg budgie-1.0 --pkg gtk+-3.0 --color=always --directory budgie-recentlyused/src/5f5f161@@budgie-recentlyused@sha --basedir ../budgie-recentlyused/src --library budgie-recentlyused --header budgie-recentlyused/src/budgie-recentlyused.h --vapi ../budgie-recentlyused.vapi --pkg=config --vapidir=/build/budgie-extras-0.7.1/budgie-recentlyused/vapi --target-glib=2.38 ../budgie-recentlyused/src/budgie-recentlyused.vala
../budgie-recentlyused/src/budgie-recentlyused.vala:132.44-132.59: warning: unhandled error `GLib.Error'
            var dis = new DataInputStream (infofile.read ());
                                           ^^^^^^^^^^^^^^^^
../budgie-recentlyused/src/budgie-recentlyused.vala:136.28-136.47: warning: unhandled error `GLib.IOError'
            while ((line = dis.read_line (null)) != null) {
                           ^^^^^^^^^^^^^^^^^^^^
../budgie-recentlyused/src/budgie-recentlyused.vala:112.23-112.68: warning: unhandled error `GLib.Error'
            monitor = infofile.monitor (FileMonitorFlags.NONE, null);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Compilation succeeded - 3 warning(s)
Jacob-Vlijm commented 5 years ago

Yeah, most of them are unhandled errors that have zero chance to occur, a few "if you mean to do x, then..", but I don't mean to do x. Anyway, should be cleaned up.