Files
qelectrotech-source-mirror/sources
ispyisail 2d889568a5 Fix bugtracker #251: title block template with slash in name fails silently
Saving a new user title block template (right-click "Cartouches
utilisateur" > "Nouveau modèle" > "Enregistrer sous") with a name
containing a slash (or other filesystem-reserved character) silently
did nothing, with no error shown. The entered name is turned directly
into a filename (TitleBlockTemplatesFilesCollection::toFileName()), so
e.g. "foo/bar" becomes a path "foo/bar.titleblock" -- since "foo/"
essentially never exists as a directory, the underlying file write
fails, but that failure was never surfaced:

- TitleBlockTemplateLocation::isValid() only checked for an empty
  name, so an invalid name still counted as "valid" and got passed
  through to save.
- QETTitleBlockTemplateEditor::saveAs(const TitleBlockTemplateLocation&)
  discarded the bool result of setTemplateXmlDescription() and
  unconditionally returned true, marking the undo stack clean as if
  the save had actually succeeded.

Fix:
- isValid() now also rejects names containing \ / : * ? " < > |,
  matching the character set that's actually unsafe once the name
  becomes a filename.
- saveAs() (the no-arg entry point that asks the user for a location)
  now shows a clear error dialog when the entered name is rejected,
  distinguishing "user cancelled" (location.name() empty) from
  "name was invalid" (non-empty but rejected by isValid()).
- saveAs(location) now checks setTemplateXmlDescription()'s return
  value and shows an error dialog instead of reporting false success
  on any future/other write failure, not just this one.

Verified: clean rebuild, only the intended files recompiled and
linked successfully. Live-tested under Xvfb: creating a new template
and using "Enregistrer sous" with the name "foo/bar" now shows
"Le nom « foo/bar » n'est pas valide : il ne doit pas contenir les
caractères suivants : \ / : * ? " < > |" instead of silently doing
nothing; reopening the save-as dialog afterward showed the name field
correctly empty (nothing was partially written). Saving again with a
valid name ("mytemplate_valid") completed with no error dialog, and
the resulting mytemplate_valid.titleblock file was confirmed present
on disk in the user's title-block collection directory.
2026-08-11 12:36:31 +12:00
..
2026-08-09 12:30:15 +02:00
2026-08-01 20:20:51 +02:00
2026-01-16 15:24:35 +01:00
2026-08-08 08:09:45 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-08-06 21:37:40 +02:00
2026-08-07 13:48:40 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-04-26 10:48:47 +02:00
2026-04-26 10:48:47 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-08-08 08:09:45 +02:00
2026-08-06 21:37:40 +02:00
2026-08-06 21:37:40 +02:00
2026-08-09 12:30:15 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-02-02 14:44:10 +01:00
2026-02-02 14:44:10 +01:00
2026-07-27 22:16:52 +02:00
2026-07-31 21:02:07 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-07-17 10:29:13 +02:00
2026-07-17 10:29:13 +02:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00
2026-01-16 15:24:35 +01:00