From 2b7cd0509390795c07b39d12aaa70ecdc965dc15 Mon Sep 17 00:00:00 2001 From: Don HO Date: Wed, 13 Jun 2018 14:02:49 +0200 Subject: [PATCH] Restore the needed functions --- .../WinControls/PluginsAdmin/pluginsAdmin.cpp | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp index 97853852..8896ec14 100644 --- a/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp +++ b/PowerEditor/src/WinControls/PluginsAdmin/pluginsAdmin.cpp @@ -339,15 +339,14 @@ void PluginsAdminDlg::collectNppCurrentStatusInfos() bool PluginsAdminDlg::installPlugins() { - /* - vector indexes = _availableListView.getCheckedIndexes(); + vector indexes = _availableList.getCheckedIndexes(); NppParameters *pNppParameters = NppParameters::getInstance(); generic_string updaterDir = pNppParameters->getNppPath(); updaterDir += TEXT("\\updater\\"); generic_string updaterFullPath = updaterDir + TEXT("gup.exe"); - generic_string updaterParams = TEXT("-unzipTo -clean "); + generic_string updaterParams = TEXT("-unzipTo "); for (auto i : indexes) { @@ -355,56 +354,54 @@ bool PluginsAdminDlg::installPlugins() // add folder to operate generic_string destFolder = pNppParameters->getAppDataNppDir(); - PathAppend(destFolder, _availablePluginList[i]._name); + PathAppend(destFolder, _availableList.getPluginInfoFromIndex(i)->_folderName); updaterParams += destFolder; // add zipFile's url updaterParams += TEXT(" "); - updaterParams += _availablePluginList[i]._repository; + updaterParams += _availableList.getPluginInfoFromIndex(i)->_repository; Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str()); updater.run(); } - */ + return true; } bool PluginsAdminDlg::updatePlugins() { - /* - vector indexes = _updateListView.getCheckedIndexes(); + vector indexes = _updateList.getCheckedIndexes(); NppParameters *pNppParameters = NppParameters::getInstance(); generic_string updaterDir = pNppParameters->getNppPath(); updaterDir += TEXT("\\updater\\"); generic_string updaterFullPath = updaterDir + TEXT("gup.exe"); - generic_string updaterParams = TEXT("-unzipTo -clean "); + generic_string updaterParams = TEXT("-unzipTo "); for (auto i : indexes) { // add folder to operate generic_string destFolder = pNppParameters->getAppDataNppDir(); - PathAppend(destFolder, _availablePluginList[i]._name); + PathAppend(destFolder, _availableList.getPluginInfoFromIndex(i)->_folderName); updaterParams += destFolder; // add zipFile's url updaterParams += TEXT(" "); - updaterParams += _availablePluginList[i]._repository; + updaterParams += _availableList.getPluginInfoFromIndex(i)->_repository; Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str()); updater.run(); } - */ + return true; } bool PluginsAdminDlg::removePlugins() { - /* - vector indexes = _installedListView.getCheckedIndexes(); + vector indexes = _installedList.getCheckedIndexes(); NppParameters *pNppParameters = NppParameters::getInstance(); generic_string updaterDir = pNppParameters->getNppPath(); @@ -419,14 +416,14 @@ bool PluginsAdminDlg::removePlugins() // add folder to operate generic_string destFolder = pNppParameters->getAppDataNppDir(); - PathAppend(destFolder, _availablePluginList[i]._name); + PathAppend(destFolder, _availableList.getPluginInfoFromIndex(i)->_folderName); updaterParams += destFolder; Process updater(updaterFullPath.c_str(), updaterParams.c_str(), updaterDir.c_str()); updater.run(); } - */ + return true; }