| CODENOTIFIER | HelpYou are not signed inSign in |
Project: FAR manager
Revision: 1962
Author: drkns
Date: 31 Aug 2008 06:55:14
Changes:MakeDirectory and GetFiles improvement
Files:| ... | ...@@ -976,7 +976,7 @@ | |
| 976 | 976 | PluginPanelItem *PanelItem, |
| 977 | 977 | int ItemsNumber, |
| 978 | 978 | int Move, |
| 979 | const wchar_t *DestPath, | |
| 979 | const wchar_t **DestPath, | |
| 980 | 980 | int OpMode |
| 981 | 981 | ) |
| 982 | 982 | { |
| ... | ...@@ -991,10 +991,13 @@ | |
| 991 | 991 | |
| 992 | 992 | oldfar::PluginPanelItem *PanelItemA = NULL; |
| 993 | 993 | ConvertPanelItemW(PanelItem,&PanelItemA,ItemsNumber); |
| 994 | char DestA[33*1024]; | |
| 995 | UnicodeToAnsi(DestPath,DestA,sizeof(DestA)); | |
| 994 | char DestA[NM]; | |
| 995 | UnicodeToOEM(*DestPath,DestA,sizeof(DestA)); | |
| 996 | 996 | |
| 997 | 997 | EXECUTE_FUNCTION_EX(pGetFiles(hPlugin, PanelItemA, ItemsNumber, Move, DestA, OpMode), es); |
| 998 | static wchar_t DestW[NM]; | |
| 999 | OEMToUnicode(DestA,DestW,countof(DestW)); | |
| 1000 | *DestPath=DestW; | |
| 998 | 1001 | |
| 999 | 1002 | FreePanelItemA(PanelItemA,ItemsNumber); |
| 1000 | 1003 | |
| ... | ...@@ -1067,7 +1070,7 @@ | |
| 1067 | 1070 | |
| 1068 | 1071 | int PluginA::MakeDirectory ( |
| 1069 | 1072 | HANDLE hPlugin, |
| 1070 | const wchar_t *Name, | |
| 1073 | const wchar_t **Name, | |
| 1071 | 1074 | int OpMode |
| 1072 | 1075 | ) |
| 1073 | 1076 | { |
| ... | ...@@ -1080,11 +1083,14 @@ | |
| 1080 | 1083 | es.id = EXCEPT_MAKEDIRECTORY; |
| 1081 | 1084 | es.nDefaultResult = -1; |
| 1082 | 1085 | |
| 1083 | char NameA[33*1024]; | |
| 1084 | UnicodeToAnsi(Name,NameA,sizeof(NameA)); | |
| 1086 | char NameA[NM]; | |
| 1087 | UnicodeToOEM(*Name,NameA,sizeof(NameA)); | |
| 1085 | 1088 | |
| 1086 | 1089 | EXECUTE_FUNCTION_EX(pMakeDirectory(hPlugin, NameA, OpMode), es); |
| 1087 | 1090 | |
| 1091 | static wchar_t NameW[NM]; | |
| 1092 | OEMToUnicode(NameA,NameW,countof(NameW)); | |
| 1093 | *Name=NameW; | |
| 1088 | 1094 | nResult = (int)es.nResult; |
| 1089 | 1095 | } |
| 1090 | 1096 |
| ... | ...@@ -287,7 +287,7 @@ | |
| 287 | 287 | void PutDizToPlugin(FileList *DestPanel,struct PluginPanelItem *ItemList, |
| 288 | 288 | int ItemNumber,int Delete,int Move,DizList *SrcDiz, |
| 289 | 289 | DizList *DestDiz); |
| 290 | void PluginGetFiles(const wchar_t *DestPath,int Move); | |
| 290 | void PluginGetFiles(const wchar_t **DestPath,int Move); | |
| 291 | 291 | void PluginToPluginFiles(int Move); |
| 292 | 292 | void PluginHostGetFiles(); |
| 293 | 293 | void PluginPutFilesToNew(); |
| ... | ...@@ -465,7 +465,7 @@ | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | |
| 468 | void FileList::PluginGetFiles(const wchar_t *DestPath,int Move) | |
| 468 | void FileList::PluginGetFiles(const wchar_t **DestPath,int Move) | |
| 469 | 469 | { |
| 470 | 470 | _ALGO(CleverSysLog clv(L"FileList::PluginGetFiles()")); |
| 471 | 471 | struct PluginPanelItem *ItemList, *PList; |
| ... | ...@@ -489,14 +489,14 @@ | |
| 489 | 489 | { |
| 490 | 490 | CtrlObject->Cp()->LeftPanel->ReadDiz(); |
| 491 | 491 | CtrlObject->Cp()->RightPanel->ReadDiz(); |
| 492 | DestDiz.Read(DestPath); | |
| 492 | DestDiz.Read(*DestPath); | |
| 493 | 493 | DizFound=TRUE; |
| 494 | 494 | } |
| 495 | 495 | string strName = PList->FindData.lpwszFileName; |
| 496 | 496 | string strShortName = PList->FindData.lpwszAlternateFileName; |
| 497 | 497 | CopyDiz(strName,strShortName,strName,strName,&DestDiz); |
| 498 | 498 | } |
| 499 | DestDiz.Flush(DestPath); | |
| 499 | DestDiz.Flush(*DestPath); | |
| 500 | 500 | } |
| 501 | 501 | if (GetCode==1) |
| 502 | 502 | { |
| ... | ...@@ -539,7 +539,9 @@ | |
| 539 | 539 | CreatePluginItemList(ItemList,ItemNumber); |
| 540 | 540 | if (ItemList!=NULL && ItemNumber>0) |
| 541 | 541 | { |
| 542 | int PutCode=CtrlObject->Plugins.GetFiles(hPlugin,ItemList,ItemNumber,FALSE,strTempDir,OPM_SILENT); | |
| 542 | const wchar_t *lpwszTempDir=strTempDir; | |
| 543 | int PutCode=CtrlObject->Plugins.GetFiles(hPlugin,ItemList,ItemNumber,FALSE,&lpwszTempDir,OPM_SILENT); | |
| 544 | strTempDir=lpwszTempDir; | |
| 543 | 545 | if (PutCode==1 || PutCode==2) |
| 544 | 546 | { |
| 545 | 547 | string strSaveDir; |
| ... | ...@@ -622,7 +624,9 @@ | |
| 622 | 624 | if (CtrlObject->Plugins.GetFindData(hCurPlugin,&ItemList,&ItemNumber,0)) |
| 623 | 625 | { |
| 624 | 626 | _ALGO(SysLog(L"call Plugins.GetFiles()")); |
| 625 | ExitLoop=CtrlObject->Plugins.GetFiles(hCurPlugin,ItemList,ItemNumber,FALSE,strDestPath,OpMode)!=1; | |
| 627 | const wchar_t *lpwszDestPath=strDestPath; | |
| 628 | ExitLoop=CtrlObject->Plugins.GetFiles(hCurPlugin,ItemList,ItemNumber,FALSE,&lpwszDestPath,OpMode)!=1; | |
| 629 | strDestPath=lpwszDestPath; | |
| 626 | 630 | if (!ExitLoop) |
| 627 | 631 | { |
| 628 | 632 | _ALGO(SysLog(L"call ClearLastGetSelection()")); |
| ... | ...@@ -823,7 +823,7 @@ | |
| 823 | 823 | |
| 824 | 824 | UndoGlobalSaveScrPtr UndSaveScr(SaveScr); |
| 825 | 825 | |
| 826 | int GetCode = ph->pPlugin->GetFiles(ph->hPlugin, PanelItem, 1, 0, DestPath, OpMode); | |
| 826 | int GetCode = ph->pPlugin->GetFiles(ph->hPlugin, PanelItem, 1, 0, &DestPath, OpMode); | |
| 827 | 827 | |
| 828 | 828 | string strFindPath; |
| 829 | 829 | |
| ... | ...@@ -893,7 +893,7 @@ | |
| 893 | 893 | |
| 894 | 894 | int PluginManager::MakeDirectory ( |
| 895 | 895 | HANDLE hPlugin, |
| 896 | const wchar_t *Name, | |
| 896 | const wchar_t **Name, | |
| 897 | 897 | int OpMode |
| 898 | 898 | ) |
| 899 | 899 | { |
| ... | ...@@ -939,7 +939,7 @@ | |
| 939 | 939 | PluginPanelItem *PanelItem, |
| 940 | 940 | int ItemsNumber, |
| 941 | 941 | int Move, |
| 942 | const wchar_t *DestPath, | |
| 942 | const wchar_t **DestPath, | |
| 943 | 943 | int OpMode |
| 944 | 944 | ) |
| 945 | 945 | { |
| ... | ...@@ -1 +1 @@ | |
| 0 | m4_define(BUILD,551)m4_dnl | |
| 0 | m4_define(BUILD,552)m4_dnl |
| ... | ...@@ -195,10 +195,10 @@ | |
| 195 | 195 | int GetFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, int OpMode); |
| 196 | 196 | int GetVirtualFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, const wchar_t *Path); |
| 197 | 197 | int SetDirectory (HANDLE hPlugin, const wchar_t *Dir, int OpMode); |
| 198 | int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t *DestPath, int OpMode); | |
| 198 | int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t **DestPath, int OpMode); | |
| 199 | 199 | int PutFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, int OpMode); |
| 200 | 200 | int DeleteFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode); |
| 201 | int MakeDirectory (HANDLE hPlugin, const wchar_t *Name, int OpMode); | |
| 201 | int MakeDirectory (HANDLE hPlugin, const wchar_t **Name, int OpMode); | |
| 202 | 202 | int ProcessHostFile (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode); |
| 203 | 203 | int ProcessKey (HANDLE hPlugin, int Key, unsigned int dwControlState); |
| 204 | 204 | int ProcessEvent (HANDLE hPlugin, int Event, PVOID Param); |
| ... | ...@@ -960,7 +960,7 @@ | |
| 960 | 960 | PluginPanelItem *PanelItem, |
| 961 | 961 | int ItemsNumber, |
| 962 | 962 | int Move, |
| 963 | const wchar_t *DestPath, | |
| 963 | const wchar_t **DestPath, | |
| 964 | 964 | int OpMode |
| 965 | 965 | ) |
| 966 | 966 | { |
| ... | ...@@ -1034,7 +1034,7 @@ | |
| 1034 | 1034 | |
| 1035 | 1035 | int PluginW::MakeDirectory ( |
| 1036 | 1036 | HANDLE hPlugin, |
| 1037 | const wchar_t *Name, | |
| 1037 | const wchar_t **Name, | |
| 1038 | 1038 | int OpMode |
| 1039 | 1039 | ) |
| 1040 | 1040 | { |
| ... | ...@@ -1,3 +1,23 @@ | |
| 1 | drkns 31.08.2008 13:37:57 +0200 - build 552 | |
| 2 | ||
| 3 | 1. Mantis#0000588: |
| ... | ...@@ -99,10 +99,10 @@ | |
| 99 | 99 | virtual int GetFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, int OpMode) = 0; |
| 100 | 100 | virtual int GetVirtualFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, const wchar_t *Path) = 0; |
| 101 | 101 | virtual int SetDirectory (HANDLE hPlugin, const wchar_t *Dir, int OpMode) = 0; |
| 102 | virtual int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t *DestPath, int OpMode) = 0; | |
| 102 | virtual int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t **DestPath, int OpMode) = 0; | |
| 103 | 103 | virtual int PutFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, int OpMode) = 0; |
| 104 | 104 | virtual int DeleteFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode) = 0; |
| 105 | virtual int MakeDirectory (HANDLE hPlugin, const wchar_t *Name, int OpMode) = 0; | |
| 105 | virtual int MakeDirectory (HANDLE hPlugin, const wchar_t **Name, int OpMode) = 0; | |
| 106 | 106 | virtual int ProcessHostFile (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode) = 0; |
| 107 | 107 | virtual int ProcessKey (HANDLE hPlugin, int Key, unsigned int dwControlState) = 0; |
| 108 | 108 | virtual int ProcessEvent (HANDLE hPlugin, int Event, PVOID Param) = 0; |
| ... | ...@@ -201,10 +201,10 @@ | |
| 201 | 201 | void FreeVirtualFindData(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber); |
| 202 | 202 | int SetDirectory(HANDLE hPlugin,const wchar_t *Dir,int OpMode); |
| 203 | 203 | int GetFile(HANDLE hPlugin,PluginPanelItem *PanelItem,const wchar_t *DestPath,string &strResultName,int OpMode); |
| 204 | int GetFiles(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *DestPath,int OpMode); | |
| 204 | int GetFiles(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); | |
| 205 | 205 | int PutFiles(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int Move,int OpMode); |
| 206 | 206 | int DeleteFiles(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); |
| 207 | int MakeDirectory(HANDLE hPlugin,const wchar_t *Name,int OpMode); | |
| 207 | int MakeDirectory(HANDLE hPlugin,const wchar_t **Name,int OpMode); | |
| 208 | 208 | int ProcessHostFile(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); |
| 209 | 209 | int ProcessKey(HANDLE hPlugin,int Key,unsigned int ControlState); |
| 210 | 210 | int ProcessEvent(HANDLE hPlugin,int Event,void *Param); |
| ... | ...@@ -44,13 +44,13 @@ | |
| 44 | 44 | typedef void (WINAPI *PLUGINEXITFARW)(); |
| 45 | 45 | typedef void (WINAPI *PLUGINFREEFINDDATAW)(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber); |
| 46 | 46 | typedef void (WINAPI *PLUGINFREEVIRTUALFINDDATAW)(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber); |
| 47 | typedef int (WINAPI *PLUGINGETFILESW)(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *DestPath,int OpMode); | |
| 47 | typedef int (WINAPI *PLUGINGETFILESW)(HANDLE hPlugin,PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); | |
| 48 | 48 | typedef int (WINAPI *PLUGINGETFINDDATAW)(HANDLE hPlugin,PluginPanelItem **pPanelItem,int *pItemsNumber,int OpMode); |
| 49 | 49 | typedef int (WINAPI *PLUGINMINFARVERSIONW)(); |
| 50 | 50 | typedef void (WINAPI *PLUGINGETOPENPLUGININFOW)(HANDLE hPlugin,OpenPluginInfo *Info); |
| 51 | 51 | typedef void (WINAPI *PLUGINGETPLUGININFOW)(PluginInfo *Info); |
| 52 | 52 | typedef int (WINAPI *PLUGINGETVIRTUALFINDDATAW)(HANDLE hPlugin,PluginPanelItem **pPanelItem,int *pItemsNumber,const wchar_t *Path); |
| 53 | typedef int (WINAPI *PLUGINMAKEDIRECTORYW)(HANDLE hPlugin,const wchar_t *Name,int OpMode); | |
| 53 | typedef int (WINAPI *PLUGINMAKEDIRECTORYW)(HANDLE hPlugin,const wchar_t **Name,int OpMode); | |
| 54 | 54 | typedef HANDLE (WINAPI *PLUGINOPENFILEPLUGINW)(const wchar_t *Name,const unsigned char *Data,int DataSize,int OpMode); |
| 55 | 55 | typedef HANDLE (WINAPI *PLUGINOPENPLUGINW)(int OpenFrom,INT_PTR Item); |
| 56 | 56 | typedef int (WINAPI *PLUGINPROCESSEDITOREVENTW)(int Event,void *Param); |
| ... | ...@@ -188,10 +188,10 @@ | |
| 188 | 188 | int GetFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, int OpMode); |
| 189 | 189 | int GetVirtualFindData (HANDLE hPlugin, PluginPanelItem **pPanelItem, int *pItemsNumber, const wchar_t *Path); |
| 190 | 190 | int SetDirectory (HANDLE hPlugin, const wchar_t *Dir, int OpMode); |
| 191 | int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t *DestPath, int OpMode); | |
| 191 | int GetFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, const wchar_t **DestPath, int OpMode); | |
| 192 | 192 | int PutFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int Move, int OpMode); |
| 193 | 193 | int DeleteFiles (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode); |
| 194 | int MakeDirectory (HANDLE hPlugin, const wchar_t *Name, int OpMode); | |
| 194 | int MakeDirectory (HANDLE hPlugin, const wchar_t **Name, int OpMode); | |
| 195 | 195 | int ProcessHostFile (HANDLE hPlugin, PluginPanelItem *PanelItem, int ItemsNumber, int OpMode); |
| 196 | 196 | int ProcessKey (HANDLE hPlugin, int Key, unsigned int dwControlState); |
| 197 | 197 | int ProcessEvent (HANDLE hPlugin, int Event, PVOID Param); |
| ... | ...@@ -1554,7 +1554,9 @@ | |
| 1554 | 1554 | if (PanelMode==PLUGIN_PANEL && !CtrlObject->Plugins.UseFarCommand(hPlugin,PLUGIN_FARMAKEDIRECTORY)) |
| 1555 | 1555 | { |
| 1556 | 1556 | string strDirName; |
| 1557 | int MakeCode=CtrlObject->Plugins.MakeDirectory(hPlugin,strDirName,0); | |
| 1557 | const wchar_t *lpwszDirName=strDirName; | |
| 1558 | int MakeCode=CtrlObject->Plugins.MakeDirectory(hPlugin,&lpwszDirName,0); | |
| 1559 | strDirName=lpwszDirName; | |
| 1558 | 1560 | if (!MakeCode) |
| 1559 | 1561 | Message(MSG_DOWN|MSG_WARNING|MSG_ERRORTYPE,1,UMSG(MError),UMSG(MCannotCreateFolder),strDirName,UMSG(MOk)); |
| 1560 | 1562 | Update(UPDATE_KEEP_SELECTION); |
| ... | ...@@ -4144,8 +4146,9 @@ | |
| 4144 | 4146 | } |
| 4145 | 4147 | } |
| 4146 | 4148 | } |
| 4147 | ||
| 4148 | PluginGetFiles(strDestPath,Move); | |
| 4149 | const wchar_t *lpwszDestPath=strDestPath; | |
| 4150 | PluginGetFiles(&lpwszDestPath,Move); | |
| 4151 | strDestPath=lpwszDestPath; | |
| 4149 | 4152 | } |
| 4150 | 4153 | } |
| 4151 | 4154 | } |