Skip to content

Commit

Permalink
Coverity: m_SendEvent not init'd after 972a8d2
Browse files Browse the repository at this point in the history
(which removed it from everywhere except OS X code)
  • Loading branch information
NigelPearson committed May 27, 2013
1 parent 4265bb7 commit 314f267
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
31 changes: 11 additions & 20 deletions mythtv/libs/libmyth/mediamonitor-darwin.cpp
Expand Up @@ -461,16 +461,12 @@ void MonitorThreadDarwin::diskRemove(QString devName)
LOG(VB_MEDIA, LOG_DEBUG,
QString("MonitorThreadDarwin::diskRemove(%1)").arg(devName));

if (m_Monitor->m_SendEvent)
{
MythMediaDevice *pDevice = m_Monitor->GetMedia(devName);
MythMediaDevice *pDevice = m_Monitor->GetMedia(devName);

if (pDevice) // Probably should ValidateAndLock() here?
pDevice->setStatus(MEDIASTAT_NODISK);
else
LOG(VB_MEDIA, LOG_INFO,
"Couldn't find MythMediaDevice: " + devName);
}
if (pDevice) // Probably should ValidateAndLock() here?
pDevice->setStatus(MEDIASTAT_NODISK);
else
LOG(VB_MEDIA, LOG_INFO, "Couldn't find MythMediaDevice: " + devName);

m_Monitor->RemoveDevice(devName);
}
Expand All @@ -492,15 +488,13 @@ void MonitorThreadDarwin::diskRename(const char *devName, const char *volName)
if (m_Monitor->ValidateAndLock(pDevice))
{
// Send message to plugins to ignore this drive:
if (m_Monitor->m_SendEvent)
pDevice->setStatus(MEDIASTAT_NODISK);
pDevice->setStatus(MEDIASTAT_NODISK);

pDevice->setVolumeID(volName);
pDevice->setMountPath((QString("/Volumes/") + volName).toLatin1());

// Plugins can now use it again:
if (m_Monitor->m_SendEvent)
pDevice->setStatus(MEDIASTAT_USEABLE);
pDevice->setStatus(MEDIASTAT_USEABLE);

m_Monitor->Unlock(pDevice);
}
Expand Down Expand Up @@ -560,13 +554,10 @@ bool MediaMonitorDarwin::AddDevice(MythMediaDevice* pDevice)

// Devices on Mac OS X don't change status the way Linux ones do,
// so we force a status change for mediaStatusChanged() to send an event
if (m_SendEvent)
{
pDevice->setStatus(MEDIASTAT_NODISK);
connect(pDevice, SIGNAL(statusChanged(MythMediaStatus, MythMediaDevice*)),
this, SLOT(mediaStatusChanged(MythMediaStatus, MythMediaDevice*)));
pDevice->setStatus(MEDIASTAT_USEABLE);
}
pDevice->setStatus(MEDIASTAT_NODISK);
connect(pDevice, SIGNAL(statusChanged(MythMediaStatus, MythMediaDevice*)),
this, SLOT(mediaStatusChanged(MythMediaStatus, MythMediaDevice*)));
pDevice->setStatus(MEDIASTAT_USEABLE);


return true;
Expand Down
2 changes: 0 additions & 2 deletions mythtv/libs/libmyth/mythmediamonitor.h
Expand Up @@ -116,8 +116,6 @@ class MPUBLIC MediaMonitor : public QObject
QStringList m_IgnoreList;

bool m_Active; ///< Was MonitorThread started?
bool m_SendEvent; ///< Send MediaEvent to plugins?

MonitorThread *m_Thread;
unsigned long m_MonitorPollingInterval;
bool m_AllowEject;
Expand Down

0 comments on commit 314f267

Please sign in to comment.