Changed: site address as icon ID
This commit is contained in:
		
							parent
							
								
									3518084267
								
							
						
					
					
						commit
						2fe74fe29d
					
				@ -691,7 +691,6 @@ namespace FizzyLauncher
 | 
			
		||||
 | 
			
		||||
#endregion
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        private async void treeView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 | 
			
		||||
        {
 | 
			
		||||
            TreeNode tn = treeView1.SelectedNode;
 | 
			
		||||
@ -1072,9 +1071,9 @@ namespace FizzyLauncher
 | 
			
		||||
            Image icon = null;
 | 
			
		||||
 | 
			
		||||
            // retrieve icon from DB
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(model.SiteName))
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(model.SiteAddress))
 | 
			
		||||
            {
 | 
			
		||||
                string iconID = Crypto.GetSHA256Hash(model?.SiteName);
 | 
			
		||||
                string iconID = Crypto.GetSHA256Hash(model?.SiteAddress);
 | 
			
		||||
 | 
			
		||||
                icon = iconDatabase.FindIcon(iconID);
 | 
			
		||||
            }
 | 
			
		||||
@ -1082,7 +1081,7 @@ namespace FizzyLauncher
 | 
			
		||||
            BookmarkForm bookmarkForm = new BookmarkForm(model, icon);
 | 
			
		||||
            if (bookmarkForm.ShowDialog() == DialogResult.OK)
 | 
			
		||||
            {
 | 
			
		||||
                string iconID = Crypto.GetSHA256Hash(bookmarkForm.Model.Item?.SiteName);
 | 
			
		||||
                string iconID = Crypto.GetSHA256Hash(bookmarkForm.Model.Item?.SiteAddress);
 | 
			
		||||
                if (!string.IsNullOrWhiteSpace(iconID))
 | 
			
		||||
                {
 | 
			
		||||
                    iconDatabase.AddIcon(iconID, bookmarkForm.Model.Icon);
 | 
			
		||||
 | 
			
		||||
@ -878,9 +878,9 @@ namespace RyzStudio.Windows.Forms
 | 
			
		||||
        {
 | 
			
		||||
            if (this.IconDatabase == null) return (int)IconSet.Default;
 | 
			
		||||
            if (item == null) return (int)IconSet.Default;
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(item.SiteName)) return (int)IconSet.Default;
 | 
			
		||||
            if (string.IsNullOrWhiteSpace(item.SiteAddress)) return (int)IconSet.Default;
 | 
			
		||||
 | 
			
		||||
            string iconID = Crypto.GetSHA256Hash(item?.SiteName);
 | 
			
		||||
            string iconID = Crypto.GetSHA256Hash(item?.SiteAddress);
 | 
			
		||||
 | 
			
		||||
            Image image = this.IconDatabase.FindIcon(iconID);
 | 
			
		||||
            if (image == null)
 | 
			
		||||
@ -896,8 +896,6 @@ namespace RyzStudio.Windows.Forms
 | 
			
		||||
            ThreadControl.Add(this, this.ImageList, iconID, image);
 | 
			
		||||
 | 
			
		||||
            return this.ImageList.Images.IndexOfKey(iconID);
 | 
			
		||||
 | 
			
		||||
            //return (int)IconSet.Default;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //protected int addIcon(BookmarkItemViewModel viewModel) => addIcon(viewModel.ToModel());
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user