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
448ca846
Commit
448ca846
authored
Apr 05, 2009
by
Damjan Jovanovic
Committed by
Alexandre Julliard
Apr 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemenubuilder: Make initial directories for fd.o MIME type handling.
parent
cac6b96d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
winemenubuilder.c
programs/winemenubuilder/winemenubuilder.c
+56
-0
No files found.
programs/winemenubuilder/winemenubuilder.c
View file @
448ca846
...
...
@@ -1668,6 +1668,57 @@ static BOOL Process_URL( LPCWSTR urlname, BOOL bWait )
return
!
r
;
}
static
void
RefreshFileTypeAssociations
(
void
)
{
HANDLE
hSem
=
NULL
;
char
*
mime_dir
=
NULL
;
char
*
packages_dir
=
NULL
;
char
*
applications_dir
=
NULL
;
hSem
=
CreateSemaphoreA
(
NULL
,
1
,
1
,
"winemenubuilder_semaphore"
);
if
(
WAIT_OBJECT_0
!=
MsgWaitForMultipleObjects
(
1
,
&
hSem
,
FALSE
,
INFINITE
,
QS_ALLINPUT
)
)
{
WINE_ERR
(
"failed wait for semaphore
\n
"
);
CloseHandle
(
hSem
);
hSem
=
NULL
;
goto
end
;
}
mime_dir
=
heap_printf
(
"%s/mime"
,
xdg_data_dir
);
if
(
mime_dir
==
NULL
)
{
WINE_ERR
(
"out of memory
\n
"
);
goto
end
;
}
create_directories
(
mime_dir
);
packages_dir
=
heap_printf
(
"%s/packages"
,
mime_dir
);
if
(
packages_dir
==
NULL
)
{
WINE_ERR
(
"out of memory
\n
"
);
goto
end
;
}
create_directories
(
packages_dir
);
applications_dir
=
heap_printf
(
"%s/applications"
,
xdg_data_dir
);
if
(
applications_dir
==
NULL
)
{
WINE_ERR
(
"out of memory
\n
"
);
goto
end
;
}
create_directories
(
applications_dir
);
end:
if
(
hSem
)
{
ReleaseSemaphore
(
hSem
,
1
,
NULL
);
CloseHandle
(
hSem
);
}
HeapFree
(
GetProcessHeap
(),
0
,
mime_dir
);
HeapFree
(
GetProcessHeap
(),
0
,
packages_dir
);
HeapFree
(
GetProcessHeap
(),
0
,
applications_dir
);
}
static
CHAR
*
next_token
(
LPSTR
*
p
)
{
LPSTR
token
=
NULL
,
t
=
*
p
;
...
...
@@ -1764,6 +1815,11 @@ int PASCAL WinMain (HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show
token
=
next_token
(
&
p
);
if
(
!
token
)
break
;
if
(
!
lstrcmpA
(
token
,
"-a"
)
)
{
RefreshFileTypeAssociations
();
break
;
}
if
(
!
lstrcmpA
(
token
,
"-w"
)
)
bWait
=
TRUE
;
else
if
(
!
lstrcmpA
(
token
,
"-u"
)
)
...
...
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