MCDE DtSvc: the type of a host-qualified name, so icons and Trash see the file (t0194)

This commit is contained in:
lotherk committed 2026-11-14 18:59:04 +00:00
1 parent 5e5a624564
commit 319a490c1f
2 files changed
+40 -1

No files matched your search

+11
View File
@@ -165,6 +165,17 @@ narratives and test notes, is `docs/reference/mcde-agents-history-2026-11-13.txt
kills the child (`mcdeChildPid`) and unlinks the half-written target.
Measured: a 4 GB copy shows the window with "129.0 MB of 4295.0 MB" while
the file is written.
- **Host-qualified names in the type database** (`lib/DtSvc/DtUtil1/Dts.c`,
`local_path()`): dtfile and the actions hand `host:/path` (the netfile
form) to `DtDtsFileToDataType`; the content criteria then opened
"host:/path" and every content-typed file was UNKNOWN -- a .txt showed the
"??" icon and Put in Trash refused it with "data attributes: UNKNOWN"
(measured 2026-11-14: the same file is TEXTFILE under its plain path and
UNKNOWN under `kitt:/path`; a directory is FOLDER vs UNKNOWN). When the
host part is this computer's name or `localhost`, the lookup now uses the
path without it. Measured after: TEXTFILE/FOLDER and the text, folder and
picture icons in dtfile. Trash still answers TT_ERR_NO_MATCH -- that is the
ToolTalk handler of t0206, not the type.
- **The web browser** (t0179): the desktop has one action for a web page,
`McdeWeb` (`programs/types/datatypes.dt.src`; `EXEC_STRING` runs
`dtsystemsettings -open-web "%Arg_1%"`), and the choice of browser lives in
+29 -1
View File
@@ -1453,10 +1453,38 @@ DtDtsDataToDataType(const char *fp,
return(cleanup(0, info));
}
/* MCDE: dtfile and the actions hand a host-qualified name ("kitt:/path")
* to the type lookup; the content criteria then open "kitt:/path" and the
* type is UNKNOWN (measured 2026-11-14: a .txt in the shown folder is
* TEXTFILE under its plain path and UNKNOWN under the host-qualified one, so
* Put in Trash refused it). When the host is this computer, the name is
* used without its prefix. */
static const char *
local_path(const char *filepath)
{
static char host[256];
const char *colon;
size_t n;
if (filepath == NULL || (colon = strchr(filepath, ':')) == NULL ||
colon[1] != '/')
return filepath;
n = (size_t) (colon - filepath);
if (n == 9 && strncmp(filepath, "localhost", 9) == 0)
return colon + 1;
if (host[0] == '\0' && gethostname(host, sizeof host) != 0)
host[0] = '\0';
host[sizeof host - 1] = '\0';
if (host[0] != '\0' && strlen(host) == n &&
strncmp(filepath, host, n) == 0)
return colon + 1;
return filepath;
}
char *
DtDtsFileToDataType(const char *filepath)
{
char *dt = DtDtsDataToDataType(filepath, 0, -1, 0, 0, 0, 0);
char *dt = DtDtsDataToDataType(local_path(filepath), 0, -1, 0, 0, 0, 0);
return(dt);
}