Skip to content

Commit

Permalink
Minor fix to report sync
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedol committed Jul 9, 2012
1 parent 56c536f commit 7b13fbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ public View getView(int position, View view, ViewGroup viewGroup) {
}

if (getItem(position).getThumbnail() == null) {

widgets.thumbnail.setImageResource(R.drawable.report_icon);

} else {
Expand Down
17 changes: 8 additions & 9 deletions Core/src/com/ushahidi/android/app/models/ListCheckinModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.List;

import android.content.Context;
import android.util.Log;

import com.ushahidi.android.app.R;
import com.ushahidi.android.app.database.Database;
Expand Down Expand Up @@ -113,17 +112,17 @@ public List<ListCheckinModel> getCheckins(Context context) {
}

private String getImage(Context context, int checkinId) {

List<Media> sMedia = Database.mMediaDao.fetchMedia(
IMediaSchema.CHECKIN_ID, checkinId, IMediaSchema.IMAGE, 1);
if (sMedia != null && sMedia.size() > 0) {

return sMedia.get(0).getLink();
}
return null;
}

private String getUsername(Context context, int userId) {
Log.i("ListCheckinModel","User Id "+userId);
new Util().log("ListCheckinModel","User Id "+userId);
List<User> sUser = Database.mUserDao.fetchUsersById(userId);
if (sUser != null && sUser.size() > 0) {
return sUser.get(0).getUsername();
Expand All @@ -142,16 +141,16 @@ public boolean deleteAllFetchedCheckin(int checkinId) {

// delete fetched reports
if(Database.mCheckin.deleteAllCheckins() ) {
Log.i("ListCheckinModel","Checkin deleted");
new Util().log("ListCheckinModel","Checkin deleted");
}

if( Database.mUserDao.deleteAllUsers() ) {
Log.i("Users: ","Users deleted");
new Util().log("Users: ","Users deleted");
}

// delete media
if(Database.mMediaDao.deleteCheckinPhoto(checkinId) ) {
Log.i("Media","Media deleted");
new Util().log("Media","Media deleted");
}
return true;
}
Expand All @@ -160,16 +159,16 @@ public boolean deleteCheckin() {

// delete fetched reports
if(Database.mCheckin.deleteAllCheckins() ) {
Log.i("ListCheckinModel","Checkin deleted");
new Util().log("ListCheckinModel","Checkin deleted");
}

if( Database.mUserDao.deleteAllUsers() ) {
Log.i("Users: ","Users deleted");
new Util().log("Users: ","Users deleted");
}

// delete media
if(Database.mMediaDao.deleteAllMedia() ) {
Log.i("Media","Media deleted");
new Util().log("Media","Media deleted");
}
return true;
}
Expand Down

0 comments on commit 7b13fbd

Please sign in to comment.