Skip to content
This repository
Browse code

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

…ics.
  • Loading branch information...
commit be630d3e69f3f1948caa8839ca4b8e434de8ae77 1 parent c3a1fef
wsoltys authored January 29, 2012
5  xbmc/Application.cpp
@@ -1033,10 +1033,7 @@ bool CApplication::InitDirectoriesWin32()
1033 1033
   VECSOURCES::const_iterator it;
1034 1034
   for(it=vShare.begin();it!=vShare.end();++it)
1035 1035
     if(g_mediaManager.GetDriveStatus(it->strPath) == DRIVE_CLOSED_MEDIA_PRESENT)
1036  
-    {
1037  
-      CDetectDisc* discdetection = new CDetectDisc(it->strPath, false);
1038  
-      CJobManager::GetInstance().AddJob(discdetection, NULL);
1039  
-    }
  1036
+      CJobManager::GetInstance().AddJob(new CDetectDisc(it->strPath, false), NULL);
1040 1037
   // remove end
1041 1038
 
1042 1039
   return true;
5  xbmc/storage/DetectDVDType.cpp
@@ -530,10 +530,9 @@ const CStdString &CDetectDVDMedia::GetDVDPath()
530 530
   return m_diskPath;
531 531
 }
532 532
 
533  
-CDetectDisc::CDetectDisc(const CStdString &strPath, bool bautorun)
  533
+CDetectDisc::CDetectDisc(const CStdString &strPath, const bool bautorun)
  534
+  : m_strPath(strPath), m_bautorun(bautorun)
534 535
 {
535  
-  m_strPath  = strPath;
536  
-  m_bautorun = bautorun;
537 536
 }
538 537
 
539 538
 bool CDetectDisc::DoWork()
2  xbmc/storage/DetectDVDType.h
@@ -97,7 +97,7 @@ class CDetectDVDMedia : public CThread
97 97
 class CDetectDisc : public CJob
98 98
 {
99 99
 public:
100  
-  CDetectDisc(const CStdString &strPath, bool bautorun);
  100
+  CDetectDisc(const CStdString &strPath, const bool bautorun);
101 101
   bool DoWork();
102 102
 
103 103
 private:
5  xbmc/windowing/windows/WinEventsWin32.cpp
@@ -642,10 +642,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L
642 642
             case SHCNE_MEDIAINSERTED:
643 643
               CLog::Log(LOGDEBUG, __FUNCTION__": Drive %s Media has arrived.", drivePath);
644 644
               if (GetDriveType(drivePath) == DRIVE_CDROM)
645  
-              {
646  
-                CDetectDisc* discdetection = new CDetectDisc(drivePath, true);
647  
-                CJobManager::GetInstance().AddJob(discdetection, NULL);
648  
-              }
  645
+                CJobManager::GetInstance().AddJob(new CDetectDisc(drivePath, true), NULL);
649 646
               else
650 647
                 CWin32StorageProvider::SetEvent();
651 648
               break;

0 notes on commit be630d3

Please sign in to comment.
Something went wrong with that request. Please try again.