Permalink
Browse files

[WIN32] changed: use const and init lists where appropriated + cosmet…

…ics.
  • Loading branch information...
1 parent c3a1fef commit be630d3e69f3f1948caa8839ca4b8e434de8ae77 @wsoltys wsoltys committed Jan 29, 2012
View
@@ -1033,10 +1033,7 @@ bool CApplication::InitDirectoriesWin32()
VECSOURCES::const_iterator it;
for(it=vShare.begin();it!=vShare.end();++it)
if(g_mediaManager.GetDriveStatus(it->strPath) == DRIVE_CLOSED_MEDIA_PRESENT)
- {
- CDetectDisc* discdetection = new CDetectDisc(it->strPath, false);
- CJobManager::GetInstance().AddJob(discdetection, NULL);
- }
+ CJobManager::GetInstance().AddJob(new CDetectDisc(it->strPath, false), NULL);
// remove end
return true;
@@ -530,10 +530,9 @@ const CStdString &CDetectDVDMedia::GetDVDPath()
return m_diskPath;
}
-CDetectDisc::CDetectDisc(const CStdString &strPath, bool bautorun)
+CDetectDisc::CDetectDisc(const CStdString &strPath, const bool bautorun)
+ : m_strPath(strPath), m_bautorun(bautorun)
{
- m_strPath = strPath;
- m_bautorun = bautorun;
}
bool CDetectDisc::DoWork()
@@ -97,7 +97,7 @@ class CDetectDVDMedia : public CThread
class CDetectDisc : public CJob
{
public:
- CDetectDisc(const CStdString &strPath, bool bautorun);
+ CDetectDisc(const CStdString &strPath, const bool bautorun);
bool DoWork();
private:
@@ -642,10 +642,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
case SHCNE_MEDIAINSERTED:
CLog::Log(LOGDEBUG, __FUNCTION__": Drive %s Media has arrived.", drivePath);
if (GetDriveType(drivePath) == DRIVE_CDROM)
- {
- CDetectDisc* discdetection = new CDetectDisc(drivePath, true);
- CJobManager::GetInstance().AddJob(discdetection, NULL);
- }
+ CJobManager::GetInstance().AddJob(new CDetectDisc(drivePath, true), NULL);
else
CWin32StorageProvider::SetEvent();
break;

0 comments on commit be630d3

Please sign in to comment.