зеркало из https://github.com/mozilla/pjs.git
Fix for bug 105736: Need ability to delete a configuration (r=smeredith)
This commit is contained in:
Родитель
0d96980730
Коммит
18ba68e760
|
@ -1146,6 +1146,28 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
|
|||
NewConfig(curWidget, CString(parms),"Create Copy");
|
||||
}
|
||||
#endif
|
||||
// Delete a configuration
|
||||
else if (strcmp(pcmd, "DeleteConfig") ==0)
|
||||
{
|
||||
if (curWidget)
|
||||
{
|
||||
CString rootPath = GetGlobal("Root");
|
||||
CString configName = replaceVars(parms,NULL);
|
||||
CString configPath = rootPath + "Configs\\" + configName;
|
||||
EraseDirectory(configPath);
|
||||
SetCurrentDirectory(rootPath);
|
||||
if (!SetCurrentDirectory(rootPath))
|
||||
{
|
||||
ShowLastError();
|
||||
return FALSE;
|
||||
}
|
||||
if (!RemoveDirectory(configPath))
|
||||
{
|
||||
ShowLastError();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcmp(pcmd, "CopyDir") == 0)
|
||||
{
|
||||
char *p2 = strchr(parms, ',');
|
||||
|
|
Загрузка…
Ссылка в новой задаче