Skip to content

Commit

Permalink
Optimize set for boolean parameters in UploadsStorageManager. Fix pro…
Browse files Browse the repository at this point in the history
…blem in Uploads DB creation method
  • Loading branch information
masensio committed Dec 28, 2015
1 parent 02ffba3 commit aca6e66
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/com/owncloud/android/datamodel/UploadsStorageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,19 +337,19 @@ private OCFile createFileInstance(Cursor c) {
file.setLastSyncDateForData(c.getLong(c.
getColumnIndex(ProviderTableMeta.FILE_LAST_SYNC_DATE_FOR_DATA)));
file.setFavorite(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1 );
file.setEtag(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG)));
file.setShareViaLink(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.FILE_SHARED_VIA_LINK)) == 1 );
file.setShareWithSharee(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.FILE_SHARED_WITH_SHAREE)) == 1 );
file.setPublicLink(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PUBLIC_LINK)));
file.setPermissions(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_PERMISSIONS)));
file.setRemoteId(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_REMOTE_ID)));
file.setNeedsUpdateThumbnail(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.FILE_UPDATE_THUMBNAIL)) == 1 );
file.setDownloading(c.getInt(
c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.FILE_IS_DOWNLOADING)) == 1 );
file.setEtagInConflict(c.getString(c.getColumnIndex(ProviderTableMeta.FILE_ETAG_IN_CONFLICT)));

}
Expand All @@ -370,13 +370,13 @@ private OCUpload createOCUploadFromCursor(Cursor c){
upload.setLocalAction(FileUploadService.LocalBehaviour.fromValue(
c.getInt(c.getColumnIndex((ProviderTableMeta.UPLOADS_LOCAL_BEHAVIOUR)))));
upload.setForceOverwrite(c.getInt(
c.getColumnIndex(ProviderTableMeta.UPLOADS_FORCE_OVERWRITE)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.UPLOADS_FORCE_OVERWRITE)) == 1 );
upload.setCreateRemoteFolder(c.getInt(
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER)) == 1 );
upload.setWhileChargingOnly(c.getInt(
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY)) == 1 );
upload.setUseWifiOnly(c.getInt(
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WIFI_ONLY)) == 1 ? true : false);
c.getColumnIndex(ProviderTableMeta.UPLOADS_IS_WIFI_ONLY)) == 1 );
upload.setUploadTimestamp(c.getLong(c.getColumnIndex(ProviderTableMeta.UPLOADS_UPLOAD_TIMESTAMP)));
upload.setLastResult(UploadResult.fromValue(
c.getInt(c.getColumnIndex(ProviderTableMeta.UPLOADS_LAST_RESULT))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ private void createUploadsTable(SQLiteDatabase db){
+ ProviderTableMeta.UPLOADS_FORCE_OVERWRITE + " INTEGER, " // boolean
+ ProviderTableMeta.UPLOADS_IS_CREATE_REMOTE_FOLDER + " INTEGER, " // boolean
+ ProviderTableMeta.UPLOADS_IS_WHILE_CHARGING_ONLY + " INTEGER, " // boolean
+ ProviderTableMeta.UPLOADS_IS_WIFI_ONLY + "INTEGER, " // boolean
+ ProviderTableMeta.UPLOADS_IS_WIFI_ONLY + " INTEGER, " // boolean
+ ProviderTableMeta.UPLOADS_UPLOAD_TIMESTAMP + " INTEGER, "
+ ProviderTableMeta.UPLOADS_LAST_RESULT + " INTEGER );" ); // Upload LastResult

Expand Down

0 comments on commit aca6e66

Please sign in to comment.