From b8798723176fc2160941646c3b04068533e55e4d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Fri, 3 Mar 2017 15:24:32 -0800 Subject: [PATCH] Always set properties in update calls --- atom/browser/ui/cocoa/atom_touch_bar.mm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/atom/browser/ui/cocoa/atom_touch_bar.mm b/atom/browser/ui/cocoa/atom_touch_bar.mm index 0ce674bcb9..0b47d23fa5 100644 --- a/atom/browser/ui/cocoa/atom_touch_bar.mm +++ b/atom/browser/ui/cocoa/atom_touch_bar.mm @@ -222,9 +222,8 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide } std::string label; - if (settings.Get("label", &label)) { - button.title = base::SysUTF8ToNSString(label); - } + settings.Get("label", &label); + button.title = base::SysUTF8ToNSString(label); gfx::Image image; if (settings.Get("icon", &image)) { @@ -341,18 +340,17 @@ static NSTouchBarItemIdentifier SliderIdentifier = @"com.electron.touchbar.slide - (void)updatePopover:(NSPopoverTouchBarItem*)item withSettings:(const mate::PersistentDictionary&)settings { std::string label; - if (settings.Get("label", &label)) { - item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label); - } + settings.Get("label", &label); + item.collapsedRepresentationLabel = base::SysUTF8ToNSString(label); + gfx::Image image; if (settings.Get("icon", &image)) { item.collapsedRepresentationImage = image.AsNSImage(); } bool showCloseButton = true; - if (settings.Get("showCloseButton", &showCloseButton)) { - item.showsCloseButton = showCloseButton; - } + settings.Get("showCloseButton", &showCloseButton); + item.showsCloseButton = showCloseButton; mate::PersistentDictionary child; std::vector items;