MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / removePlugins

Method removePlugins

pluginManager/src/PluginList.cpp:1397–1476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1395}
1396
1397void PluginList::removePlugins(HWND hMessageBoxParent, ProgressDialog* progressDialog, PluginListView* pluginListView, CancelToken& cancelToken)
1398{
1399 g_options.moduleInfo.setHParent(hMessageBoxParent);
1400
1401 tstring configDir = _variableHandler->getVariable(_T("CONFIGDIR"));
1402
1403 tstring gpupFile(configDir);
1404 gpupFile.append(_T("\\PluginManagerGpup.xml"));
1405
1406 TiXmlDocument* forGpupDoc = getGpupDocument(gpupFile.c_str());
1407 TiXmlElement* installElement = forGpupDoc->FirstChildElement(_T("install"));
1408
1409 std::shared_ptr< list<Plugin*> > selectedPlugins = pluginListView->getSelectedPlugins();
1410
1411
1412 if (selectedPlugins.get() == NULL)
1413 {
1414 delete forGpupDoc;
1415 progressDialog->close();
1416 return;
1417 }
1418
1419 size_t removeSteps = 0;
1420 list<Plugin*>::iterator pluginIter = selectedPlugins->begin();
1421
1422 while(pluginIter != selectedPlugins->end())
1423 {
1424 removeSteps += (*pluginIter)->getRemoveStepCount();
1425 ++pluginIter;
1426 }
1427
1428 progressDialog->setStepCount(removeSteps);
1429
1430 tstring pluginDir = _variableHandler->getVariable(_T("PLUGINDIR"));
1431 tstring removeBasePath;
1432
1433 pluginIter = selectedPlugins->begin();
1434 bool needAdmin = false;
1435 while(pluginIter != selectedPlugins->end())
1436 {
1437 if ((*pluginIter)->getInstalledForAllUsers())
1438 {
1439 needAdmin = true;
1440 }
1441
1442 (*pluginIter)->remove(removeBasePath, installElement,
1443 std::bind(&ProgressDialog::setCurrentStatus, progressDialog, _1),
1444 std::bind(&ProgressDialog::setStepProgress, progressDialog, _1),
1445 std::bind(&ProgressDialog::stepComplete, progressDialog),
1446 &g_options.moduleInfo,
1447 _variableHandler,
1448 cancelToken);
1449 ++pluginIter;
1450 }
1451
1452
1453
1454

Callers 1

removeThreadProcMethod · 0.80

Calls 14

setHParentMethod · 0.80
c_strMethod · 0.80
getSelectedPluginsMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
getRemoveStepCountMethod · 0.80
removeSelectedMethod · 0.80
appendMethod · 0.45
FirstChildElementMethod · 0.45
closeMethod · 0.45
setStepCountMethod · 0.45

Tested by

no test coverage detected