OSDN Git Service

Add Resolve to explore context menu
[tortoisegit/TortoiseGitJp.git] / src / Utils / ShellUpdater.cpp
index e7785a9..bbd8492 100644 (file)
 //\r
 #include "StdAfx.h"\r
 #include "Shellupdater.h"\r
-#include "../TSVNCache/CacheInterface.h"\r
+#include "../TGitCache/CacheInterface.h"\r
 #include "Registry.h"\r
+#include "git.h"\r
 \r
 CShellUpdater::CShellUpdater(void)\r
 {\r
-       m_hInvalidationEvent = CreateEvent(NULL, FALSE, FALSE, _T("TortoiseSVNCacheInvalidationEvent"));\r
+       m_hInvalidationEvent = CreateEvent(NULL, FALSE, FALSE, _T("TortoiseGitCacheInvalidationEvent"));\r
 }\r
 \r
 CShellUpdater::~CShellUpdater(void)\r
@@ -43,7 +44,7 @@ CShellUpdater& CShellUpdater::Instance()
 * Add a single path for updating.\r
 * The update will happen at some suitable time in the future\r
 */\r
-void CShellUpdater::AddPathForUpdate(const CTSVNPath& path)\r
+void CShellUpdater::AddPathForUpdate(const CTGitPath& path)\r
 {\r
        // Tell the shell extension to purge its cache - we'll redo this when \r
        // we actually do the shell-updates, but sometimes there's an earlier update, which\r
@@ -56,7 +57,7 @@ void CShellUpdater::AddPathForUpdate(const CTSVNPath& path)
 * Add a list of paths for updating.\r
 * The update will happen when the list is destroyed, at the end of execution\r
 */\r
-void CShellUpdater::AddPathsForUpdate(const CTSVNPathList& pathList)\r
+void CShellUpdater::AddPathsForUpdate(const CTGitPathList& pathList)\r
 {\r
        for(int nPath=0; nPath < pathList.GetCount(); nPath++)\r
        {\r
@@ -113,18 +114,20 @@ void CShellUpdater::UpdateShell()
                        NULL,     // don't set maximum bytes \r
                        NULL))    // don't set maximum time \r
                {\r
+                       CTGitPath path;\r
                        for(int nPath = 0; nPath < m_pathsForUpdating.GetCount(); nPath++)\r
                        {\r
-                               ATLTRACE(_T("Cache Item Update for %s (%d)\n"), m_pathsForUpdating[nPath].GetDirectory().GetWinPathString(), GetTickCount());\r
-                               if (!m_pathsForUpdating[nPath].IsDirectory())\r
+                               path.SetFromWin(g_Git.m_CurrentDir+_T("\\")+m_pathsForUpdating[nPath].GetWinPathString());\r
+                               ATLTRACE(_T("Cache Item Update for %s (%d)\n"), path.GetWinPathString(), GetTickCount());\r
+                               if (!path.IsDirectory())\r
                                {\r
                                        // send notifications to the shell for changed files - folders are updated by the cache itself.\r
-                                       SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, m_pathsForUpdating[nPath].GetWinPath(), NULL);\r
+                                       SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, path.GetWinPath(), NULL);\r
                                }\r
                                DWORD cbWritten; \r
                                TSVNCacheCommand cmd;\r
                                cmd.command = TSVNCACHECOMMAND_CRAWL;\r
-                               wcsncpy_s(cmd.path, MAX_PATH+1, m_pathsForUpdating[nPath].GetDirectory().GetWinPath(), MAX_PATH);\r
+                               wcsncpy_s(cmd.path, MAX_PATH+1, path.GetDirectory().GetWinPath(), MAX_PATH);\r
                                BOOL fSuccess = WriteFile( \r
                                        hPipe,                  // handle to pipe \r
                                        &cmd,                   // buffer to write from \r