Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Ewout ter Hoeven
VLC-Android
Commits
5fb418e0
Commit
5fb418e0
authored
Feb 18, 2015
by
Geoffrey Métais
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New function for recursive deletion of directories
CID #1226286
parent
62d3e5f7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
vlc-android/src/org/videolan/vlc/MediaDatabase.java
vlc-android/src/org/videolan/vlc/MediaDatabase.java
+15
-1
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
+1
-8
No files found.
vlc-android/src/org/videolan/vlc/MediaDatabase.java
View file @
5fb418e0
...
...
@@ -456,7 +456,7 @@ public class MediaDatabase {
PLAYLIST_MEDIA_ORDER
+
"=?"
,
new
String
[]
{
playlistName
,
Integer
.
toString
(
position
)
});
playlistShiftItems
(
playlistName
,
position
+
1
,
-
1
);
playlistShiftItems
(
playlistName
,
position
+
1
,
-
1
);
}
/**
...
...
@@ -849,6 +849,20 @@ public class MediaDatabase {
mDb
.
delete
(
DIR_TABLE_NAME
,
DIR_ROW_PATH
+
"=?"
,
new
String
[]
{
path
});
}
/**
* Delete all matching directories from directories table
*
* @param path
*/
public
synchronized
void
recursiveRemoveDir
(
String
path
)
{
for
(
File
f
:
getMediaDirs
())
{
final
String
dirPath
=
f
.
getPath
();
if
(
dirPath
.
startsWith
(
path
))
mDb
.
delete
(
DIR_TABLE_NAME
,
DIR_ROW_PATH
+
"=?"
,
new
String
[]
{
dirPath
});
}
}
/**
*
* @return
...
...
vlc-android/src/org/videolan/vlc/gui/BrowserActivity.java
View file @
5fb418e0
...
...
@@ -128,14 +128,7 @@ public class BrowserActivity extends ListActivity {
@Override
public
boolean
onMenuItemClick
(
MenuItem
arg0
)
{
// remove any checkmarks of the custom item
final
MediaDatabase
dbManager
=
MediaDatabase
.
getInstance
();
synchronized
(
dbManager
)
{
for
(
File
f
:
dbManager
.
getMediaDirs
())
{
final
String
path
=
f
.
getPath
();
if
(
path
.
startsWith
(
item
.
getPath
()))
dbManager
.
removeDir
(
path
);
}
}
MediaDatabase
.
getInstance
().
recursiveRemoveDir
(
item
.
getPath
());
CustomDirectories
.
removeCustomDirectory
(
item
.
getPath
());
refresh
();
return
true
;
...
...
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