Skip to content

Commit

Permalink
Rename a member variable for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
murraycu committed Oct 12, 2014
1 parent d7001b1 commit 83492eb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public void testMoreItems() throws IOException, InterruptedException {

final ZooniverseClient.Subject subject = subjects.get(0);
assertNotNull(subject);
assertNotNull(subject.mId);
assertEquals(subject.mId, "504e6b5dc499611ea6020689");
assertNotNull(subject.mSubjectId);
assertEquals(subject.mSubjectId, "504e6b5dc499611ea6020689");
assertNotNull(subject.mZooniverseId);
assertEquals(subject.mZooniverseId, "AGZ0002ufd");
assertNotNull(subject.mLocationStandard);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import android.content.Intent;
import android.os.Bundle;
//import android.os.StrictMode;
import android.os.StrictMode;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.NavUtils;
import android.text.TextUtils;
Expand All @@ -39,7 +40,6 @@ class BaseActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

/* Uncomment this to get some helpful exceptions.
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
Expand All @@ -50,7 +50,6 @@ protected void onCreate(Bundle savedInstanceState) {
.penaltyLog()
.penaltyDeath()
.build());
*/


//This lets us know what MIME Type to mention in the intent filter in the manifest file,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,7 @@ private SQLiteDatabase getDb() {
* @param asyncFileDownloads Get the image data asynchronously if this is true.
*/
private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDownloads) {
if (subjectIsInDatabase(item.mId)) {
if (subjectIsInDatabase(item.mSubjectId)) {
//It is already in the database.
//TODO: Update the row?
return;
Expand All @@ -1426,15 +1426,15 @@ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDo
final SQLiteDatabase db = getDb();

final ContentValues values = new ContentValues();
values.put(DatabaseHelper.ItemsDbColumns.SUBJECT_ID, item.mId);
values.put(DatabaseHelper.ItemsDbColumns.SUBJECT_ID, item.mSubjectId);
values.put(DatabaseHelper.ItemsDbColumns.ZOONIVERSE_ID, item.mZooniverseId);

values.put(DatabaseHelper.ItemsDbColumns.LOCATION_STANDARD_URI_REMOTE, item.mLocationStandard);
values.put(DatabaseHelper.ItemsDbColumns.LOCATION_THUMBNAIL_URI_REMOTE, item.mLocationThumbnail);
values.put(DatabaseHelper.ItemsDbColumns.LOCATION_INVERTED_URI_REMOTE, item.mLocationInverted);

//Get (our) local content URIs of cache files instead of the remote URIs for the images:
final List<CreatedFileUri> listFiles = createFileUrisForImages(values, item.mId, item.mLocationStandard, item.mLocationThumbnail, item.mLocationInverted);
final List<CreatedFileUri> listFiles = createFileUrisForImages(values, item.mSubjectId, item.mLocationStandard, item.mLocationThumbnail, item.mLocationInverted);

final long rowId = db.insert(DatabaseHelper.TABLE_NAME_ITEMS,
DatabaseHelper.ItemsDbColumns._ID, values);
Expand All @@ -1443,7 +1443,7 @@ private void addSubject(final ZooniverseClient.Subject item, boolean asyncFileDo
"content values: " + values);
}

cacheUrisToFiles(item.mId, listFiles, asyncFileDownloads);
cacheUrisToFiles(item.mSubjectId, listFiles, asyncFileDownloads);

notifyRowChangeById(rowId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private static ZooniverseClient.Subject parseMoreItemsJsonObjectSubject(final Js
final String name = reader.nextName();
switch (name) {
case "id":
result.mId = reader.nextString();
result.mSubjectId = reader.nextString();
break;
case "zooniverse_id":
result.mZooniverseId = reader.nextString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public boolean uploadClassificationSync(final String authName, final String auth
}

public static class Subject {
public String mId;
public String mSubjectId;
public String mZooniverseId;
public String mLocationStandard;
public String mLocationThumbnail;
Expand Down

0 comments on commit 83492eb

Please sign in to comment.