~ubuntu-branches/ubuntu/trusty/me-tv/trusty

« back to all changes in this revision

Viewing changes to src/channel_manager.cc

  • Committer: Bazaar Package Importer
  • Author(s): Teis Dreijer
  • Date: 2010-02-14 11:29:00 UTC
  • mfrom: (1.1.11 upstream) (3.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100214112900-krutrmpz248vz1ji
Tags: 1.1.6-2
* Updated debian/control
  - Removed libgnomem-2.6-dev and libgnomeuimm-2.6-dev
    from Build-Depends (Closes: #568782)
  - Added libgconfmm-2.6-dev to Build-Depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        }
209
209
 
210
210
        g_debug("Deleting old EPG events");
211
 
        Glib::ustring clause_epg_event = Glib::ustring::compose("(START_TIME+DURATION)<%1", convert_to_local_time(time(NULL)));
 
211
        Glib::ustring clause_epg_event = Glib::ustring::compose("(START_TIME+DURATION)<%1", get_local_time() - 36000);
212
212
        adapter_epg_event.delete_rows(clause_epg_event);
213
213
 
214
214
        // Delete orphaned epg_events_texts
238
238
 
239
239
Channel& ChannelManager::get_channel_by_index(guint index)
240
240
{
 
241
        LockLogger lock(mutex, __PRETTY_FUNCTION__);
 
242
 
241
243
        if (index >= channels.size())
242
244
        {
243
245
                throw Exception(_("Invalid channel index"));
248
250
 
249
251
Channel& ChannelManager::get_channel_by_id(guint channel_id)
250
252
{
 
253
        LockLogger lock(mutex, __PRETTY_FUNCTION__);
 
254
 
251
255
        Channel* channel = find_channel(channel_id);
252
256
 
253
257
        if (channel == NULL)
305
309
 
306
310
Channel& ChannelManager::get_display_channel()
307
311
{
 
312
        if (display_channel_index == NO_CHANNEL)
 
313
        {
 
314
                throw Exception(_("No channel selected"));
 
315
        }
 
316
        
308
317
        return channels[display_channel_index];
309
318
}
310
319
 
379
388
                Channel& channel = channels[index];
380
389
                if (channel.type == frontend_type)
381
390
                {
 
391
                        g_debug("Channel %d selected", index);
382
392
                        display_channel_index = index;
383
393
                        return;
384
394
                }
389
399
{
390
400
        LockLogger lock(mutex, __PRETTY_FUNCTION__);
391
401
 
 
402
        g_debug("Setting display channel to %d", channel.channel_id);
 
403
 
392
404
        gboolean found = false;
393
405
        for (guint index = 0; index < channels.size() && !found; index++)
394
406
        {
395
407
                if (channel.channel_id == channels[index].channel_id)
396
408
                {
 
409
                        g_debug("Display channel set to %d", index);
397
410
                        display_channel_index = index;
398
411
                        found = true;
399
412
                }