Skip to content

Commit

Permalink
remove toolbar warning about missing identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
asmagill committed Apr 25, 2023
1 parent 68a46d8 commit 592aed3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions extensions/webview/libwebview_toolbar.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (instancetype)initWithIdentifier:(NSString *)identifier itemTableIndex:(int)id
_itemDefDictionary = [[NSMutableDictionary alloc] init] ;
_fnRefDictionary = [[NSMutableDictionary alloc] init] ;
_enabledDictionary = [[NSMutableDictionary alloc] init] ;

if (@available(macOS 11.0, *)) {
_toolbarStyle = NSWindowToolbarStyleAutomatic ;
}
Expand Down Expand Up @@ -148,7 +148,7 @@ - (instancetype)initWithCopy:(HSToolbar *)original andState:(lua_State *)L{
if (@available(macOS 11.0, *)) {
_toolbarStyle = original.toolbarStyle ;
}

self.allowsUserCustomization = original.allowsUserCustomization ;
self.allowsExtensionItems = original.allowsExtensionItems ;
self.autosavesConfiguration = original.autosavesConfiguration ;
Expand Down Expand Up @@ -695,9 +695,9 @@ - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString
}
toolbarItem.enabled = flag ? [self validateToolbarItem:toolbarItem] : YES ;
[self fillinNewToolbarItem:toolbarItem] ;
} else {
// may happen on a reload if toolbar autosave contains id's that were added after the toolbar was created but haven't been created yet since the reload
[LuaSkin logInfo:[NSString stringWithFormat:@"%s:toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: invoked with nonexistent identifier:%@", USERDATA_TB_TAG, identifier]] ;
// } else {
// // may happen on a reload if toolbar autosave contains id's that were added after the toolbar was created but haven't been created yet since the reload
// [LuaSkin logInfo:[NSString stringWithFormat:@"%s:toolbar:itemForItemIdentifier:willBeInsertedIntoToolbar: invoked with nonexistent identifier:%@", USERDATA_TB_TAG, identifier]] ;
}
return toolbarItem ;
}
Expand Down Expand Up @@ -962,12 +962,12 @@ static int attachToolbar(lua_State *L) {
theWindow.toolbar = newToolbar ;
newToolbar.windowUsingToolbar = theWindow ;
newToolbar.visible = YES ;

// Update the toolbar style if available:
if (@available(macOS 11.0, *)) {
theWindow.toolbarStyle = newToolbar.toolbarStyle;
}

}
lua_pushvalue(L, 1) ;
} else {
Expand Down Expand Up @@ -1351,7 +1351,7 @@ static int toolbarStyle(lua_State *L) {
LuaSkin *skin = [LuaSkin sharedWithState:L] ;
[skin checkArgs:LS_TUSERDATA, USERDATA_TB_TAG, LS_TSTRING | LS_TOPTIONAL, LS_TBREAK] ;
HSToolbar *toolbar = [skin toNSObjectAtIndex:1] ;

if (lua_gettop(L) == 2) {
if (@available(macOS 11.0, *))
{
Expand Down

0 comments on commit 592aed3

Please sign in to comment.