From 8ac461dbb8804f6e8b3638d8430b17fc7cf28075 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 3 Feb 2021 14:48:42 +0200 Subject: XDG: Check XDG_CONFIG_HOME and the user's download directory Also added a build option to disable changing the user download directory within Lagrange, since that's set via XDG config. --- src/ui/inputwidget.c | 1 + src/ui/util.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/ui') diff --git a/src/ui/inputwidget.c b/src/ui/inputwidget.c index 3f799e3c..1674040b 100644 --- a/src/ui/inputwidget.c +++ b/src/ui/inputwidget.c @@ -223,6 +223,7 @@ static void updateBuffered_InputWidget_(iInputWidget *d) { } void setText_InputWidget(iInputWidget *d, const iString *text) { + if (!d) return; if (d->inFlags & isUrl_InputWidgetFlag) { /* If user wants URLs encoded, also Punycode the domain. */ if (!prefs_App()->decodeUserVisibleURLs) { diff --git a/src/ui/util.c b/src/ui/util.c index 4d5ed916..d64a93b6 100644 --- a/src/ui/util.c +++ b/src/ui/util.c @@ -1023,6 +1023,7 @@ static void makeTwoColumnHeading_(const char *title, iWidget *headings, iWidget } static void expandInputFieldWidth_(iInputWidget *input) { + if (!input) return; iWidget *page = as_Widget(input)->parent->parent->parent->parent; /* tabs > page > values > input */ as_Widget(input)->rect.size.x = right_Rect(bounds_Widget(page)) - left_Rect(bounds_Widget(constAs_Widget(input))); @@ -1056,8 +1057,10 @@ iWidget *makePreferences_Widget(void) { iWidget *headings, *values; /* General preferences. */ { appendTwoColumnPage_(tabs, "General", '1', &headings, &values); +#if defined (LAGRANGE_DOWNLOAD_EDIT) addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:"))); setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads"); +#endif addChild_Widget(headings, iClob(makeHeading_Widget("Show URL on hover:"))); addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); addChild_Widget(headings, iClob(makeHeading_Widget("Smooth scrolling:"))); -- cgit v1.2.3