pdulvp.fr

Default icons of file types refresh when a drive mounts has been fixed.

See more details at : https://github.com/pdulvp/pmane-sa/issues/13

  • DefaultIcons.cpp cached the artwork read per file type, a missing file

included, so an icon set as a type's default on a not-yet-mounted drive
stayed a generic icon after the mount; clearDefaultIconCache() drops that
cache and MainWindow::refreshIcons() calls it, covering both the mount
signal and Window > Refresh

  • verified headless: the stale null came back until the cache was cleared,

then the icon file was read for real

The data and the cache move with the settings

<sub>2026-10-30-1448-the-data-and-the-cache-move-with-the-settings.md — 2026-10-30 14:48</sub>

The move written for ~/.config leaves the other two behind: the wine prefixes
under ~/.local/share/pmane-sa/pmane-sa, which are the heaviest thing the
program owns, and the launch logs under ~/.cache/pmane-sa/pmane-sa. All three
are <root>/<organisation>/<application> and move the same way.

Decisions

  • One rule for the three roots, config, data and cache, rather than one

written for each: the old folder is <root>/pmane-sa/pmane-sa and the new
one is whatever QStandardPaths gives now.

  • The destination counts as free when it holds no file. Running the new

program once makes empty prefixes and launches folders, which must not
be what stops a 1.4 GB prefix folder from moving. Such a destination is
removed -- it can only be empty folders -- and the old one renamed over it.

  • A folder holding files is never merged into. Two sets of prefixes are

not reconciled; the old one is left where it is and said so, once.

  • The cache moves as well, rather than being deleted or left to rot: it is

the same shape, and a log already written is still worth reading. It is the
one root that says nothing when the destination is in use, since that would
be said at every startup for what is only logs of past launches.

Steps

  • [x] 1. src/LegacyConfig.{h,cpp} renamed src/LegacyPaths.{h,cpp}, the

function migrateLegacyFolders(): the three roots in a loop, plus
pmane-sa.conf beside the config one.

  • [x] 2. CMakeLists.txt and src/main.cpp follow the rename.
  • [x] 3. Checked against homes of its own, the program run offscreen in each:

settings, a prefix and a log all move, over the empty prefixes and
launches the new program had already made; a data folder holding
prefixes is left alone, with one line saying so and nothing swapped; a
second run says nothing and the old roots are gone. A cache already in
use says nothing at all.

  • [x] 4. README: the line about the old location covers all three.

A default icon per file type

<sub>2026-10-30-1753-a-default-icon-per-file-type.md — 2026-10-30 17:53</sub>

A ROM, a disc image or a DOSBox config carries no artwork, so every one of them
ends up under the same generic icon. Options > Default Icons... sets one
icon per file type, from the same "Change Icon" listing the properties dialog
uses, and every item of that type that has no artwork of its own takes it.

The types listed are the ones the launchers claim, so adding smc to RetroArch
makes a row for it appear.

Decisions

  • Where it sits in the chain. An icon picked for the item wins, then the

artwork the file itself carries (an .exe's resources, a .desktop's icon,
the one a DOSBox [ui] names, Steam's cached artwork), then the default for
the file type, then the generic fallbacks that exist today. So an .exe
dropped on a group keeps its own icon and only falls back to the default
when it has none, which is what was asked.

  • The desktop's mime icon moves below it. A document's type icon from the

icon theme is itself a generic default; one set here is deliberate and must
win over it.

  • Stored by extension, not by launcher. A .iso is one file type whoever

runs it, and two launchers claiming it must not disagree.

  • An icon is a file and an index, as an item's is: the listing offers every

icon an .exe or .ico holds, and the index chooses between them.

  • A type that no longer belongs to any launcher keeps its row if an icon

was set for it, so removing an extension from a launcher by accident does
not throw the setting away.

  • The open desktop is refreshed when the dialog is accepted: items whose

icon was derived rather than picked take the new default without a restart.

Steps

  • [x] 1. src/DefaultIcons.{h,cpp}: `struct DefaultIcon { QString file; int

index; bool legacy; }, everyFileType()` (the extensions every launcher
claims, plus those already set), defaultIcons() / setDefaultIcons()
over the defaultIcons group of the settings, and
defaultIconForPath() loading and caching the artwork.

  • [x] 2. src/ItemDetails.cpp completeProgramItem(): the default after the

per-kind discovery and before the theme and style fallbacks, with the
document mime icon moved below it.

  • [x] 3. src/DefaultIconsDialog.{h,cpp}: the table -- file type, the icon and

the file it comes from -- with Change Icon... opening
IconPickerDialog on the row's current icon and Clear emptying it.

  • [x] 4. CMakeLists.txt; src/MainWindow.cpp: the Options entry, and the

open groups re-deriving their icons afterwards
(GroupWindow::refreshDerivedIcons()).

  • [x] 5. Checked offscreen: the table lists the types of every launcher; an

icon set for nes reaches a .nes item and no other type; with an icon
set for exe, Pharaoh.exe still shows its own 32x32 artwork while a
file with no resources in it takes the default; clearing puts the
generic icon back.

  • [x] 6. README: a "Default icons" section with the order the icons are

resolved in, and docs/images/default-icons.png taken by the
screenshots tool, which now shoots this dialog too.

The time and the date part, and the time opens a clock face

<sub>2026-10-31-1305-the-time-and-the-date-part-and-the-time-opens-a-clock-face.md — 2026-10-31 13:05</sub>

The strip's clock is one label reading "10:09 31/10/2026", and clicking
anywhere on it opens the month. The two are separated: the time on its own
opens a round clock with hands, the date on its own keeps opening the month.

Decisions

  • A pane of the same kind as the month and the calculator: a popup with the

banner down its left side, a band across the top, and the face painted below
it. Nothing in it is clickable -- it shows the time, it is not an alarm.

  • The band carries the date in full, the day name included, which is what a

clock face cannot say.

  • The hands are drawn, not glyphs: hour and minute in the window text

colour, the second hand in the caption colour so it reads as the moving one,
and twelve marks round the edge with the quarters heavier.

  • The second hand ticks only while the pane is open. Its timer runs on

show and stops on hide, the strip's own clock being the one that has to keep
time.

  • One kiosk setting still governs both labels. showCalendar hides the

clock today; splitting the label is not a reason for a second setting in
Options > Settings.

Steps

  • [x] 1. src/ClockPane.{h,cpp}: the popup -- banner, band with the long date,

painted face with hour, minute and second hands, a timer that runs while
it is visible.

  • [x] 2. src/TitleBar.{h,cpp}: m_clock becomes the time alone and m_date

the date; each gets its tooltip, its cursor and its pane; applyPalette,
applyKioskSettings and titleArea take in the second label.

  • [x] 3. CMakeLists.txt: the new pair of files.
  • [x] 4. tools/Screenshots.cpp, README: the strip's third pane is shot and

shown, docs/images/clock.png.

  • [x] 5. Built, and looked at offscreen: the dial with its marks and its three

hands in docs/images/clock.png, and the strip in docs/images/main.png
reading "13:04 31/10/2026" as it did when it was one label.

The time and the date light up under the pointer

<sub>2026-10-31-1330-the-time-and-the-date-light-up-under-the-pointer.md — 2026-10-31 13:30</sub>

The two labels the clock was split into open panes when clicked but show
nothing under the pointer, so neither looks like something to click.

Decisions

  • They become caption buttons rather than painted labels. The strip's

other clickable things are QToolButtons in auto-raise, and a button gets
the hover and the pressed look from the style, with no colour of ours to
keep in step with the scheme.

  • The space around them moves into the layout. A button's own padding is

what the hover panel hugs, so the margins that kept the clock clear of the
title and the window buttons are added as spacing beside them instead.

  • Their clicks become clicked(), which is what a button has, so the two

branches watching for a press in the event filter go.

Steps

  • [x] 1. src/TitleBar.h: m_clock and m_date become QToolButton *.
  • [x] 2. src/TitleBar.cpp: built as text-only auto-raise buttons with the

spacing beside them, opening their panes from clicked(); the event
filter loses the two label branches.

  • [x] 3. Built, and looked at the strip in docs/images/main.png: the two

read flat at rest, "14:59 31/10/2026", with the gap between them and
the room beside them kept. The hover and the pressed look are the
style's own, as on the caption buttons next to them.

The window menu's active entry has no checkbox

<sub>2026-11-02-2042-the-window-menus-active-entry-has-no-checkbox.md — 2026-11-02 20:42</sub>

The Window menu lists one entry per open group, and the active group's entry
carried a checkbox. It said nothing the menu does not already say — the
active window is the one in front — so the check is gone.

Steps

  • [x] 1. src/MainWindow.cpp, updateWindowMenu(): drop setCheckable(true)

and setChecked(...) on the per-window actions; the triggered handler
that activates or restores the window is unchanged.

  • [x] 2. Built the pmane-sa target to confirm the change compiles and links.

A Documents launcher with a customizable extension list

<sub>2026-11-02-2110-a-documents-launcher-with-a-customizable-extension-list.md — 2026-11-02 21:10</sub>

The launchers dialog gains a "Documents" launcher that opens files with the
application the desktop has registered for their type. The extensions it
handles — and accepts when a file is dropped on an item — are editable in
Options > Launchers, in the launcher's "File types" field; pdf and cbz
stay the defaults. For now every extension opens with the default app.

Decisions

  • Documents become a launcher family (id "documents"), like wine or

DOSBox, so the existing per-launcher extensions field, persistence and
claiming logic are reused instead of a second hardcoded list.

  • A new flag usesDefaultApp on Launcher: such a launcher has no

programs to configure, so the launchers dialog hides the runners table for
it and says the files open with the desktop's default application.
Launching still goes through the existing isDocument branch in
ItemLauncher (QDesktopServices::openUrl), now driven by the launcher's
extension list.

  • isDocument is claimedBy("documents", ...), so handled, droppable

(isLaunchable, drops in GroupWindow) and the icon/mime paths all follow
the same list.

  • The browse filter in the properties dialog is built from the launcher's

extensions instead of the hardcoded *.pdf *.cbz.

  • The "File types:" label stays: it is generic across launchers.

Steps

  • [x] 1. src/Launchers.h: add usesDefaultApp to Launcher.
  • [x] 2. src/Launchers.cpp: add the "documents" launcher to

defaultLaunchers() with extensions pdf, cbz.

  • [x] 3. src/ItemKind.cpp: isDocument() delegates to the launcher.
  • [x] 4. src/ItemPropertiesDialog.cpp: browse filter built from the

launcher's extensions.

  • [x] 5. src/LaunchersDialog.{h,cpp}: hide the runners section for a

usesDefaultApp launcher, show a note instead.

  • [x] 6. Build pmane-sa (serial, cmake --build build --target pmane-sa;

the PATH cmake is shadowed by a broken VSCode-extension copy, so
/usr/bin/cmake run with LD_LIBRARY_PATH unset was used).

Refresh also the default icons of file types when a drive mounts

<sub>2026-11-08-0852-refresh-also-the-default-icons-of-file-types-when-a-drive-mounts.md — 2026-11-08 08:52</sub>

Follow-up to the Window > Refresh / drive-mount refresh work: an icon
customized as the default for a file type (Options > Default Icons) is not
refreshed when the drive holding its file mounts, while other items' icons
are. Cause: DefaultIcons.cpp keeps the artwork it read per file type in a
static cache, and caches the null result too when the file was missing, so
after a mount refreshIcons() -> completeProgramItem() ->
defaultIconForPath() still gets the stale null from the cache.

Steps

  • [x] 1. src/DefaultIcons.h/.cpp: add clearDefaultIconCache(), which

drops the cached artwork per file type (the settings themselves are
kept).

  • [x] 2. src/MainWindow.cpp: call it at the top of refreshIcons(), so

both the mount signal and Window > Refresh re-read the default
icons' files before the groups re-derive their icons.

  • [x] 3. Build and fix any errors; reproduce the bug and the fix with a

headless test against DefaultIcons.cpp.

  • [x] 4. Mark the plan complete, write sumup.md, archive the plan.

<sub>Filed by prel from the completed plans at commit time.</sub>