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

Method Add

cppcryptfs/ui/RecentItems.cpp:75–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75void
76RecentItems::Add(LPCTSTR item)
77{
78 int i;
79
80 bool bSave = !NeverSaveHistory();
81
82 CString *lastitems = new CString[m_count];
83
84 ASSERT(lastitems);
85 if (!lastitems)
86 return;
87
88 Populate(lastitems);
89
90 CString itemname;
91
92 int index = m_count-1;
93
94 for (i = 0; i < m_count; i++) {
95 if (!lstrcmpi(item, lastitems[i])) {
96 index = i;
97 break;
98 }
99 }
100
101 for (i = index; i >= 1; i--) {
102 AppendIndex(itemname, i);
103 if (bSave) {
104 theApp.WriteProfileStringW(m_section, itemname, lastitems[i - 1]);
105 }
106 }
107
108 AppendIndex(itemname, 0);
109 if (bSave) {
110 theApp.WriteProfileString(m_section, itemname, item);
111 }
112
113 delete[] lastitems;
114}

Callers 4

CreateCryptfsMethod · 0.80
MountMethod · 0.80
GetMountPointsMethod · 0.80
DeleteMountPointMethod · 0.80

Calls 2

NeverSaveHistoryFunction · 0.85
WriteProfileStringMethod · 0.80

Tested by

no test coverage detected