Skip to content

Commit

Permalink
commented channel lookup via cursor until content provider is
Browse files Browse the repository at this point in the history
re-implemented
  • Loading branch information
Daniel Frey committed Oct 17, 2012
1 parent bbc93d1 commit 21bef58
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/org/mythtv/client/ui/dvr/RecordingRuleEditFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ private void setupForm( RecRule rule ) {
// - should we move this to a utility?
// - slow
String channel = "[Any]";
Cursor cursor = this.getActivity().getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
if( cursor.moveToFirst() ) {
channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
}
cursor.close();
//Cursor cursor = this.getActivity().getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
//if( cursor.moveToFirst() ) {
// channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
//}
//cursor.close();

tView = (TextView) getActivity().findViewById( R.id.recording_rule_channel );
tView.setText( channel );
Expand Down
10 changes: 5 additions & 5 deletions src/org/mythtv/client/ui/dvr/RecordingRuleFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ private void setup( RecRule rule ) {
// - should we move this to a utility?
// - slow
String channel = "[Any]";
Cursor cursor = this.getActivity().getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
if( cursor.moveToFirst() ) {
channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
}
cursor.close();
//Cursor cursor = this.getActivity().getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
//if( cursor.moveToFirst() ) {
// channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
//}
//cursor.close();

tView = (TextView) getActivity().findViewById( R.id.recording_rule_channel );
tView.setText( channel );
Expand Down
10 changes: 5 additions & 5 deletions src/org/mythtv/client/ui/dvr/RecordingRulesFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,11 @@ public View getView( int position, View convertView, ViewGroup parent ) {
RecRule rule = getItem( position );

String channel = "[Any]";
Cursor cursor = mContext.getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
if( cursor.moveToFirst() ) {
channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
}
cursor.close();
//Cursor cursor = mContext.getContentResolver().query( ChannelConstants.CONTENT_URI, new String[] { ChannelConstants.FIELD_CHAN_NUM }, ChannelConstants.FIELD_CHAN_ID + " = ?", new String[] { "" + rule.getChanId() }, null );
//if( cursor.moveToFirst() ) {
// channel = cursor.getString( cursor.getColumnIndexOrThrow( ChannelConstants.FIELD_CHAN_NUM ) );
//}
//cursor.close();

mHolder.category.setBackgroundColor( mProgramHelper.getCategoryColor( rule.getCategory() ) );
mHolder.title.setText( rule.getTitle() );
Expand Down

0 comments on commit 21bef58

Please sign in to comment.