A search window of its own: "Search in:" (the home folder, a path, or "This computer"), "Name contains:", "Changed:" (any time, today, yesterday, the past week), the findings as paths relative to the scope, and Open, Save... and Search (Return searches too). The walk is opendir/readdir in C -- no index, nothing in the background -- bounded to 24 levels, 200000 entries and 500 findings, so a wrong search cannot freeze the window. The sidebar's SEARCH FOR group is alive: Today, Yesterday and Past Week run the search at once, and the saved searches (~/.dt/searches/NAME.search: name=, when=, scope=) are listed under them and run with their criteria. Save... writes such a file; "Open" goes to the finding's folder (a folder itself is opened). Measured under Xvfb: "Today" in a home with Documents/heute.txt (today) and Documents/gestern.txt (yesterday) finds 2 -- Documents and Documents/heute.txt -- in 3 entries (docs/screenshots/leopard/ Finder-Search-mcde.png); Save... writes ~/.dt/searches/search.search with "name=", "when=today", "scope=~" (cat), and the group lists it on the next start. Open: "All Images", "All Movies" and "All Documents" are still grey -- they need a type criterion through the data types (t0194); Open shows the folder, it does not choose the finding in it; the search runs synchronously between two redraws; and the toolbar's search field still filters the folder shown, not the whole computer.
26 lines
647 B
C
26 lines
647 B
C
/*
|
|
* Search.h -- MCDE: dtfile's search over folders (Search.c)
|
|
*
|
|
* Copyright (c) 2026 The Makronix project. GNU LGPL 2.0 or later, as CDE.
|
|
*/
|
|
|
|
#ifndef _Search_h
|
|
#define _Search_h
|
|
|
|
#include "FileMgr.h"
|
|
|
|
enum McdeSearchWhen {
|
|
MCDE_SEARCH_ANY = 0,
|
|
MCDE_SEARCH_TODAY,
|
|
MCDE_SEARCH_YESTERDAY,
|
|
MCDE_SEARCH_WEEK
|
|
};
|
|
|
|
/* the search window: NAME in the file name (NULL: any), WHEN the file was
|
|
* changed, SCOPE the folder to walk (NULL: the home folder). A saved search
|
|
* (~/.dt/searches/NAME.search) comes back with it. */
|
|
extern void _McdeSearchShow(FileMgrRec *rec, const char *name, int when,
|
|
const char *scope);
|
|
|
|
#endif /* _Search_h */
|