Skip to content

Commit

Permalink
Silence some minor compile warnings (#2211)
Browse files Browse the repository at this point in the history
* Handle error

* Explicit .begin

* Resolve name clash

* Handle AppStream.IconKind.REMOTE
  • Loading branch information
jeremypw authored Sep 16, 2024
1 parent 0818c32 commit 8816fde
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/Core/Package.vala
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,10 @@ public class AppCenterCore.Package : Object {
case AppStream.IconKind.UNKNOWN:
warning ("'%s' is an unknown kind of AppStream icon", _icon.get_name ());
break;

case AppStream.IconKind.REMOTE:
warning ("'%s' is a remote AppStream icon", _icon.get_name ());
break;
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/Core/UpdateManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ public class AppCenterCore.UpdateManager : Object {
runtime_updates.update_state ();

if (AppCenter.App.settings.get_boolean ("automatic-updates")) {
yield update_all (cancellable);
try {
yield update_all (cancellable);
} catch (Error e) {} // update_all () already logs error message
//TODO Should we send a notification that automatic-updates had an error?
} else {
var application = Application.get_default ();
if (updates_number > 0) {
Expand Down Expand Up @@ -293,7 +296,7 @@ public class AppCenterCore.UpdateManager : Object {
return GLib.Source.REMOVE;
});

get_updates (cancellable);
get_updates.begin (cancellable);
}

private int compare_package_func (Object object1, Object object2) {
Expand Down
6 changes: 3 additions & 3 deletions src/Widgets/Banner.vala
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ public class AppCenter.Widgets.Banner : Gtk.Button {
public Icon icon { get; construct; }
public string brand_color { get; construct; }
public string description { get; construct; }
public string name { get; construct; }
public string app_name { get; construct; }
public string summary { get; construct; }

public Banner (string name, string summary, string description, Icon icon, string brand_color) {
Object (
brand_color: brand_color,
description: description,
icon: icon,
name: name,
app_name: name,
summary: summary
);
}
Expand All @@ -58,7 +58,7 @@ public class AppCenter.Widgets.Banner : Gtk.Button {


construct {
var name_label = new Gtk.Label (name) {
var name_label = new Gtk.Label (app_name) {
max_width_chars = 50,
use_markup = true,
wrap = true,
Expand Down

0 comments on commit 8816fde

Please sign in to comment.