31 changes: 17 additions & 14 deletions mythtv/programs/mythbackend/mainserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1365,8 +1365,8 @@ void MainServer::HandleAnnounce(QStringList &slist, QStringList commands,
sockListLock.unlock();

if (eventsMode != kPBSEvents_None && commands[2] != "tzcheck")
SendMythSystemEvent(QString("CLIENT_CONNECTED HOSTNAME %1")
.arg(commands[2]));
gCoreContext->SendSystemEvent(
QString("CLIENT_CONNECTED HOSTNAME %1").arg(commands[2]));
}
if (commands[1] == "MediaServer")
{
Expand All @@ -1386,8 +1386,8 @@ void MainServer::HandleAnnounce(QStringList &slist, QStringList commands,
playbackList.push_back(pbs);
sockListLock.unlock();

SendMythSystemEvent(QString("CLIENT_CONNECTED HOSTNAME %1")
.arg(commands[2]));
gCoreContext->SendSystemEvent(
QString("CLIENT_CONNECTED HOSTNAME %1").arg(commands[2]));
}
else if (commands[1] == "SlaveBackend")
{
Expand Down Expand Up @@ -1454,8 +1454,8 @@ void MainServer::HandleAnnounce(QStringList &slist, QStringList commands,

autoexpireUpdateTimer->start(1000);

SendMythSystemEvent(QString("SLAVE_CONNECTED HOSTNAME %1")
.arg(commands[2]));
gCoreContext->SendSystemEvent(
QString("SLAVE_CONNECTED HOSTNAME %1").arg(commands[2]));
}
else if (commands[1] == "FileTransfer")
{
Expand Down Expand Up @@ -2107,7 +2107,7 @@ void MainServer::DoDeleteInDB(DeleteStruct *ds)
// Notify the frontend so it can requery for Free Space
QString msg = QString("RECORDING_LIST_CHANGE DELETE %1 %2")
.arg(ds->m_chanid).arg(ds->m_recstartts.toString(Qt::ISODate));
RemoteSendEvent(MythEvent(msg));
gCoreContext->SendEvent(MythEvent(msg));

// sleep a little to let frontends reload the recordings list
sleep(3);
Expand Down Expand Up @@ -2621,9 +2621,10 @@ void MainServer::DoHandleDeleteRecording(
// Tell MythTV frontends that the recording list needs to be updated.
if (fileExists || !recinfo.GetFilesize() || forceMetadataDelete)
{
SendMythSystemEvent(QString("REC_DELETED CHANID %1 STARTTIME %2")
.arg(recinfo.GetChanID())
.arg(recinfo.GetRecordingStartTime(ISODate)));
gCoreContext->SendSystemEvent(
QString("REC_DELETED CHANID %1 STARTTIME %2")
.arg(recinfo.GetChanID())
.arg(recinfo.GetRecordingStartTime(ISODate)));

recinfo.SendDeletedEvent();
}
Expand Down Expand Up @@ -5702,13 +5703,15 @@ void MainServer::connectionClosed(MythSocket *socket)
MythEvent me2("RECORDING_LIST_CHANGE");
gCoreContext->dispatch(me2);

SendMythSystemEvent(QString("SLAVE_DISCONNECTED HOSTNAME %1")
.arg(pbs->getHostname()));
gCoreContext->SendSystemEvent(
QString("SLAVE_DISCONNECTED HOSTNAME %1")
.arg(pbs->getHostname()));
}
else if (ismaster && pbs->getHostname() != "tzcheck")
{
SendMythSystemEvent(QString("CLIENT_DISCONNECTED HOSTNAME %1")
.arg(pbs->getHostname()));
gCoreContext->SendSystemEvent(
QString("CLIENT_DISCONNECTED HOSTNAME %1")
.arg(pbs->getHostname()));
}

LiveTVChain *chain;
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythbackend/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2092,7 +2092,7 @@ bool Scheduler::HandleReschedule(void)
p->future = false;
}

SendMythSystemEvent("SCHEDULER_RAN");
gCoreContext->SendSystemEvent("SCHEDULER_RAN");

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythcommflag/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ static void commDetectorGotNewCommercialBreakList(void)
LOG(VB_COMMFLAG, LOG_INFO,
QString("mythcommflag sending update: %1").arg(message));

RemoteSendMessage(message);
gCoreContext->SendMessage(message);
}

static void incomingCustomEvent(QEvent* e)
Expand Down Expand Up @@ -574,7 +574,7 @@ static int DoFlagCommercials(
"mythcommflag sending COMMFLAG_START notification");
QString message = "COMMFLAG_START ";
message += program_info->MakeUniqueKey();
RemoteSendMessage(message);
gCoreContext->SendMessage(message);
}

bool result = commDetector->go();
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfilldatabase/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@ int main(int argc, char *argv[])
if (grab_data || mark_repeats)
ScheduledRecording::signalChange(-1);

RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");

SendMythSystemEvent("MYTHFILLDATABASE_RAN");
gCoreContext->SendSystemEvent("MYTHFILLDATABASE_RAN");

LOG(VB_GENERAL, LOG_NOTICE, "mythfilldatabase run complete.");

Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfrontend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ static void TVMenuCallback(void *data, QString &selection)
GetMythUI()->RemoveCurrentLocation();

gCoreContext->ActivateSettingsCache(true);
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");

if (sel == "settings general" ||
sel == "settings generalrecpriorities")
Expand Down Expand Up @@ -1395,7 +1395,7 @@ static void resetAllKeys(void)

static void signal_USR1_handler(int){
LOG(VB_GENERAL, LOG_NOTICE, "SIGUSR1 received, reloading theme");
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->ActivateSettingsCache(false);
GetMythMainWindow()->JumpTo("Reload Theme");
gCoreContext->ActivateSettingsCache(true);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfrontend/networkcontrol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ void NetworkControl::deleteClient(void)
LOG(VB_GENERAL, LOG_INFO, LOC + "Client Socket disconnected");
QMutexLocker locker(&clientLock);

SendMythSystemEvent("NET_CTRL_DISCONNECTED");
gCoreContext->SendSystemEvent("NET_CTRL_DISCONNECTED");

QList<NetworkControlClient *>::const_iterator it;
for (it = clients.begin(); it != clients.end(); ++it)
Expand Down Expand Up @@ -359,7 +359,7 @@ void NetworkControl::newConnection()

LOG(VB_GENERAL, LOG_INFO, LOC + QString("New connection established."));

SendMythSystemEvent("NET_CTRL_CONNECTED");
gCoreContext->SendSystemEvent("NET_CTRL_CONNECTED");

QTcpSocket *client = this->nextPendingConnection();
NetworkControlClient *ncc = new NetworkControlClient(client);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythfrontend/themechooser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ void ThemeChooser::customEvent(QEvent *e)
QString event = QString("THEME_INSTALLED PATH %1")
.arg(GetConfDir() + "/themes/" +
m_downloadTheme->GetDirectoryName());
SendMythSystemEvent(event);
gCoreContext->SendSystemEvent(event);

gCoreContext->SaveSetting("Theme", m_downloadTheme->GetDirectoryName());
GetMythMainWindow()->JumpTo("Reload Theme");
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythshutdown/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ static int unlockShutdown()
MythDB::DBError("unlockShutdown -- unlock", query);

// tell the master BE to reset its idle time
RemoteSendMessage("RESET_IDLETIME");
gCoreContext->SendMessage("RESET_IDLETIME");

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythtv-setup/exitprompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void ExitPrompter::quit()
// No need to run this if the backend has just restarted
if (gCoreContext->BackendIsRunning())
{
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
}
}

Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythutil/backendutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static int RawSendEvent(const QString &eventString)

if (gCoreContext->ConnectToMasterServer(false, false))
{
RemoteSendMessage(eventString);
gCoreContext->SendMessage(eventString);
return GENERIC_EXIT_OK;
}
return GENERIC_EXIT_CONNECT_ERROR;
Expand All @@ -24,7 +24,7 @@ static int ClearSettingsCache(const MythUtilCommandLineParser &cmdline)
{
if (gCoreContext->ConnectToMasterServer(false, false))
{
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
LOG(VB_GENERAL, LOG_INFO, "Sent CLEAR_SETTINGS_CACHE message");
return GENERIC_EXIT_OK;
}
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythwelcome/welcomedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
MythWelcomeSettings settings;
if (kDialogCodeAccepted == settings.exec())
{
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
updateStatus();
updateScreen();

Expand All @@ -262,7 +262,7 @@ bool WelcomeDialog::keyPressEvent(QKeyEvent *event)
{
MythShutdownSettings settings;
if (kDialogCodeAccepted == settings.exec())
RemoteSendMessage("CLEAR_SETTINGS_CACHE");
gCoreContext->SendMessage("CLEAR_SETTINGS_CACHE");
}
else if (action == "0")
{
Expand Down