Changeset 96a91ceb5f75…
Parent cc550392c3af…
by
Changes to 12 files · Browse files at 96a91ceb5f75 Showing diff from parent cc550392c3af Diff from another changeset...
|
|
@@ -128,7 +128,7 @@ void CTortoiseHgCmenuBase::AddMenuList(UINT idCmd, const CString& name)
{
ATLTRACE("AddMenuList: idCmd = %d, name = '%s'\n", idCmd, name);
- myMenuIdMap[idCmd] = myDescMap[name];
+ m_mapMenuId[idCmd] = m_mapMenuDesc[name];
}
@@ -161,7 +161,7 @@
void CTortoiseHgCmenuBase::InitMenuMaps(const CMenuDescription *menuDescs, int sz)
{
- if (myDescMap.IsEmpty())
+ if (m_mapMenuDesc.IsEmpty())
{
CString lang;
GetRegistryConfig("CMenuLang", lang);
@@ -182,12 +182,12 @@ if (!lang.IsEmpty())
GetCMenuTranslation(lang, md.name, md.menuText, md.helpText);
- myDescMap[md.name] = md;
+ m_mapMenuDesc[md.name] = md;
}
}
- myMenuIdMap.RemoveAll();
+ m_mapMenuId.RemoveAll();
}
@@ -289,7 +289,7 @@void CTortoiseHgCmenuBase::InsertMenuItemByName(HMENU hMenu, const CString& name, UINT indexMenu,
UINT idCmd, UINT idCmdFirst, const CStringW& prefix)
{
- const CMenuDescriptionMap::CPair* pPair = myDescMap.Lookup(name);
+ const CMenuDescriptionMap::CPair* pPair = m_mapMenuDesc.Lookup(name);
if (pPair == NULL)
{
ATLTRACE("***** InsertMenuItemByName: can't find menu info for '%s'\n", (LPCTSTR)name);
@@ -418,16 +418,16 @@ Tokenize(promoted_string, promoted, ",");
// Select menu to show
- bool fileMenu = !myFiles.IsEmpty();
+ bool fileMenu = !m_arrFiles.IsEmpty();
bool isHgrepo = false;
CString cwd;
- if (!myFolder.IsEmpty())
+ if (!m_strFolder.IsEmpty())
{
- cwd = myFolder;
+ cwd = m_strFolder;
}
else if (fileMenu)
{
- cwd = ::PathIsDirectory(myFiles[0]) ? myFiles[0] : DirName(myFiles[0]);
+ cwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
}
if (!cwd.IsEmpty())
@@ -435,11 +435,11 @@ // check if target directory is a Mercurial repository
CString root = GetHgRepoRoot(cwd);
isHgrepo = !root.IsEmpty();
- if (myFiles.GetCount() == 1 && root == myFiles[0])
+ if (m_arrFiles.GetCount() == 1 && root == m_arrFiles[0])
{
fileMenu = false;
- myFolder = cwd;
- myFiles.RemoveAll();
+ m_strFolder = cwd;
+ m_arrFiles.RemoveAll();
}
}
@@ -547,7 +547,7 @@ {
UINT idCmd = LOWORD(lpcmi->lpVerb);
ATLTRACE("CTortoiseHgCmenuBase::InvokeCommand: idCmd = %d\n", idCmd);
- const CMenuIdCmdMap::CPair* p = myMenuIdMap.Lookup(idCmd);
+ const CMenuIdCmdMap::CPair* p = m_mapMenuId.Lookup(idCmd);
if (p != NULL)
{
RunDialog(p->m_value.name);
@@ -595,7 +595,7 @@ ATLTRACE("CTortoiseHgCmenuBase::GetCommandString: idCmd = %d, uFlags = %d (%s), "
"cchMax = %d\n", idCmd, uFlags, sflags, cchMax);
- const CMenuIdCmdMap::CPair* p = myMenuIdMap.Lookup((UINT)idCmd);
+ const CMenuIdCmdMap::CPair* p = m_mapMenuId.Lookup((UINT)idCmd);
if (p == NULL)
{
ATLTRACE("***** CTortoiseHgCmenuBase::GetCommandString: idCmd not found\n");
@@ -768,13 +768,13 @@ hgcmd = Quote(hgcmd) + " --nofork " + cmd;
CString cwd;
- if (!myFolder.IsEmpty())
+ if (!m_strFolder.IsEmpty())
{
- cwd = myFolder;
+ cwd = m_strFolder;
}
- else if (!myFiles.IsEmpty())
+ else if (!m_arrFiles.IsEmpty())
{
- cwd = ::PathIsDirectory(myFiles[0]) ? myFiles[0] : DirName(myFiles[0]);
+ cwd = ::PathIsDirectory(m_arrFiles[0]) ? m_arrFiles[0] : DirName(m_arrFiles[0]);
}
else
{
@@ -793,7 +793,7 @@ return;
}
- if (!myFiles.IsEmpty())
+ if (!m_arrFiles.IsEmpty())
{
CString tempfile = GetTemporaryFile();
if (tempfile.IsEmpty())
@@ -813,11 +813,11 @@ return;
}
- for (int i = 0; i < myFiles.GetCount(); i++)
+ for (int i = 0; i < m_arrFiles.GetCount(); i++)
{
DWORD dwWritten;
- ATLTRACE("RunDialog: temp file adding '%s'\n", (LPCTSTR)myFiles[i]);
- WriteFile(tempfileHandle, (LPCTSTR)myFiles[i], myFiles[i].GetLength(), &dwWritten, 0);
+ ATLTRACE("RunDialog: temp file adding '%s'\n", (LPCTSTR)m_arrFiles[i]);
+ WriteFile(tempfileHandle, (LPCTSTR)m_arrFiles[i], m_arrFiles[i].GetLength(), &dwWritten, 0);
WriteFile(tempfileHandle, "\n", 1, &dwWritten, 0);
}
CloseHandle(tempfileHandle);
@@ -871,8 +871,8 @@
PrintDebugHeader(pIDFolder, pDataObj);
- myFolder.Empty();
- myFiles.RemoveAll();
+ m_strFolder.Empty();
+ m_arrFiles.RemoveAll();
if (pDataObj)
{
@@ -890,7 +890,7 @@ if (DragQueryFile(hDrop, i, name, MAX_PATH) > 0)
{
ATLTRACE(" DragQueryFile [%d] = '%s'\n", i, name);
- myFiles.Add(name);
+ m_arrFiles.Add(name);
}
}
}
@@ -917,12 +917,12 @@ {
SHGetPathFromIDList(pIDFolder, name);
ATLTRACE(" Folder '%s'\n", name);
- myFolder = name;
+ m_strFolder = name;
}
// disable context menu if neither the folder nor the files
// have been found
- if (myFolder.IsEmpty() && myFiles.IsEmpty()) {
+ if (m_strFolder.IsEmpty() && m_arrFiles.IsEmpty()) {
ATLTRACE(" shell extension not available on this object\n");
return E_FAIL;
} else {
|
@@ -19,10 +19,10 @@ public IShellExtInit
{
protected:
- CAtlArray<CString> myFiles;
- CString myFolder;
- CMenuDescriptionMap myDescMap;
- CMenuIdCmdMap myMenuIdMap;
+ CAtlArray<CString> m_arrFiles;
+ CString m_strFolder;
+ CMenuDescriptionMap m_mapMenuDesc;
+ CMenuIdCmdMap m_mapMenuId;
virtual void RunDialog(const CString& cmd);
|
@@ -72,7 +72,7 @@ {
if (cmd == "drag_move" || cmd == "drag_copy") {
//Append the current directory as the dest
- myFiles.Add(myFolder);
+ m_arrFiles.Add(m_strFolder);
}
CTortoiseHgCmenuBase::RunDialog(cmd);
}
@@ -85,21 +85,21 @@
PrintDebugHeader(pIDFolder, pDataObj);
- myFolder.Empty();
- myFiles.RemoveAll();
+ m_strFolder.Empty();
+ m_arrFiles.RemoveAll();
// if a directory background
if (pIDFolder)
{
SHGetPathFromIDList(pIDFolder, name);
ATLTRACE(" Folder '%s'\n", name);
- myFolder = name;
+ m_strFolder = name;
}
CString root;
//short circuit if we're dragging into a non-Hg repository
- if (myFolder.IsEmpty() || (root = GetHgRepoRoot(myFolder)).IsEmpty())
+ if (m_strFolder.IsEmpty() || (root = GetHgRepoRoot(m_strFolder)).IsEmpty())
{
ATLTRACE(" drag into a non-Hg repos directory\n");
return E_FAIL;
@@ -124,10 +124,10 @@ if (GetHgRepoRoot(name) != root)
{
ATLTRACE(" '%s' isn't in target dir repository\n", name);
- myFiles.RemoveAll();
+ m_arrFiles.RemoveAll();
break;
}
- myFiles.Add(name);
+ m_arrFiles.Add(name);
}
}
}
@@ -151,7 +151,7 @@
// disable context menu if neither the folder nor the files
// have been found
- if (myFiles.IsEmpty()) {
+ if (m_arrFiles.IsEmpty()) {
ATLTRACE(" shell extension not available on this object\n");
return E_FAIL;
} else {
|
@@ -11,7 +11,7 @@ STDMETHODIMP CTortoiseHgOverlay::GetOverlayInfo(
LPWSTR pwszIconFile, int cchMax, int *pIndex, DWORD *pdwFlags)
{
- ATLTRACE("CShellExtOverlay::GetOverlayInfo: myTortoiseClass = '%c'\n", myTortoiseClass);
+ ATLTRACE("CShellExtOverlay::GetOverlayInfo: myTortoiseClass = '%c'\n", m_chTortoiseClass);
// icons are determined by TortoiseOverlays shim
*pIndex = 0;
*pdwFlags = 0;
@@ -56,14 +56,14 @@ }
char filterStatus = 0;
- if (myTortoiseClass == 'A')
+ if (m_chTortoiseClass == 'A')
filterStatus = 'A';
char status = 0;
- if (!HgQueryDirstate(myTortoiseClass, path, filterStatus, status))
+ if (!HgQueryDirstate(m_chTortoiseClass, path, filterStatus, status))
return S_FALSE;
- if (status == myTortoiseClass)
+ if (status == m_chTortoiseClass)
return S_OK;
return S_FALSE;
@@ -71,7 +71,7 @@
CTortoiseHgOverlay::CTortoiseHgOverlay(char tortoiseClass) :
- myTortoiseClass(tortoiseClass)
+ m_chTortoiseClass(tortoiseClass)
{
}
|
@@ -7,7 +7,7 @@ {
static CComAutoCriticalSection m_cs;
- const char myTortoiseClass;
+ const char m_chTortoiseClass;
protected:
explicit CTortoiseHgOverlay(char Class);
|
|
|
@@ -24,23 +24,23 @@
CDirectory::CDirectory(CDirectory* p, const CString& n, const CString& basepath) :
- parent_(p), name_(n)
+ m_pParent(p), m_strName(n)
{
if (n.IsEmpty())
- path_ = basepath;
+ m_strPath = basepath;
else if (basepath.IsEmpty())
- path_ = n;
+ m_strPath = n;
else
- path_ = basepath + '/' + n;
+ m_strPath = basepath + '/' + n;
}
CDirectory::~CDirectory()
{
- POSITION position = subdirs_.GetHeadPosition();
+ POSITION position = m_listSubdirs.GetHeadPosition();
while (position != NULL)
{
- delete subdirs_.GetNext(position);
+ delete m_listSubdirs.GetNext(position);
}
}
@@ -86,17 +86,17 @@
if (base.IsEmpty())
{
- e.name = n;
- cur->files_.AddTail(e);
+ e.m_strName = n;
+ cur->m_listFiles.AddTail(e);
return 1;
}
CDirectory* d = 0;
- POSITION position = cur->subdirs_.GetHeadPosition();
+ POSITION position = cur->m_listSubdirs.GetHeadPosition();
while (position != NULL)
{
- CDirectory* pItem = cur->subdirs_.GetNext(position);
- if (pItem->name_ == base) {
+ CDirectory* pItem = cur->m_listSubdirs.GetNext(position);
+ if (pItem->m_strName == base) {
d = pItem;
break;
}
@@ -105,7 +105,7 @@ if (!d)
{
d = new CDirectory(cur, base, cur->Path());
- cur->subdirs_.AddTail(d);
+ cur->m_listSubdirs.AddTail(d);
}
n = rest;
@@ -134,21 +134,21 @@
if (base.IsEmpty())
{
- POSITION position = cur->files_.GetHeadPosition();
+ POSITION position = cur->m_listFiles.GetHeadPosition();
while (position != NULL)
{
- const CDirentry& rItem = cur->files_.GetNext(position);
- if (rItem.name == n)
+ const CDirentry& rItem = cur->m_listFiles.GetNext(position);
+ if (rItem.m_strName == n)
return &rItem;
}
return 0;
}
- POSITION position = cur->subdirs_.GetHeadPosition();
+ POSITION position = cur->m_listSubdirs.GetHeadPosition();
while (position != NULL)
{
- CDirectory* pItem = cur->subdirs_.GetNext(position);
- if (pItem->name_ == base)
+ CDirectory* pItem = cur->m_listSubdirs.GetNext(position);
+ if (pItem->m_strName == base)
{
cur = pItem;
n = rest;
@@ -182,11 +182,11 @@ const bool leaf = base.IsEmpty();
const CString& searchstr = (leaf ? n : base);
- POSITION position = cur->subdirs_.GetHeadPosition();
+ POSITION position = cur->m_listSubdirs.GetHeadPosition();
while (position != NULL)
{
- CDirectory* pItem = cur->subdirs_.GetNext(position);
- if (pItem->name_ == searchstr)
+ CDirectory* pItem = cur->m_listSubdirs.GetNext(position);
+ if (pItem->m_strName == searchstr)
{
if (leaf)
return pItem;
@@ -203,10 +203,10 @@
void CDirectory::Print() const
{
- POSITION position = subdirs_.GetHeadPosition();
+ POSITION position = m_listSubdirs.GetHeadPosition();
while (position != NULL)
{
- const CDirectory* d = subdirs_.GetNext(position);
+ const CDirectory* d = m_listSubdirs.GetNext(position);
if (!d)
{
ATLTRACE("Directory('%s')::print: error: d is 0\n", (LPCTSTR)Path());
@@ -221,12 +221,12 @@ CString s;
char ctime_res[26];
- position = files_.GetHeadPosition();
+ position = m_listFiles.GetHeadPosition();
while (position != NULL)
{
- const CDirentry& rItem = files_.GetNext(position);
- CString p = (!base.IsEmpty() ? base + "/" + rItem.name : rItem.name);
- t = rItem.mtime;
+ const CDirentry& rItem = m_listFiles.GetNext(position);
+ CString p = (!base.IsEmpty() ? base + "/" + rItem.m_strName : rItem.m_strName);
+ t = rItem.m_uMTime;
errno_t err = ctime_s(ctime_res, 26, &t);
if (err == 0) {
s = ctime_res;
@@ -235,7 +235,7 @@ else {
s = "unset";
}
- printf("%c %6o %10u %-24s %s\n", rItem.state, rItem.mode, rItem.size,
+ printf("%c %6o %10u %-24s %s\n", rItem.m_chState, rItem.m_uMode, rItem.m_uSize,
(LPCTSTR)s, (LPCTSTR)p);
}
}
|
@@ -22,18 +22,18 @@
class CDirectory
{
- CDirectory* const parent_;
- const CString name_;
- CString path_;
+ const CDirectory* m_pParent;
+ CString m_strName;
+ CString m_strPath;
- CAtlList<CDirectory*> subdirs_;
- CAtlList<CDirentry> files_;
+ CAtlList<CDirectory*> m_listSubdirs;
+ CAtlList<CDirentry> m_listFiles;
public:
CDirectory(CDirectory* p, const CString& n, const CString& basepath);
~CDirectory();
- const CString& Path() const { return path_; }
+ const CString& Path() const { return m_strPath; }
int Add(CString relpath, CDirentry& e);
|
@@ -29,18 +29,18 @@
relpath += '/';
- POSITION position = v_.GetHeadPosition();
+ POSITION position = m_listEntries.GetHeadPosition();
while (position != NULL)
{
- const CEntry& rEntry = v_.GetNext(position);
- if (relpath.IsEmpty() || rEntry.path_.Left(relpath.GetLength()) == relpath)
+ const CEntry& rEntry = m_listEntries.GetNext(position);
+ if (relpath.IsEmpty() || rEntry.strPath.Left(relpath.GetLength()) == relpath)
{
- if (rEntry.status_ == 'm' || rEntry.status_ == 'r')
+ if (rEntry.chStatus == 'm' || rEntry.chStatus == 'r')
{
modified = true;
break;
}
- if (rEntry.status_ == 'a')
+ if (rEntry.chStatus == 'a')
added = true;
}
}
@@ -58,8 +58,8 @@
int CDirectoryStatus::Read(const CString& hgroot, const CString& cwd)
{
- v_.RemoveAll();
- noicons_ = false;
+ m_listEntries.RemoveAll();
+ m_bNoIcons = false;
CString p = hgroot + "\\.hg\\thgstatus";
@@ -100,14 +100,14 @@
if (StartsWith(line, noicons))
{
- noicons_ = true;
+ m_bNoIcons = true;
goto close;
}
if (line.IsEmpty())
goto close;
- e.status_ = line[0];
+ e.chStatus = line[0];
CString path;
if (line.GetLength() > 1)
@@ -116,16 +116,16 @@ }
path.AppendChar('/');
- e.path_ = path;
+ e.strPath = path;
- v_.AddTail(e);
+ m_listEntries.AddTail(e);
}
close:
fclose(f);
ATLTRACE("DirectoryStatus::read(%d): done. %d entries read. noicons_ = %d\n",
- v_.GetCount(), noicons_);
+ m_listEntries.GetCount(), m_bNoIcons);
return res;
}
@@ -133,12 +133,12 @@
struct CCacheEntry
{
- CString hgroot_;
- CDirectoryStatus ds_;
- bool readfailed_;
- unsigned tickcount_;
+ CString strHgRoot;
+ CDirectoryStatus ds;
+ bool bReadFailed;
+ unsigned uTickCount;
- CCacheEntry(): readfailed_(false), tickcount_(0) {};
+ CCacheEntry() : bReadFailed(false), uTickCount(0) {}
};
@@ -149,13 +149,13 @@
unsigned tc = GetTickCount();
- if (ce.hgroot_ != hgroot || (tc - ce.tickcount_) > 2000)
+ if (ce.strHgRoot != hgroot || (tc - ce.uTickCount) > 2000)
{
- ce.hgroot_.Empty();
- ce.readfailed_ = (ce.ds_.Read(hgroot, cwd) == 0);
- ce.hgroot_ = hgroot;
- ce.tickcount_ = GetTickCount();
+ ce.strHgRoot.Empty();
+ ce.bReadFailed = (ce.ds.Read(hgroot, cwd) == 0);
+ ce.strHgRoot = hgroot;
+ ce.uTickCount = GetTickCount();
}
- return (ce.readfailed_ ? 0 : &ce.ds_);
+ return (ce.bReadFailed ? 0 : &ce.ds);
}
|
@@ -18,21 +18,21 @@ {
struct CEntry
{
- CString path_;
- char status_;
+ CString strPath;
+ char chStatus;
- CEntry(): status_(0) {}
+ CEntry() : chStatus(0) {}
};
- CAtlList<CEntry> v_;
- bool noicons_;
+ CAtlList<CEntry> m_listEntries;
+ bool m_bNoIcons;
public:
- CDirectoryStatus() : noicons_(false) {}
+ CDirectoryStatus() : m_bNoIcons(false) {}
static CDirectoryStatus* Get(const CString& hgroot, const CString& cwd);
char Status(CString relpath) const;
- bool NoIcons() const { return noicons_; }
+ bool NoIcons() const { return m_bNoIcons; }
private:
int Read(const CString& hgroot, const CString& cwd);
|
@@ -23,19 +23,19 @@
int CDirentry::Read(FILE* f, CString& relpath)
{
- if (fread(&state, sizeof(state), 1, f) != 1)
+ if (fread(&m_chState, sizeof(char), 1, f) != 1)
return 0;
unsigned length = 0;
- fread(&mode, sizeof(mode), 1, f);
- fread(&size, sizeof(size), 1, f);
- fread(&mtime, sizeof(mtime), 1, f);
+ fread(&m_uMode, sizeof(unsigned), 1, f);
+ fread(&m_uSize, sizeof(unsigned), 1, f);
+ fread(&m_uMTime, sizeof(unsigned), 1, f);
fread(&length, sizeof(length), 1, f);
- mode = ntohl(mode);
- size = ntohl(size);
- mtime = ntohl(mtime);
+ m_uMode = ntohl(m_uMode);
+ m_uSize = ntohl(m_uSize);
+ m_uMTime = ntohl(m_uMTime);
length = ntohl(length);
LPSTR lpszBuf = relpath.GetBuffer(length);
@@ -50,12 +50,12 @@
char CDirentry::Status(const CWinstat& stat) const
{
- switch (this->state)
+ switch (m_chState)
{
case 'n':
- if (this->size != (unsigned)stat.size)
+ if (m_uSize != (unsigned)stat.size)
return 'M'; // modified
- if (this->mtime == (unsigned)stat.mtime)
+ if (m_uMTime == (unsigned)stat.mtime)
return 'C'; // clean
return 'P'; // must peek into file contents
case 'm':
|
@@ -28,18 +28,18 @@ class CDirentry
{
public:
- unsigned char state;
- unsigned mode;
- unsigned size;
- unsigned mtime;
+ unsigned char m_chState;
+ unsigned m_uMode;
+ unsigned m_uSize;
+ unsigned m_uMTime;
- CString name;
+ CString m_strName;
int Read(FILE* f, CString& relpath);
char Status(const CWinstat& stat) const;
bool Unset() const {
- return (state == 'n') && (mode == 0) && (size == -1) && (mtime == -1);
+ return (m_chState == 'n') && (m_uMode == 0) && (m_uSize == -1) && (m_uMTime == -1);
}
private:
|
@@ -44,7 +44,7 @@ if (e.Unset())
unset = true;
- if (e.state == 'a')
+ if (e.m_chState == 'a')
++pd->num_added_;
pd->Add(relpath, e);
|
Loading...