Ticket #7691: 7691-v1.patch

File 7691-v1.patch, 8.6 KB (added by danielk, 14 years ago)

Some low hanging fruit, untested.

  • libs/libmythtv/jobqueue.cpp

     
    20122012                               .arg(comment)).toLocal8Bit();
    20132013                }
    20142014
    2015                 MythEvent me("RECORDING_LIST_CHANGE");
    2016                 gContext->dispatch(me);
    2017 
    20182015                program_info->SetTranscoded(TRANSCODING_COMPLETE);
    20192016            }
    20202017            else
     
    21652162        comment = tr("%n commercial break(s)", "", breaksFound);
    21662163        ChangeJobStatus(jobID, JOB_FINISHED, comment);
    21672164
    2168         MythEvent me("RECORDING_LIST_CHANGE");
    2169         gContext->dispatch(me);
     2165        program_info->Update();
    21702166
    21712167        program_info->pathname = program_info->GetPlaybackURL();
    21722168        (new PreviewGenerator(program_info, PreviewGenerator::kLocal))->Run();
     
    22842280
    22852281        ChangeJobStatus(jobID, JOB_FINISHED, "Successfully Completed.");
    22862282
    2287         MythEvent me("RECORDING_LIST_CHANGE");
    2288         gContext->dispatch(me);
     2283        if (pginfo)
     2284            pginfo->Update();
    22892285    }
    22902286
    22912287    RemoveRunningJob(jobID);
  • libs/libmythtv/tv_rec.cpp

     
    504504        curRecording->recordid = rcinfo->recordid;
    505505        curRecording->recendts = rcinfo->recendts;
    506506        curRecording->UpdateRecordingEnd();
    507         MythEvent me("RECORDING_LIST_CHANGE");
    508         gContext->dispatch(me);
    509507
    510508        recordEndTime = curRecording->recendts.addSecs(post_roll_seconds);
    511509
     
    785783}
    786784
    787785/** \fn TVRec::StartedRecording(RecordingInfo *curRec)
    788  *  \brief Inserts a "curRec" into the database, and issues a
    789  *         "RECORDING_LIST_CHANGE" event.
     786 *  \brief Inserts a "curRec" into the database
    790787 *  \param curRec Recording to add to database.
    791788 *  \sa ProgramInfo::StartedRecording(const QString&)
    792789 */
     
    801798
    802799    if (curRec->chancommfree != 0)
    803800        curRec->SetCommFlagged(COMM_FLAG_COMMFREE);
    804 
    805     MythEvent me("RECORDING_LIST_CHANGE");
    806     gContext->dispatch(me);
    807801}
    808802
    809803/** \fn TVRec::FinishedRecording(RecordingInfo *curRec)
     
    10691063 *
    10701064 *   If killfile is true, the recording is deleted.
    10711065 *
    1072  *   A "RECORDING_LIST_CHANGE" message is dispatched.
    1073  *
    10741066 *   Finally, if there was a recording and it was not deleted,
    10751067 *   schedule any post-processing jobs.
    10761068 *
     
    11401132        curRecording = NULL;
    11411133    }
    11421134
    1143     MythEvent me("RECORDING_LIST_CHANGE");
    1144     gContext->dispatch(me);
    11451135    pauseNotify = true;
    11461136
    11471137    if (GetDTVChannel())
  • libs/libmythtv/recordinginfo.cpp

     
    223223        MythDB::DBError("RecGroup update", query);
    224224
    225225    recgroup = newrecgroup;
     226
     227    Update();
    226228}
    227229
    228230/** \fn RecordingInfo::ApplyRecordPlayGroupChange(const QString &newplaygroup)
     
    246248        MythDB::DBError("PlayGroup update", query);
    247249
    248250    playgroup = newplaygroup;
     251
     252    Update();
    249253}
    250254
    251255/** \fn RecordingInfo::ApplyStorageGroupChange(const QString &newstoragegroup)
     
    269273        MythDB::DBError("StorageGroup update", query);
    270274
    271275    storagegroup = newstoragegroup;
     276
     277    Update();
    272278}
    273279
    274280/** \fn RecordingInfo::ApplyRecordRecTitleChange(const QString &newTitle, const QString &newSubtitle)
     
    295301
    296302    title = newTitle;
    297303    subtitle = newSubtitle;
     304
     305    Update();
    298306}
    299307
    300308/** \brief Sets the transcoder profile for a recording
     
    546554    query.bindValue(":START", startts);
    547555    if (!query.exec() || !query.isActive())
    548556        MythDB::DBError("Copy program ratings on record", query);
     557
     558    Update();
     559
     560    // TODO remove this after we've changed WatchRecordings appropriately.
     561    gContext->dispatch(MythEvent("RECORDING_LIST_CHANGE"));
    549562}
    550563
    551564static bool insert_program(const RecordingInfo        *pg,
     
    705718        VERBOSE(VB_GENERAL, QString("%1 %2").arg(msg).arg(details));
    706719        gContext->LogEntry("scheduler", LP_NOTICE, msg, details);
    707720    }
     721
     722    Update();
    708723}
    709724
    710725/** \fn RecordingInfo::UpdateRecordingEnd(void)
     
    724739
    725740    if (!query.exec())
    726741        MythDB::DBError("UpdateRecordingEnd update", query);
     742
     743    Update();
    727744}
    728745
    729746/** \fn RecordingInfo::ReactivateRecording(void)
  • libs/libmyth/programinfo.h

     
    376376    // Translations for play,recording, & storage groups +
    377377    static QString i18n(const QString&);
    378378
     379    /// Sends event out that the ProgramInfo should be reloaded.
     380    void Update(void) const;
     381
    379382  protected:
    380383    // Creates a basename from the start and end times
    381384    QString CreateRecordBasename(const QString &ext) const;
    382     /// Sends event out that the ProgramInfo should be reloaded.
    383     void Update(void) const;
    384385
    385386  public:
    386387    // data
  • libs/libmyth/programinfo.cpp

     
    35283528
    35293529    if (!inuse)
    35303530    {
    3531         if (!gContext->IsBackend())
    3532             RemoteSendMessage("RECORDING_LIST_CHANGE");
    35333531        inUseForWhat.clear();
     3532        Update();
    35343533        return;
    35353534    }
    35363535
     
    35933592    query.bindValue(":RECHOST", hostname);
    35943593    query.bindValue(":RECDIR", recDir);
    35953594
    3596     if (!query.exec() || !query.isActive())
     3595    if (!query.exec())
    35973596        MythDB::DBError("SetInUse", query);
    35983597
    35993598    // Let others know we changed status
    3600     if (notifyOfChange && !gContext->IsBackend())
    3601         RemoteSendMessage("RECORDING_LIST_CHANGE");
     3599    if (notifyOfChange)
     3600        Update();
    36023601}
    36033602
    36043603/** \fn ProgramInfo::GetChannel(QString&,QString&) const
  • programs/mythbackend/mainserver.cpp

     
    15191519        (pginfo->filesize > 0) &&
    15201520        (!ds->forceMetadataDelete))
    15211521    {
    1522         VERBOSE(VB_IMPORTANT, QString("ERROR when trying to delete file: %1. File "
    1523                                 "doesn't exist.  Database metadata"
    1524                                 "will not be removed.")
    1525                                 .arg(ds->filename));
     1522        VERBOSE(VB_IMPORTANT, QString(
     1523                    "ERROR when trying to delete file: %1. File "
     1524                    "doesn't exist.  Database metadata"
     1525                    "will not be removed.")
     1526                .arg(ds->filename));
    15261527        gContext->LogEntry("mythbackend", LP_WARNING, "Delete Recording",
    15271528                           QString("File %1 does not exist for %2 when trying "
    15281529                                   "to delete recording.")
    1529                                    .arg(ds->filename).arg(logInfo));
     1530                           .arg(ds->filename).arg(logInfo));
    15301531
    15311532        pginfo->SetDeleteFlag(false);
    15321533        MythEvent me("RECORDING_LIST_CHANGE");
  • programs/mythlcdserver/lcdprocclient.cpp

     
    23762376    {
    23772377        MythEvent *me = (MythEvent *) e;
    23782378
    2379         if (me->Message().left(21) == "RECORDING_LIST_CHANGE")
     2379        if (me->Message().left(21) == "RECORDING_LIST_CHANGE" ||
     2380            me->Message() == "UPDATE_PROG_INFO")
    23802381        {
    23812382            if (lcd_showrecstatus && !updateRecInfoTimer->isActive())
    23822383            {
  • programs/mythwelcome/welcomedialog.cpp

     
    151151    {
    152152        MythEvent *me = (MythEvent *) e;
    153153
    154         if (me->Message().left(21) == "RECORDING_LIST_CHANGE")
     154        if (me->Message().left(21) == "RECORDING_LIST_CHANGE" ||
     155            me->Message() == "UPDATE_PROG_INFO")
    155156        {
    156             VERBOSE(VB_GENERAL, "MythWelcome received a RECORDING_LIST_CHANGE event");
     157            VERBOSE(VB_GENERAL, "MythWelcome received a "
     158                    "recording list change event");
    157159
    158160            QMutexLocker lock(&m_RecListUpdateMuxtex);
    159161