Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
612d47d3
Commit
612d47d3
authored
Mar 30, 2009
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Mar 31, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Use the user-dirs desktop directory instead of hardcoding ~/Desktop.
parent
1929bfb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+16
-3
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
612d47d3
...
@@ -146,6 +146,7 @@ typedef struct
...
@@ -146,6 +146,7 @@ typedef struct
static
char
*
xdg_config_dir
;
static
char
*
xdg_config_dir
;
static
char
*
xdg_data_dir
;
static
char
*
xdg_data_dir
;
static
char
*
xdg_desktop_dir
;
/* Icon extraction routines
/* Icon extraction routines
*
*
...
@@ -1382,7 +1383,7 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait )
...
@@ -1382,7 +1383,7 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait )
lastEntry
=
link_name
;
lastEntry
=
link_name
;
else
else
++
lastEntry
;
++
lastEntry
;
location
=
heap_printf
(
"%s/
Desktop/%s.desktop"
,
getenv
(
"HOME"
)
,
lastEntry
);
location
=
heap_printf
(
"%s/
%s.desktop"
,
xdg_desktop_dir
,
lastEntry
);
if
(
location
)
if
(
location
)
{
{
r
=
!
write_desktop_entry
(
location
,
lastEntry
,
escaped_path
,
escaped_args
,
escaped_description
,
work_dir
,
icon_name
);
r
=
!
write_desktop_entry
(
location
,
lastEntry
,
escaped_path
,
escaped_args
,
escaped_description
,
work_dir
,
icon_name
);
...
@@ -1464,7 +1465,7 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link
...
@@ -1464,7 +1465,7 @@ static BOOL InvokeShellLinkerForURL( IUniformResourceLocatorW *url, LPCWSTR link
lastEntry
=
link_name
;
lastEntry
=
link_name
;
else
else
++
lastEntry
;
++
lastEntry
;
location
=
heap_printf
(
"%s/
Desktop/%s.desktop"
,
getenv
(
"HOME"
)
,
lastEntry
);
location
=
heap_printf
(
"%s/
%s.desktop"
,
xdg_desktop_dir
,
lastEntry
);
if
(
location
)
if
(
location
)
{
{
r
=
!
write_desktop_entry
(
location
,
lastEntry
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
NULL
);
r
=
!
write_desktop_entry
(
location
,
lastEntry
,
"winebrowser"
,
escaped_urlPath
,
NULL
,
NULL
,
NULL
);
...
@@ -1705,6 +1706,16 @@ static CHAR *next_token( LPSTR *p )
...
@@ -1705,6 +1706,16 @@ static CHAR *next_token( LPSTR *p )
static
BOOL
init_xdg
(
void
)
static
BOOL
init_xdg
(
void
)
{
{
WCHAR
shellDesktopPath
[
MAX_PATH
];
HRESULT
hr
=
SHGetFolderPathW
(
NULL
,
CSIDL_DESKTOP
,
NULL
,
SHGFP_TYPE_CURRENT
,
shellDesktopPath
);
if
(
SUCCEEDED
(
hr
))
xdg_desktop_dir
=
wine_get_unix_file_name
(
shellDesktopPath
);
if
(
xdg_desktop_dir
==
NULL
)
{
WINE_ERR
(
"error looking up the desktop directory
\n
"
);
return
FALSE
;
}
if
(
getenv
(
"XDG_CONFIG_HOME"
))
if
(
getenv
(
"XDG_CONFIG_HOME"
))
xdg_config_dir
=
heap_printf
(
"%s/menus/applications-merged"
,
getenv
(
"XDG_CONFIG_HOME"
));
xdg_config_dir
=
heap_printf
(
"%s/menus/applications-merged"
,
getenv
(
"XDG_CONFIG_HOME"
));
else
else
...
@@ -1730,6 +1741,7 @@ static BOOL init_xdg(void)
...
@@ -1730,6 +1741,7 @@ static BOOL init_xdg(void)
}
}
HeapFree
(
GetProcessHeap
(),
0
,
xdg_config_dir
);
HeapFree
(
GetProcessHeap
(),
0
,
xdg_config_dir
);
}
}
WINE_ERR
(
"out of memory
\n
"
);
return
FALSE
;
return
FALSE
;
}
}
...
@@ -1744,7 +1756,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
...
@@ -1744,7 +1756,8 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
BOOL
bURL
=
FALSE
;
BOOL
bURL
=
FALSE
;
int
ret
=
0
;
int
ret
=
0
;
init_xdg
();
if
(
!
init_xdg
())
return
1
;
for
(
p
=
cmdline
;
p
&&
*
p
;
)
for
(
p
=
cmdline
;
p
&&
*
p
;
)
{
{
...
...
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