From: jabarros Date: Tue, 20 Jan 2015 10:07:44 +0000 (+0100) Subject: Remove is_uploading field from database X-Git-Tag: oc-android-1.7.0_signed~23^2~8^2~3 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/6674379a5fb7d281886c5730f6742c71c461dfff Remove is_uploading field from database --- diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index c1bf61be..1f626d36 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -194,7 +194,6 @@ public class FileDataStorageManager { cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId()); cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail()); cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading()); - cv.put(ProviderTableMeta.FILE_IS_UPLOADING, file.isUploading()); boolean sameRemotePath = fileExists(file.getRemotePath()); if (sameRemotePath || @@ -305,7 +304,6 @@ public class FileDataStorageManager { cv.put(ProviderTableMeta.FILE_REMOTE_ID, file.getRemoteId()); cv.put(ProviderTableMeta.FILE_UPDATE_THUMBNAIL, file.needsUpdateThumbnail()); cv.put(ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading()); - cv.put(ProviderTableMeta.FILE_IS_UPLOADING, file.isUploading()); boolean existsByPath = fileExists(file.getRemotePath()); if (existsByPath || fileExists(file.getFileId())) { @@ -883,8 +881,6 @@ public class FileDataStorageManager { c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false); file.setDownloading(c.getInt( c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1 ? true : false); - file.setUploading(c.getInt( - c.getColumnIndex(ProviderTableMeta.FILE_IS_UPLOADING)) == 1 ? true : false); } return file; @@ -1271,10 +1267,6 @@ public class FileDataStorageManager { ProviderTableMeta.FILE_IS_DOWNLOADING, file.isDownloading() ? 1 : 0 ); - cv.put( - ProviderTableMeta.FILE_IS_UPLOADING, - file.isUploading() ? 1 : 0 - ); boolean existsByPath = fileExists(file.getRemotePath()); if (existsByPath || fileExists(file.getFileId())) { diff --git a/src/com/owncloud/android/datamodel/OCFile.java b/src/com/owncloud/android/datamodel/OCFile.java index 222746b5..bda6166d 100644 --- a/src/com/owncloud/android/datamodel/OCFile.java +++ b/src/com/owncloud/android/datamodel/OCFile.java @@ -71,7 +71,6 @@ public class OCFile implements Parcelable, Comparable { private boolean mNeedsUpdateThumbnail; private boolean mIsDownloading; - private boolean mIsUploading; /** @@ -116,7 +115,6 @@ public class OCFile implements Parcelable, Comparable { mRemoteId = source.readString(); mNeedsUpdateThumbnail = source.readInt() == 0; mIsDownloading = source.readInt() == 0; - mIsUploading = source.readInt() == 0; } @@ -142,7 +140,6 @@ public class OCFile implements Parcelable, Comparable { dest.writeString(mRemoteId); dest.writeInt(mNeedsUpdateThumbnail ? 1 : 0); dest.writeInt(mIsDownloading ? 1 : 0); - dest.writeInt(mIsUploading ? 1 : 0); } /** @@ -356,7 +353,6 @@ public class OCFile implements Parcelable, Comparable { mRemoteId = null; mNeedsUpdateThumbnail = false; mIsDownloading = false; - mIsUploading = false; } /** @@ -575,14 +571,6 @@ public class OCFile implements Parcelable, Comparable { return mIsDownloading; } - public boolean isUploading() { - return mIsUploading; - } - - public void setUploading(boolean isUploading) { - this.mIsUploading = isUploading; - } - public void setDownloading(boolean isDownloading) { this.mIsDownloading = isDownloading; } diff --git a/src/com/owncloud/android/db/ProviderMeta.java b/src/com/owncloud/android/db/ProviderMeta.java index 06770b67..b6bfe4a8 100644 --- a/src/com/owncloud/android/db/ProviderMeta.java +++ b/src/com/owncloud/android/db/ProviderMeta.java @@ -72,7 +72,6 @@ public class ProviderMeta { public static final String FILE_REMOTE_ID = "remote_id"; public static final String FILE_UPDATE_THUMBNAIL = "update_thumbnail"; public static final String FILE_IS_DOWNLOADING= "is_downloading"; - public static final String FILE_IS_UPLOADING = "is_uploading"; public static final String FILE_DEFAULT_SORT_ORDER = FILE_NAME + " collate nocase asc"; diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 7c8cad54..3bf6dd48 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -416,7 +416,6 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis file.setFileLength((new File(mCurrentDownload.getSavePath()).length())); file.setRemoteId(mCurrentDownload.getFile().getRemoteId()); file.setDownloading(false); - file.setUploading(false); mStorageManager.saveFile(file); mStorageManager.triggerMediaScan(file.getStoragePath()); } diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index d26fad51..04804402 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -635,8 +635,6 @@ public class FileUploader extends Service implements OnDatatransferProgressListe // in the instance returned by mCurrentUpload.getFile() } file.setNeedsUpdateThumbnail(true); - file.setDownloading(false); - file.setUploading(false); mStorageManager.saveFile(file); } diff --git a/src/com/owncloud/android/providers/FileContentProvider.java b/src/com/owncloud/android/providers/FileContentProvider.java index d3e22682..4ea4812c 100644 --- a/src/com/owncloud/android/providers/FileContentProvider.java +++ b/src/com/owncloud/android/providers/FileContentProvider.java @@ -99,8 +99,6 @@ public class FileContentProvider extends ContentProvider { ProviderTableMeta.FILE_UPDATE_THUMBNAIL); mFileProjectionMap.put(ProviderTableMeta.FILE_IS_DOWNLOADING, ProviderTableMeta.FILE_IS_DOWNLOADING); - mFileProjectionMap.put(ProviderTableMeta.FILE_IS_UPLOADING, - ProviderTableMeta.FILE_IS_UPLOADING); } private static final int SINGLE_FILE = 1; @@ -629,8 +627,7 @@ public class FileContentProvider extends ContentProvider { + ProviderTableMeta.FILE_PERMISSIONS + " TEXT null," + ProviderTableMeta.FILE_REMOTE_ID + " TEXT null," + ProviderTableMeta.FILE_UPDATE_THUMBNAIL + " INTEGER," //boolean - + ProviderTableMeta.FILE_IS_DOWNLOADING + " INTEGER," //boolean - + ProviderTableMeta.FILE_IS_UPLOADING + " INTEGER);" //boolean + + ProviderTableMeta.FILE_IS_DOWNLOADING + " INTEGER);" //boolean ); // Create table ocshares @@ -811,9 +808,6 @@ public class FileContentProvider extends ContentProvider { db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME + " ADD COLUMN " + ProviderTableMeta.FILE_IS_DOWNLOADING + " INTEGER " + " DEFAULT 0"); - db .execSQL("ALTER TABLE " + ProviderTableMeta.FILE_TABLE_NAME + - " ADD COLUMN " + ProviderTableMeta.FILE_IS_UPLOADING + " INTEGER " + - " DEFAULT 0"); upgraded = true; db.setTransactionSuccessful();