Browse Source

further CR fixes, fixed comment in layout/migration_layout.xml

Andy Scherzinger 8 years ago
parent
commit
612199a9b7

+ 13 - 12
res/layout/migration_layout.xml

@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 <!--
   Nextcloud Android client application
   Nextcloud Android client application
 
 
@@ -17,35 +18,35 @@
   You should have received a copy of the GNU Affero General Public
   You should have received a copy of the GNU Affero General Public
   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
   License along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 -->
-<?xml version="1.0" encoding="utf-8"?>
+
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:orientation="vertical"
               android:layout_width="match_parent"
               android:layout_width="match_parent"
               android:layout_height="match_parent"
               android:layout_height="match_parent"
-              android:gravity="center_vertical">
+              android:gravity="center_vertical"
+              android:orientation="vertical">
 
 
     <ProgressBar
     <ProgressBar
+        android:id="@+id/migrationProgress"
         style="?android:attr/progressBarStyleHorizontal"
         style="?android:attr/progressBarStyleHorizontal"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:id="@+id/migrationProgress"
         android:layout_gravity="center_horizontal"
         android:layout_gravity="center_horizontal"
-        android:progress="50"
         android:paddingLeft="30dp"
         android:paddingLeft="30dp"
-        android:paddingRight="30dp"/>
+        android:paddingRight="30dp"
+        android:progress="50"/>
 
 
     <TextView
     <TextView
+        android:id="@+id/migrationText"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:textAppearance="?android:attr/textAppearanceMedium"
+        android:layout_gravity="center_horizontal"
         android:text=""
         android:text=""
-        android:id="@+id/migrationText"
-        android:layout_gravity="center_horizontal"/>
+        android:textAppearance="?android:attr/textAppearanceMedium"/>
 
 
     <Button
     <Button
+        android:id="@+id/finishButton"
         android:layout_width="wrap_content"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:text="@string/drawer_close"
-        android:id="@+id/finishButton"
-        android:layout_gravity="center_horizontal"/>
+        android:layout_gravity="center_horizontal"
+        android:text="@string/drawer_close"/>
 </LinearLayout>
 </LinearLayout>

+ 0 - 3
res/xml/preferences.xml

@@ -23,9 +23,6 @@
 			android:title="@string/prefs_storage_path"
 			android:title="@string/prefs_storage_path"
 			android:key="storage_path" />
 			android:key="storage_path" />
 	</PreferenceCategory>
 	</PreferenceCategory>
-    <PreferenceCategory android:title="@string/prefs_category_accounts" android:key="accounts_category">
-    </PreferenceCategory>
-    
 
 
     <PreferenceCategory android:title="@string/prefs_category_instant_uploading" android:key="instant_uploading_category">
     <PreferenceCategory android:title="@string/prefs_category_instant_uploading" android:key="instant_uploading_category">
 		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
 		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"

+ 4 - 15
src/com/owncloud/android/datamodel/FileDataStorageManager.java

@@ -46,11 +46,6 @@ import com.owncloud.android.utils.MimeType;
 import com.owncloud.android.utils.MimeTypeUtil;
 import com.owncloud.android.utils.MimeTypeUtil;
 
 
 import java.io.File;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Collections;
@@ -784,16 +779,10 @@ public class FileDataStorageManager {
         c.close();
         c.close();
 
 
         /// 3. apply updates in batch
         /// 3. apply updates in batch
-        try {
-            if (getContentResolver() != null) {
-                getContentResolver().applyBatch(MainApp.getAuthority(), operations);
-
-            } else {
-                getContentProviderClient().applyBatch(operations);
-            }
-
-        } catch (Exception e) {
-            throw e;
+        if (getContentResolver() != null) {
+            getContentResolver().applyBatch(MainApp.getAuthority(), operations);
+        } else {
+            getContentProviderClient().applyBatch(operations);
         }
         }
     }
     }
 
 

+ 3 - 3
src/com/owncloud/android/datastorage/DataStorageProvider.java

@@ -40,9 +40,9 @@ import java.util.Vector;
  */
  */
 public class DataStorageProvider {
 public class DataStorageProvider {
 
 
-    private static Vector<IStoragePointProvider> mStorageProviders = new Vector<>();
-    private static UniqueStorageList mCachedStoragePoints = new UniqueStorageList();
-    private static DataStorageProvider sInstance = new DataStorageProvider() {{
+    private static final Vector<IStoragePointProvider> mStorageProviders = new Vector<>();
+    private static final UniqueStorageList mCachedStoragePoints = new UniqueStorageList();
+    private static final DataStorageProvider sInstance = new DataStorageProvider() {{
         // There is no system wide way to get usb storage so we need to provide multiple
         // There is no system wide way to get usb storage so we need to provide multiple
         // handcrafted ways to add those.
         // handcrafted ways to add those.
         addStoragePointProvider(new SystemDefaultStoragePointProvider());
         addStoragePointProvider(new SystemDefaultStoragePointProvider());

+ 1 - 0
src/com/owncloud/android/ui/activity/StorageMigration.java

@@ -394,6 +394,7 @@ public class StorageMigration {
             try {
             try {
                 manager.migrateStoredFiles(mStorageSource, mStorageTarget);
                 manager.migrateStoredFiles(mStorageSource, mStorageTarget);
             } catch (Exception e) {
             } catch (Exception e) {
+                Log_OC.e(TAG,e.getMessage(),e);
                 throw new MigrationException(R.string.file_migration_failed_while_updating_index);
                 throw new MigrationException(R.string.file_migration_failed_while_updating_index);
             }
             }
         }
         }