[Android] Cosmetics and comments

Jean-Baptiste Kempf git at videolan.org
Tue Aug 14 14:48:04 CEST 2012


android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Aug 14 14:47:54 2012 +0200| [8a55c5acfc0d1eb39f5eb6c241ca6cc9ef2ba6e0] | committer: Jean-Baptiste Kempf

Cosmetics and comments

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=8a55c5acfc0d1eb39f5eb6c241ca6cc9ef2ba6e0
---

 vlc-android/src/org/videolan/vlc/MediaLibrary.java |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/MediaLibrary.java b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
index c702943..daa09e5 100644
--- a/vlc-android/src/org/videolan/vlc/MediaLibrary.java
+++ b/vlc-android/src/org/videolan/vlc/MediaLibrary.java
@@ -171,7 +171,7 @@ public class MediaLibrary {
                 root = Environment.getExternalStorageDirectory().getAbsolutePath();
             }
 
-            // show progressbar in header
+            // show progressbar in footer
             MainActivity.showProgressBar(mContext);
 
             // get directories from database
@@ -200,16 +200,17 @@ public class MediaLibrary {
                 File dir = directories.pop();
                 File[] f = null;
 
+                // Do no take the media in .nomedia folders
                 if (new File(dir.getAbsolutePath() + "/.nomedia").exists()) {
                     continue;
                 }
 
+                // Filter the extensions and the folders
                 if ((f = dir.listFiles(mediaFileFilter)) != null) {
-                    for (int i = 0; i < f.length; i++) {
-                        File file = f[i];
+                    for (File file : f) {
                         if (file.isFile()) {
-                            total++;
                             mediaToScan.add(file);
+                            total++;
                         } else if (file.isDirectory()) {
                             directories.push(file);
                         }
@@ -253,7 +254,7 @@ public class MediaLibrary {
                 mDBManager.removeMedias(existingMedias.keySet());
             }
 
-            // hide progressbar in header
+            // hide progressbar in footer
             MainActivity.clearTextInfo(mContext);
             MainActivity.hideProgressBar(mContext);
             mContext = null;



More information about the Android mailing list