Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
70d34026
Commit
70d34026
authored
Jan 15, 2013
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skins2: reimplement rmDir on Windows with ShellApi
parent
8dc8e064
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
33 deletions
+15
-33
modules/gui/skins2/win32/win32_factory.cpp
modules/gui/skins2/win32/win32_factory.cpp
+15
-33
No files found.
modules/gui/skins2/win32/win32_factory.cpp
View file @
70d34026
...
...
@@ -32,6 +32,7 @@
#include <winuser.h>
#include <wingdi.h>
#include <tchar.h>
#include <shellapi.h>
#include "win32_factory.hpp"
#include "win32_graphics.hpp"
...
...
@@ -478,39 +479,20 @@ void Win32Factory::changeCursor( CursorType_t type ) const
void
Win32Factory
::
rmDir
(
const
string
&
rPath
)
{
WIN32_FIND_DATAA
find
;
string
file
;
string
findFiles
=
rPath
+
"
\\
*"
;
HANDLE
handle
=
FindFirstFileA
(
findFiles
.
c_str
(),
&
find
);
while
(
handle
!=
INVALID_HANDLE_VALUE
)
{
// If file is neither "." nor ".."
if
(
strcmp
(
find
.
cFileName
,
"."
)
&&
strcmp
(
find
.
cFileName
,
".."
)
)
{
// Set file name
file
=
rPath
+
"
\\
"
+
(
string
)
find
.
cFileName
;
// If file is a directory, delete it recursively
if
(
find
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
{
rmDir
(
file
);
}
// Else, it is a file so simply delete it
else
{
DeleteFileA
(
file
.
c_str
()
);
}
}
// If no more file in directory, exit while
if
(
!
FindNextFileA
(
handle
,
&
find
)
)
break
;
}
// Now directory is empty so can be removed
FindClose
(
handle
);
RemoveDirectoryA
(
rPath
.
c_str
()
);
LPWSTR
dir
=
ToWide
(
rPath
.
c_str
()
);
SHFILEOPSTRUCTW
file_op
=
{
NULL
,
FO_DELETE
,
dir
,
NULL
,
FOF_NOCONFIRMATION
|
FOF_NOERRORUI
|
FOF_SILENT
,
false
,
NULL
,
TEXT
(
""
)
};
SHFileOperationW
(
&
file_op
);
}
#endif
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