Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
612d47d3
Commit
612d47d3
authored
16 years ago
by
Damjan Jovanovic
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winemenubuilder: Use the user-dirs desktop directory instead of hardcoding ~/Desktop.
parent
1929bfb9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/winemenubuilder/winemenubuilder.c
+16
-3
16 additions, 3 deletions
programs/winemenubuilder/winemenubuilder.c
with
16 additions
and
3 deletions
programs/winemenubuilder/winemenubuilder.c
+
16
−
3
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
;
)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment