background: Discard broken backgrounds when opening configuration dialog
This commit is contained in:
parent
3008713107
commit
8878d862fd
|
@ -1408,6 +1408,22 @@ typedef struct {
|
||||||
static void BG_RedrawView(Dialog * d);
|
static void BG_RedrawView(Dialog * d);
|
||||||
static void BGSettingsGoTo(Dialog * d, Background * bg);
|
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
|
static void
|
||||||
_DlgApplyBG(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
|
_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)
|
if (!Conf.backgrounds.no_scan)
|
||||||
ScanBackgroundMenu();
|
ScanBackgroundMenu();
|
||||||
|
_BackgroundsClean();
|
||||||
|
|
||||||
if (!bg)
|
if (!bg)
|
||||||
bg = DeskBackgroundGet(DesksGetCurrent());
|
bg = DeskBackgroundGet(DesksGetCurrent());
|
||||||
|
|
Loading…
Reference in New Issue