MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / DeleteMountPoint

Method DeleteMountPoint

cppcryptfs/ui/MountPropertyPage.cpp:1908–1942  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1906}
1907
1908void CMountPropertyPage::DeleteMountPoint(int item)
1909{
1910 CListCtrl* pList = (CListCtrl*)GetDlgItem(IDC_DRIVE_LETTERS);
1911
1912 if (!pList)
1913 return;
1914
1915 CString delmp = pList->GetItemText(item, 0);
1916
1917 CString mountPointsStr = theApp.GetProfileString(L"MountPoint", L"MountPoints", NULL);
1918
1919 CStringArray mountPoints;
1920
1921 int i = 0;
1922 for (CString path = mountPointsStr.Tokenize(L"|", i); i >= 0; path = mountPointsStr.Tokenize(L"|", i)) {
1923 mountPoints.Add(path);
1924 }
1925
1926 mountPointsStr = L"";
1927
1928 for (i = 0; i < mountPoints.GetCount(); i++) {
1929 if (!lstrcmpi(mountPoints.GetAt(i), delmp))
1930 continue;
1931 if (i > 0)
1932 mountPointsStr += "|";
1933 mountPointsStr += mountPoints.GetAt(i);
1934
1935 }
1936
1937 theApp.WriteProfileString(L"MountPoint", L"MountPoints", mountPointsStr);
1938
1939 pList->DeleteItem(item);
1940
1941
1942}
1943
1944void CMountPropertyPage::OnExit()
1945{

Callers

nothing calls this directly

Calls 2

AddMethod · 0.80
WriteProfileStringMethod · 0.80

Tested by

no test coverage detected