Skip to content

Commit

Permalink
Merge pull request #608 from shutter-project/fix_edit_button_disabled
Browse files Browse the repository at this point in the history
Fix #597: The edit button is disabled
  • Loading branch information
Photon89 authored Aug 11, 2023
2 parents 154d9a1 + 0c86d67 commit 8b0bd9d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/shutter
Original file line number Diff line number Diff line change
Expand Up @@ -4953,6 +4953,11 @@ sub STARTUP {
#get applications
my $apps = Glib::IO::AppInfo::get_recommended_for_type('image/png');

# $apps is undefined if Glib::IO::AppInfo::get_recommended_for_type fails
unless (defined $apps) {
return $model;
}

#no apps determined!
unless (scalar @$apps) {
return $model;
Expand Down Expand Up @@ -8653,6 +8658,13 @@ sub STARTUP {
# https://developer.gnome.org/gio/stable/GAppInfo.html
my $apps = Glib::IO::AppInfo::get_recommended_for_type($mime_type);

# $apps is undefined if Glib::IO::AppInfo::get_recommended_for_type fails
unless (defined $apps) {
$sm->{_menuitem_reopen}->set_sensitive(FALSE);
$sm->{_menuitem_large_reopen}->set_sensitive(FALSE);
return $menu_programs;
}

#no apps determined!
unless (scalar @$apps) {
$sm->{_menuitem_reopen}->set_sensitive(FALSE);
Expand Down

0 comments on commit 8b0bd9d

Please sign in to comment.