From 88c2922b63a2b57a9340921acbe908d46377bf13 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 27 Jan 2012 17:43:29 +0100 Subject: [PATCH] Removed unused code and some cleanup Signed-off-by: Sven Strickroth --- src/TGitCache/CacheInterface.h | 10 +---- src/TGitCache/CachedDirectory.cpp | 6 --- src/TGitCache/CachedDirectory.h | 10 +---- src/TGitCache/StatusCacheEntry.cpp | 17 +------- src/TortoiseShell/ColumnProvider.cpp | 76 +----------------------------------- 5 files changed, 5 insertions(+), 114 deletions(-) diff --git a/src/TGitCache/CacheInterface.h b/src/TGitCache/CacheInterface.h index 614947c58..ced53ba11 100644 --- a/src/TGitCache/CacheInterface.h +++ b/src/TGitCache/CacheInterface.h @@ -1,7 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control // External Cache Copyright (C) 2005-2006,2008,2010 - TortoiseSVN -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -83,12 +83,6 @@ struct TGITCacheResponse { git_wc_status2_t m_status; git_wc_entry_t m_entry; - git_node_kind_t m_kind; - char m_url[INTERNET_MAX_URL_LENGTH+1]; - char m_owner[255]; ///< owner of the lock - char m_author[255]; - bool m_readonly; ///< whether the file is write protected or not - bool m_needslock; ///< whether the file has the svn:needs-lock property set or not (only works with the new working copy version) }; //#endif // SVN_WC_H @@ -108,7 +102,7 @@ struct TGITCacheCommand #define TGITCACHECOMMAND_REFRESHALL 2 ///< Refreshes the whole cache, usually necessary after the "treat unversioned files as modified" option changed. #define TGITCACHECOMMAND_RELEASE 3 ///< Releases all open handles for the specified path and all paths below #define TGITCACHECOMMAND_BLOCK 4 ///< Blocks a path from getting crawled for a specific amount of time or until the TSVNCACHECOMMAND_UNBLOCK command is sent for that path -#define TGITCACHECOMMAND_UNBLOCK 5 ///< Removes a path from the list of paths blocked from getting crawled +#define TGITCACHECOMMAND_UNBLOCK 5 ///< Removes a path from the list of paths blocked from getting crawled /// Set this flag if you already know whether or not the item is a folder diff --git a/src/TGitCache/CachedDirectory.cpp b/src/TGitCache/CachedDirectory.cpp index 7dd7b84c9..2a66662ec 100644 --- a/src/TGitCache/CachedDirectory.cpp +++ b/src/TGitCache/CachedDirectory.cpp @@ -28,7 +28,6 @@ CCachedDirectory::CCachedDirectory(void) { m_currentFullStatus = m_mostImportantFileStatus = git_wc_status_none; m_bRecursive = true; - m_indexFileTime = 0; } CCachedDirectory::~CCachedDirectory(void) @@ -83,8 +82,6 @@ BOOL CCachedDirectory::SaveToDisk(FILE * pFile) WRITEVALUETOFILE(status); } } - WRITEVALUETOFILE(m_indexFileTime); - WRITEVALUETOFILE(m_Head.m_hash); // WRITEVALUETOFILE(m_propsFileTime); value = m_directoryPath.GetWinPathString().GetLength(); WRITEVALUETOFILE(value); @@ -152,9 +149,6 @@ BOOL CCachedDirectory::LoadFromDisk(FILE * pFile) m_childDirectories[CTGitPath(sPath)] = status; } } - LOADVALUEFROMFILE(m_indexFileTime); - LOADVALUEFROMFILE(m_Head.m_hash); -// LOADVALUEFROMFILE(m_propsFileTime); LOADVALUEFROMFILE(value); if (value > MAX_PATH) return false; diff --git a/src/TGitCache/CachedDirectory.h b/src/TGitCache/CachedDirectory.h index 9d3d3d2a8..6afd7697f 100644 --- a/src/TGitCache/CachedDirectory.h +++ b/src/TGitCache/CachedDirectory.h @@ -1,7 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control // External Cache Copyright (C) 2005 - 2006, 2008 - TortoiseSVN -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -87,14 +87,6 @@ private: typedef std::map ChildDirStatus; ChildDirStatus m_childDirectories; - // The timestamp of the .git\index file. For an unversioned directory, this will be zero - __int64 m_indexFileTime; - CGitHash m_Head; - - std::vector<__int64> m_IgnoreFileTimeList; - // The timestamp of the .SVN\props dir. For an unversioned directory, this will be zero -// __int64 m_propsFileTime; - // The path of the directory with this object looks after CTGitPath m_directoryPath; diff --git a/src/TGitCache/StatusCacheEntry.cpp b/src/TGitCache/StatusCacheEntry.cpp index fb7826b0c..2ba3e8100 100644 --- a/src/TGitCache/StatusCacheEntry.cpp +++ b/src/TGitCache/StatusCacheEntry.cpp @@ -1,7 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control // External Cache Copyright (C) 2005-2006,2008 - TortoiseSVN -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -247,22 +247,7 @@ void CStatusCacheEntry::BuildCacheResponse(TGITCacheResponse& response, DWORD& r // the process which will be using the data. // The process which receives this response (generally the TSVN Shell Extension) // must fix-up these pointers when it gets them -// response.m_status.entry = NULL; -// response.m_entry.url = NULL; - - response.m_kind = m_kind; - response.m_readonly = m_bReadOnly; - - if (m_sPresentProps.Find("svn:needs-lock")>=0) - { - response.m_needslock = true; - } - else - response.m_needslock = false; // The whole of response has been zeroed, so this will copy safely - strncat_s(response.m_url, INTERNET_MAX_URL_LENGTH, m_sUrl, _TRUNCATE); - strncat_s(response.m_owner, 255, m_sOwner, _TRUNCATE); - strncat_s(response.m_author, 255, m_sAuthor, _TRUNCATE); responseLength = sizeof(response); } else diff --git a/src/TortoiseShell/ColumnProvider.cpp b/src/TortoiseShell/ColumnProvider.cpp index 9ce1fcd26..dc4d614ea 100644 --- a/src/TortoiseShell/ColumnProvider.cpp +++ b/src/TortoiseShell/ColumnProvider.cpp @@ -1,7 +1,7 @@ // TortoiseGit - a Windows shell extension for easy version control // Copyright (C) 2003-2008 - TortoiseSVN -// Copyright (C) 2008-2011 - TortoiseGit +// Copyright (C) 2008-2012 - TortoiseGit // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -274,88 +274,14 @@ void CShellExt::GetColumnStatus(const TCHAR * path, BOOL bIsDir) if (t == ShellCache::exe) { - columnauthor = UTF8ToWide(itemStatus.m_author); columnrev = itemStatus.m_entry.cmt_rev; - itemurl = UTF8ToWide(itemStatus.m_url); - owner = UTF8ToWide(itemStatus.m_owner); } else { if (status) { - columnauthor = UTF8ToWide(status->author); columnrev = status->rev; - itemurl = UTF8ToWide(status->url); - owner = UTF8ToWide(status->owner); } } -#if 0 - TCHAR urlpath[INTERNET_MAX_URL_LENGTH+1]; - - URL_COMPONENTS urlComponents; - memset(&urlComponents, 0, sizeof(URL_COMPONENTS)); - urlComponents.dwStructSize = sizeof(URL_COMPONENTS); - urlComponents.dwUrlPathLength = INTERNET_MAX_URL_LENGTH; - urlComponents.lpszUrlPath = urlpath; - if (InternetCrackUrl(itemurl.c_str(), 0, ICU_DECODE, &urlComponents)) - { - // since the short url is shown as an additional column where the - // file/foldername is shown too, we strip that name from the url - // to make the url even shorter. - TCHAR * ptr = _tcsrchr(urlComponents.lpszUrlPath, '/'); - if (ptr == NULL) - ptr = _tcsrchr(urlComponents.lpszUrlPath, '\\'); - if (ptr) - { - *ptr = '\0'; - // to shorten the url even more, we check for 'trunk', 'branches' and 'tags' - // and simply assume that these are the folders attached to the repository - // root. If we find those, we strip the whole path before those folders too. - // Note: this will strip too much if such a folder is *below* the repository - // root - but it's called 'short url' and we're free to shorten it the way we - // like :) - /*ptr = _tcsstr(urlComponents.lpszUrlPath, _T("/trunk")); - if (ptr == NULL) - ptr = _tcsstr(urlComponents.lpszUrlPath, _T("\\trunk")); - if ((ptr == NULL)||((*(ptr+6) != 0)&&(*(ptr+6) != '/')&&(*(ptr+6) != '\\'))) - { - ptr = _tcsstr(urlComponents.lpszUrlPath, _T("/branches")); - if (ptr == NULL) - ptr = _tcsstr(urlComponents.lpszUrlPath, _T("\\branches")); - if ((ptr == NULL)||((*(ptr+9) != 0)&&(*(ptr+9) != '/')&&(*(ptr+9) != '\\'))) - { - ptr = _tcsstr(urlComponents.lpszUrlPath, _T("/tags")); - if (ptr == NULL) - ptr = _tcsstr(urlComponents.lpszUrlPath, _T("\\tags")); - if ((ptr)&&(*(ptr+5) != 0)&&(*(ptr+5) != '/')&&(*(ptr+5) != '\\')) - ptr = NULL; - } - } - if (ptr) - itemshorturl = ptr; - else*/ - itemshorturl = urlComponents.lpszUrlPath; - } - else - itemshorturl = _T(" "); - } - else - itemshorturl = _T(" "); - - if (status) - { - char url[INTERNET_MAX_URL_LENGTH]; - strcpy_s(url, INTERNET_MAX_URL_LENGTH, status->url); - CPathUtils::Unescape(url); - itemurl = UTF8ToWide(url); - } - else if (t == ShellCache::exe) - { - char url[INTERNET_MAX_URL_LENGTH]; - strcpy_s(url, INTERNET_MAX_URL_LENGTH, itemStatus.m_url); - CPathUtils::Unescape(url); - itemurl = UTF8ToWide(url); - } -#endif } -- 2.11.4.GIT