Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6197866d
Commit
6197866d
authored
Nov 25, 2010
by
Andrew Bogott
Committed by
Alexandre Julliard
Dec 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Include icons in .url menus.
parent
4b281b2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+31
-3
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
6197866d
...
...
@@ -2620,7 +2620,7 @@ cleanup:
static
BOOL
InvokeShellLinkerForURL
(
IUniformResourceLocatorW
*
url
,
LPCWSTR
link
,
BOOL
bWait
)
{
char
*
link_name
=
NULL
;
char
*
link_name
=
NULL
,
*
icon_name
=
NULL
;
DWORD
csidl
=
-
1
;
LPWSTR
urlPath
;
char
*
escaped_urlPath
=
NULL
;
...
...
@@ -2629,6 +2629,10 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link
BOOL
ret
=
TRUE
;
int
r
=
-
1
;
char
*
unix_link
=
NULL
;
IPropertySetStorage
*
pPropSetStg
;
IPropertyStorage
*
pPropStg
;
PROPSPEC
ps
[
2
];
PROPVARIANT
pv
[
2
];
if
(
!
link
)
{
...
...
@@ -2671,6 +2675,29 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link
goto
cleanup
;
}
ps
[
0
].
ulKind
=
PRSPEC_PROPID
;
ps
[
0
].
propid
=
PID_IS_ICONFILE
;
ps
[
1
].
ulKind
=
PRSPEC_PROPID
;
ps
[
1
].
propid
=
PID_IS_ICONINDEX
;
hr
=
url
->
lpVtbl
->
QueryInterface
(
url
,
&
IID_IPropertySetStorage
,
(
void
**
)
&
pPropSetStg
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IPropertySetStorage_Open
(
pPropSetStg
,
&
FMTID_Intshcut
,
STGM_READ
|
STGM_SHARE_EXCLUSIVE
,
&
pPropStg
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IPropertyStorage_ReadMultiple
(
pPropStg
,
2
,
ps
,
pv
);
if
(
SUCCEEDED
(
hr
))
{
icon_name
=
extract_icon
(
pv
[
0
].
pwszVal
,
pv
[
1
].
iVal
,
NULL
,
bWait
);
WINE_TRACE
(
"URL icon path: %s icon index: %d icon name: %s
\n
"
,
wine_dbgstr_w
(
pv
[
0
].
pwszVal
),
pv
[
1
].
iVal
,
icon_name
);
}
IPropertyStorage_Release
(
pPropStg
);
}
IPropertySetStorage_Release
(
pPropSetStg
);
}
hSem
=
CreateSemaphoreA
(
NULL
,
1
,
1
,
"winemenubuilder_semaphore"
);
if
(
WAIT_OBJECT_0
!=
MsgWaitForMultipleObjects
(
1
,
&
hSem
,
FALSE
,
INFINITE
,
QS_ALLINPUT
)
)
{
...
...
@@ -2689,20 +2716,21 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link
location
=
heap_printf
(
"%s/%s.desktop"
,
xdg_desktop_dir
,
lastEntry
);
if
(
location
)
{
r
=
!
write_desktop_entry
(
NULL
,
location
,
lastEntry
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
NULL
);
r
=
!
write_desktop_entry
(
NULL
,
location
,
lastEntry
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
icon_name
);
if
(
r
==
0
)
chmod
(
location
,
0755
);
HeapFree
(
GetProcessHeap
(),
0
,
location
);
}
}
else
r
=
!
write_menu_entry
(
unix_link
,
link_name
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
NULL
);
r
=
!
write_menu_entry
(
unix_link
,
link_name
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
icon_name
);
ret
=
(
r
!=
0
);
ReleaseSemaphore
(
hSem
,
1
,
NULL
);
cleanup:
if
(
hSem
)
CloseHandle
(
hSem
);
HeapFree
(
GetProcessHeap
(),
0
,
icon_name
);
HeapFree
(
GetProcessHeap
(),
0
,
link_name
);
CoTaskMemFree
(
urlPath
);
HeapFree
(
GetProcessHeap
(),
0
,
escaped_urlPath
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment