OSDN Git Service

made wingit.dll delay load so that PATH can be inited with git/bin dir before dll...
[tortoisegit/TortoiseGitJp.git] / src / TGitCache / DirectoryWatcher.cpp
index d15094d..a2cdfb2 100644 (file)
@@ -18,7 +18,7 @@
 //\r
 #include "StdAfx.h"\r
 #include "Dbt.h"\r
-#include "SVNStatusCache.h"\r
+#include "GitStatusCache.h"\r
 #include ".\directorywatcher.h"\r
 \r
 extern HWND hWnd;\r
@@ -84,7 +84,7 @@ void CDirectoryWatcher::SetFolderCrawler(CFolderCrawler * crawler)
        m_FolderCrawler = crawler;\r
 }\r
 \r
-bool CDirectoryWatcher::RemovePathAndChildren(const CTSVNPath& path)\r
+bool CDirectoryWatcher::RemovePathAndChildren(const CTGitPath& path)\r
 {\r
        bool bRemoved = false;\r
        AutoLocker lock(m_critSec);\r
@@ -101,7 +101,7 @@ repeat:
        return bRemoved;\r
 }\r
 \r
-void CDirectoryWatcher::BlockPath(const CTSVNPath& path)\r
+void CDirectoryWatcher::BlockPath(const CTGitPath& path)\r
 {\r
        blockedPath = path;\r
        // block the path from being watched for 4 seconds\r
@@ -109,9 +109,9 @@ void CDirectoryWatcher::BlockPath(const CTSVNPath& path)
        ATLTRACE(_T("Blocking path: %s\n"), path.GetWinPath());\r
 }\r
 \r
-bool CDirectoryWatcher::AddPath(const CTSVNPath& path)\r
+bool CDirectoryWatcher::AddPath(const CTGitPath& path)\r
 {\r
-       if (!CSVNStatusCache::Instance().IsPathAllowed(path))\r
+       if (!CGitStatusCache::Instance().IsPathAllowed(path))\r
                return false;\r
        if ((!blockedPath.IsEmpty())&&(blockedPath.IsAncestorOf(path)))\r
        {\r
@@ -129,7 +129,7 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
        }\r
        \r
        // now check if with the new path we might have a new root\r
-       CTSVNPath newroot;\r
+       CTGitPath newroot;\r
        for (int i=0; i<watchedPaths.GetCount(); ++i)\r
        {\r
                const CString& watched = watchedPaths[i].GetWinPathString();\r
@@ -144,11 +144,11 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
                                {\r
                                        if (sPath.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(sPath.Left(len));\r
+                                               newroot = CTGitPath(sPath.Left(len));\r
                                        }\r
                                        else if (watched.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(watched.Left(len));\r
+                                               newroot = CTGitPath(watched.Left(len));\r
                                        }\r
                                }\r
                                break;\r
@@ -176,11 +176,11 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
                                {\r
                                        if (sPath.GetAt(len)=='\\')\r
                                        {\r
-                                               newroot = CTSVNPath(watched);\r
+                                               newroot = CTGitPath(watched);\r
                                        }\r
                                        else if (watched.GetLength() == 3 && watched[1] == ':')\r
                                        {\r
-                                               newroot = CTSVNPath(watched);\r
+                                               newroot = CTGitPath(watched);\r
                                        }\r
                                }\r
                        }\r
@@ -202,7 +202,7 @@ bool CDirectoryWatcher::AddPath(const CTSVNPath& path)
        return true;\r
 }\r
 \r
-bool CDirectoryWatcher::IsPathWatched(const CTSVNPath& path)\r
+bool CDirectoryWatcher::IsPathWatched(const CTGitPath& path)\r
 {\r
        for (int i=0; i<watchedPaths.GetCount(); ++i)\r
        {\r
@@ -255,7 +255,7 @@ void CDirectoryWatcher::WorkerThread()
                                m_hCompPort = NULL;\r
                                for (int i=0; i<watchedPaths.GetCount(); ++i)\r
                                {\r
-                                       CTSVNPath watchedPath = watchedPaths[i];\r
+                                       CTGitPath watchedPath = watchedPaths[i];\r
 \r
                                        HANDLE hDir = CreateFile(watchedPath.GetWinPath(), \r
                                                                                        FILE_LIST_DIRECTORY, \r
@@ -394,7 +394,7 @@ void CDirectoryWatcher::WorkerThread()
                                                                continue;\r
                                                        }\r
                                                        ATLTRACE(_T("change notification: %s\n"), buf);\r
-                                                       m_FolderCrawler->AddPathForUpdate(CTSVNPath(buf));\r
+                                                       m_FolderCrawler->AddPathForUpdate(CTGitPath(buf));\r
                                                }\r
                                                if ((ULONG_PTR)pnotify - (ULONG_PTR)pdi->m_Buffer > READ_DIR_CHANGE_BUFFER_SIZE)\r
                                                        break;\r
@@ -443,9 +443,9 @@ void CDirectoryWatcher::ClearInfoMap()
        m_hCompPort = INVALID_HANDLE_VALUE;\r
 }\r
 \r
-CTSVNPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)\r
+CTGitPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)\r
 {\r
-       CTSVNPath path;\r
+       CTGitPath path;\r
        if (watchInfoMap.size() == 0)\r
                return path;\r
        AutoLocker lock(m_critSec);\r
@@ -467,7 +467,7 @@ CTSVNPath CDirectoryWatcher::CloseInfoMap(HDEVNOTIFY hdev)
        return path;\r
 }\r
 \r
-bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)\r
+bool CDirectoryWatcher::CloseHandlesForPath(const CTGitPath& path)\r
 {\r
        if (watchInfoMap.size() == 0)\r
                return false;\r
@@ -475,7 +475,7 @@ bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)
        for (std::map<HANDLE, CDirWatchInfo *>::iterator I = watchInfoMap.begin(); I != watchInfoMap.end(); ++I)\r
        {\r
                CDirectoryWatcher::CDirWatchInfo * info = I->second;\r
-               CTSVNPath p = CTSVNPath(info->m_DirPath);\r
+               CTGitPath p = CTGitPath(info->m_DirPath);\r
                if (path.IsAncestorOf(p))\r
                {\r
                        RemovePathAndChildren(p);\r
@@ -490,7 +490,7 @@ bool CDirectoryWatcher::CloseHandlesForPath(const CTSVNPath& path)
        return true;\r
 }\r
 \r
-CDirectoryWatcher::CDirWatchInfo::CDirWatchInfo(HANDLE hDir, const CTSVNPath& DirectoryName) :\r
+CDirectoryWatcher::CDirWatchInfo::CDirWatchInfo(HANDLE hDir, const CTGitPath& DirectoryName) :\r
        m_hDir(hDir),\r
        m_DirName(DirectoryName)\r
 {\r