Browse Source

background: Discard broken backgrounds when opening configuration dialog

master
Kim Woelders 1 month ago
parent
commit
8878d862fd
  1. 17
      src/backgrounds.c

17
src/backgrounds.c

@ -1408,6 +1408,22 @@ typedef struct {
static void BG_RedrawView(Dialog * d);
static void BGSettingsGoTo(Dialog * d, Background * bg);
static void
_BackgroundsClean(void)
{
Background *bg, *tmp;
LIST_FOR_EACH_SAFE(Background, &bg_list, bg, tmp)
{
/* Get full path to files */
_BackgroundGetBgFile(bg);
/* Discard if bg file is given but cannot be found (ignore bad fg) */
if (bg->bg.file && !exists(bg->bg.file))
BackgroundDestroy(bg);
}
}
static void
_DlgApplyBG(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
{
@ -1951,6 +1967,7 @@ _DlgFillBackground(Dialog * d, DItem * table, void *data)
if (!Conf.backgrounds.no_scan)
ScanBackgroundMenu();
_BackgroundsClean();
if (!bg)
bg = DeskBackgroundGet(DesksGetCurrent());

Loading…
Cancel
Save