X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/18801deac414c45ecc98f9c8a6c20b066fc4fce9..e35e32ad52f3964a44f0f404adf699e0d18502de:/src/com/owncloud/android/datamodel/FileDataStorageManager.java diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index dc24f343..cef10bc7 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -137,10 +137,9 @@ public class FileDataStorageManager { } - public Vector getFolderContent(OCFile f/*, boolean onlyOnDevice*/) { + public Vector getFolderContent(OCFile f, boolean onlyOnDevice) { if (f != null && f.isFolder() && f.getFileId() != -1) { - // TODO Enable when "On Device" is recovered ? - return getFolderContent(f.getFileId()/*, onlyOnDevice*/); + return getFolderContent(f.getFileId(), onlyOnDevice); } else { return new Vector(); @@ -148,13 +147,12 @@ public class FileDataStorageManager { } - public Vector getFolderImages(OCFile folder/*, boolean onlyOnDevice*/) { - Vector ret = new Vector(); + public Vector getFolderImages(OCFile folder, boolean onlyOnDevice) { + Vector ret = new Vector(); if (folder != null) { // TODO better implementation, filtering in the access to database instead of here - // TODO Enable when "On Device" is recovered ? - Vector tmp = getFolderContent(folder/*, onlyOnDevice*/); - OCFile current = null; + Vector tmp = getFolderContent(folder, onlyOnDevice); + OCFile current = null; for (int i=0; i files = getFolderContent(folder.getFileId()/*, false*/); + Vector files = getFolderContent(folder.getFileId(), false); if (files != null) { for (OCFile file : files) { if (file.isFolder()) { @@ -777,7 +774,8 @@ public class FileDataStorageManager { } } - private Vector getFolderContent(long parentId/*, boolean onlyOnDevice*/) { + + private Vector getFolderContent(long parentId, boolean onlyOnDevice) { Vector ret = new Vector(); @@ -804,10 +802,9 @@ public class FileDataStorageManager { if (c.moveToFirst()) { do { OCFile child = createFileInstance(c); - // TODO Enable when "On Device" is recovered ? - // if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){ - ret.add(child); - // } + if (child.isFolder() || !onlyOnDevice || onlyOnDevice && child.isDown()){ + ret.add(child); + } } while (c.moveToNext()); } @@ -1508,9 +1505,8 @@ public class FileDataStorageManager { + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER + "=?"; String [] whereArgs = new String[]{ "", mAccount.name }; - // TODO Enable when "On Device" is recovered ? - Vector files = getFolderContent(folder /*, false*/); - + Vector files = getFolderContent(folder, false); + for (OCFile file : files) { whereArgs[0] = file.getRemotePath(); preparedOperations.add( @@ -1581,7 +1577,7 @@ public class FileDataStorageManager { return shares; } - public void triggerMediaScan(String path) { + public static void triggerMediaScan(String path) { Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); intent.setData(Uri.fromFile(new File(path))); MainApp.getAppContext().sendBroadcast(intent);