summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2022-02-13 20:57:09 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2022-02-13 20:57:34 +0200
commit672a534a044d811aa57e927288de50360882ac54 (patch)
treee605b769a9e40dcdf0b2976dd277ac29beb4c15d /src/app.c
parentfb71407409b2debd8e03c42faecd811d168321bf (diff)
Added a preference for maximum URL size
The setting defaults to 8 KB. Link lines with longer URLs are not recognized as links.
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 0f9249cc..a2ada36e 100644
--- a/src/app.c
+++ b/src/app.c
@@ -244,6 +244,7 @@ static iString *serializePrefs_App_(const iApp *d) {
244 appendFormat_String(str, "imageloadscroll arg:%d\n", d->prefs.loadImageInsteadOfScrolling); 244 appendFormat_String(str, "imageloadscroll arg:%d\n", d->prefs.loadImageInsteadOfScrolling);
245 appendFormat_String(str, "cachesize.set arg:%d\n", d->prefs.maxCacheSize); 245 appendFormat_String(str, "cachesize.set arg:%d\n", d->prefs.maxCacheSize);
246 appendFormat_String(str, "memorysize.set arg:%d\n", d->prefs.maxMemorySize); 246 appendFormat_String(str, "memorysize.set arg:%d\n", d->prefs.maxMemorySize);
247 appendFormat_String(str, "urlsize.set arg:%d\n", d->prefs.maxUrlSize);
247 appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs); 248 appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs);
248 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); 249 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth);
249 appendFormat_String(str, "linespacing.set arg:%f\n", d->prefs.lineSpacing); 250 appendFormat_String(str, "linespacing.set arg:%f\n", d->prefs.lineSpacing);
@@ -1974,6 +1975,8 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) {
1974 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize")))); 1975 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.cachesize"))));
1975 postCommandf_App("memorysize.set arg:%d", 1976 postCommandf_App("memorysize.set arg:%d",
1976 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.memorysize")))); 1977 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.memorysize"))));
1978 postCommandf_App("urlsize.set arg:%d",
1979 toInt_String(text_InputWidget(findChild_Widget(d, "prefs.urlsize"))));
1977 postCommandf_App("ca.file path:%s", 1980 postCommandf_App("ca.file path:%s",
1978 cstrText_InputWidget(findChild_Widget(d, "prefs.ca.file"))); 1981 cstrText_InputWidget(findChild_Widget(d, "prefs.ca.file")));
1979 postCommandf_App("ca.path path:%s", 1982 postCommandf_App("ca.path path:%s",
@@ -2771,6 +2774,13 @@ iBool handleCommand_App(const char *cmd) {
2771 } 2774 }
2772 return iTrue; 2775 return iTrue;
2773 } 2776 }
2777 else if (equal_Command(cmd, "urlsize.set")) {
2778 d->prefs.maxUrlSize = arg_Command(cmd);
2779 if (d->prefs.maxUrlSize < 1024) {
2780 d->prefs.maxUrlSize = 1024; /* Gemini protocol requirement */
2781 }
2782 return iTrue;
2783 }
2774 else if (equal_Command(cmd, "searchurl")) { 2784 else if (equal_Command(cmd, "searchurl")) {
2775 iString *url = &d->prefs.strings[searchUrl_PrefsString]; 2785 iString *url = &d->prefs.strings[searchUrl_PrefsString];
2776 setCStr_String(url, suffixPtr_Command(cmd, "address")); 2786 setCStr_String(url, suffixPtr_Command(cmd, "address"));
@@ -3158,6 +3168,8 @@ iBool handleCommand_App(const char *cmd) {
3158 collectNewFormat_String("%d", d->prefs.maxCacheSize)); 3168 collectNewFormat_String("%d", d->prefs.maxCacheSize));
3159 setText_InputWidget(findChild_Widget(dlg, "prefs.memorysize"), 3169 setText_InputWidget(findChild_Widget(dlg, "prefs.memorysize"),
3160 collectNewFormat_String("%d", d->prefs.maxMemorySize)); 3170 collectNewFormat_String("%d", d->prefs.maxMemorySize));
3171 setText_InputWidget(findChild_Widget(dlg, "prefs.urlsize"),
3172 collectNewFormat_String("%d", d->prefs.maxUrlSize));
3161 setToggle_Widget(findChild_Widget(dlg, "prefs.decodeurls"), d->prefs.decodeUserVisibleURLs); 3173 setToggle_Widget(findChild_Widget(dlg, "prefs.decodeurls"), d->prefs.decodeUserVisibleURLs);
3162 setText_InputWidget(findChild_Widget(dlg, "prefs.searchurl"), &d->prefs.strings[searchUrl_PrefsString]); 3174 setText_InputWidget(findChild_Widget(dlg, "prefs.searchurl"), &d->prefs.strings[searchUrl_PrefsString]);
3163 setText_InputWidget(findChild_Widget(dlg, "prefs.ca.file"), &d->prefs.strings[caFile_PrefsString]); 3175 setText_InputWidget(findChild_Widget(dlg, "prefs.ca.file"), &d->prefs.strings[caFile_PrefsString]);