Skip to content

Commit

Permalink
24.10.8 Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed Oct 8, 2024
1 parent 0ed74e2 commit 6449409
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions Debug/script/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ g_.Notify = {};

AboutTE = function (n) {
if (n == 0) {
return te.Version < 20240616 ? te.Version : 20241007;
return te.Version < 20240616 ? te.Version : 20241008;
}
if (n == 1) {
const v = AboutTE(0);
Expand Down Expand Up @@ -479,16 +479,6 @@ OrganizePath = function (fn, base) {
return fn;
}

SelectedParent = function (path) {
if ("string" !== typeof path) {
if (!path || !path.Count) {
return;
}
path = path.Item(0).Path;
}
return /^[A-Z]:\\.+?\\|^\\\\.+?\\/i.test(path) ? GetParentFolderName(path) : null;
}

OpenAdodbFromTextFile = function (fn, charset, base) {
fn = OrganizePath(fn, base || te.Data.Installed);
const ado = api.CreateObject("ads");
Expand Down Expand Up @@ -2239,7 +2229,7 @@ IsFolderEx = function (Item) {
if (Item.IsFolder && !api.ILIsParent(ssfBITBUCKET, Item, true)) {
const wfd = api.Memory("WIN32_FIND_DATA");
const hr = api.SHGetDataFromIDList(Item, SHGDFIL_FINDDATA, wfd, wfd.Size);
return (hr < 0) || (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 || !/^[A-Z]:\\|^\\\\\w.*\\.*\\/i.test(Item.Path);
return (hr < 0) || (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 || !/^[A-Z]:\\|^\\\\\w.*\\.*\\/i.test(Item.Path) || !Item.IsFileSystem;
}
if (/^ftp:|^https?:/i.test(Item.Path)) {
return Item.IsFolder;
Expand Down Expand Up @@ -2582,7 +2572,8 @@ ExecMenu4 = function (Ctrl, Name, pt, hMenu, arContextMenu, nVerb, FV) {
}
}
}
if (ContextMenu.InvokeCommand(0, te.hwnd, nVerb - ContextMenu.idCmdFirst, null, SelectedParent(ContextMenu.Items()), SW_SHOWNORMAL, 0, 0) == S_OK) {
const Items = ContextMenu.Items();
if (ContextMenu.InvokeCommand(0, te.hwnd, nVerb - ContextMenu.idCmdFirst, null, Items ? Items.Item(-1).Path : null, SW_SHOWNORMAL, 0, 0) == S_OK) {
api.DestroyMenu(hMenu);
return S_OK;
}
Expand Down Expand Up @@ -3231,7 +3222,7 @@ PopupContextMenu = function (Item, FV, pt) {
}
const nVerb = api.TrackPopupMenuEx(hMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, te.hwnd, null, ContextMenu);
if (nVerb) {
ContextMenu.InvokeCommand(0, te.hwnd, nVerb - 1, null, SelectedParent(Item), SW_SHOWNORMAL, 0, 0);
ContextMenu.InvokeCommand(0, te.hwnd, nVerb - 1, null, Item.Item(-1).Path, SW_SHOWNORMAL, 0, 0);
}
}
api.DestroyMenu(hMenu);
Expand Down
2 changes: 1 addition & 1 deletion Debug/script/sync1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,7 @@ te.OnDefaultCommand = function (Ctrl) {
return S_OK;
}
}
return InvokeCommand(Selected, 0, te.hwnd, null, null, SelectedParent(path), SW_SHOWNORMAL, 0, 0, Ctrl, CMF_DEFAULTONLY);
return InvokeCommand(Selected, 0, te.hwnd, null, null, Selected.Item(-1).Path, SW_SHOWNORMAL, 0, 0, Ctrl, CMF_DEFAULTONLY);
}
return S_FALSE;
}
Expand Down

0 comments on commit 6449409

Please sign in to comment.