Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index b88e13169e8993db2ba2ebb48bd1090cbf355c3f..390aa5f5d084bc28669299ac871a05e81a94cba5 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -446,17 +446,22 @@ bool CreateOrUpdateShortcutLink(const wchar_t *source, |
HRESULT result = i_persist_file->Save(destination, TRUE); |
- // If we successfully updated the icon, notify the shell that we have done so. |
- if (!create && SUCCEEDED(result)) { |
- // Release the interfaces in case the SHChangeNotify call below depends on |
- // the operations above being fully completed. |
- i_persist_file.Release(); |
- i_shell_link.Release(); |
- |
- SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
+ // Release the interfaces in case the SHChangeNotify call below depends on |
+ // the operations above being fully completed. |
+ i_persist_file.Release(); |
+ i_shell_link.Release(); |
+ |
+ // If we successfully created/updated the icon, notify the shell that we have |
+ // done so. |
+ const bool succeeded = SUCCEEDED(result); |
+ if (succeeded) { |
+ if (create) |
+ SHChangeNotify(SHCNE_CREATE, SHCNF_PATH, destination, NULL); |
+ else |
+ SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
Sigurður Ásgeirsson
2012/09/10 18:52:32
Is it not sufficient here to so SHCNE_UPDATEITEM w
|
} |
- return SUCCEEDED(result); |
+ return succeeded; |
} |
bool TaskbarPinShortcutLink(const wchar_t* shortcut) { |