Commit Graph

18 Commits

Author SHA1 Message Date
Mike Sharov 82e16c8630 Update localization string use and data
Review the code for proper use of localized strings. Fix display code to
always output them as utf8. Recreate the localization template with the
strings currently in use. Convert all existing .po files to utf8. Run
msgmerge on all .po files to update strings to match the new template.

Due to my lack of experience in using gettext and subsequent avoidance
of messing with it, the localization data has not been updated in quite
some time and most strings have become obsolete. This unfortunately has
resulted in wasted effort from some translators, most recently @J0hsHH
and @Strahinja, to whom I can only offer an apology and an invitation to
review their translations.
2021-10-25 13:46:37 -04:00
Mike Sharov 5792d4aebd Remove html_entities configuration
Stop reading or creating the html_entities config file. libxml
htmlEntityLookup already knows about all the entities, so there is no
reason to make the user type them in manually.
2021-09-18 14:46:55 -04:00
Mike Sharov 62c0bd5e0e Store feed list as OPML
The old format consisted of |-separated lines, one per feed. OPML is the
usual standard for RSS feed lists, and snownews included the opml2snow
utility to convert to and from it. This commit converts urls format to
native OPML, removing the need for the utility. The file is also renamed
from urls to urls.opml.
2021-04-11 17:36:45 -04:00
Mike Sharov 6d776956ec Move configuration and cache to XDG dirs
snownews kept configuration in ~/.snownews and the feed cache in
~/.snownews/cache. This commit moves configuration to ~/.config/snownews
and the cache to ~/.local/share/snownews, conforming to the XDG basedir
specification. snownews will migrate old settings to the new location.
2021-04-11 14:16:53 -04:00
Mike Sharov 5604d30c00 Shorten source filenames 2021-04-11 13:16:08 -04:00
Mike Sharov fe24fb933e Use libcurl to download feeds
Replace the custom HTTP client with a libcurl dependency. This
considerably increases snownews capabilities. Most importantly,
https feeds are now supported without using external downloaders.

A lot of code supporting the old HTTP client became obsolete
and was removed, including the direct zlib dependency.
2021-04-10 18:43:09 -04:00
Mike Sharov 23a08804f8 Run code through indent
This mainly changes the indentation level from 8 to 4 spaces,
because I have difficulty working with the wide indents.
There should be no non-whitespace changes here.
2021-04-09 17:56:41 -04:00
Mike Sharov 58e8344a82 Add SNOWNEWS_CONFIG_DIR and SNOWNEWS_CACHE_DIR in config.h to replace hardcoded paths 2018-04-30 15:41:50 -04:00
Mike Sharov 37417ab434 Reduce writes to ~/.snownews
Write configuration files only when changed
	Write cache file only when the feed changes
	Write pid lockfile to XDG_RUNTIME_DIR, if available
2018-04-30 15:30:36 -04:00
Mike Sharov 110145fe13 Remove output to error.log file
This was used only to report http errors. These are already
	printed as part of feed status, and on the status bar after
	the error occured. This commit changes to syslog calls.
2018-04-30 12:53:02 -04:00
Mike Sharov abf9966f5c Sort struct members by type to improve packing
Improve member naming, such as next_ptr to next, override to custom_title, etc.
2018-04-30 11:40:24 -04:00
Mike Sharov 24a28f44d0 Move all global variabls to main.c
Move all global struct definitions to main.h
Merge all global settings into struct settings
Prefix all global variables with _ to emphasize they are global
2018-04-30 11:15:42 -04:00
Mike Sharov 5359416458 General cleanup
Reduce variable scope
	Make functions static when possible
	Make vars const when possible
	Make vars unsigned when possible
	Use bool type from stdbool.h
	Rename some confusingly named variables (i.e. tmp, tmp2)
    	Prefer stack storage to same-scope malloc/free
	Prefer enums for constants
	Prefer sprintf to strcat and other tricks
	Simplify redundant blocks
	Simplify strtok flow
	Remove unnecessary parentheses and braces
	Replace some magic constants with clearer alternatives
	Remove libm dependency (log10 in about.c)
	Make highlight logic in interface.c more consistent
	Fix wrong item being hashed in digcalc
	Remove clear to reduce flicker
	Use = {} for zero-initializing
	Use calloc instead of malloc/manual zeroing
	Make MainQuit be called with an error in a signal handler
	Fix file opening modes to match intended use
	Read and display error log in window instead of using pager
	Remove non-ascii characters from setup.c; replace with hex codes
2018-04-30 09:47:10 -04:00
Mike Sharov 7afdc53fdc Remove version.h. Use version strings written by configure. 2018-04-27 11:16:48 -04:00
Mike Sharov cea1dafb04 Convert all block comments to line comments.
Remove non-ascii characters from source, replace with hex printf.
Translate german comments to english.
Remove profanity from comments.
2018-04-27 10:47:43 -04:00
Mike Sharov f1a7b649f6 Update copyright headers to current recommendations
Recommended header wording copied from https://www.gnu.org/licenses/gpl-howto.html
	The only two changes are to use the project name, Snownews,
	instead of "this program", to clarify that the entire project is
	under the GPL license, rather than only the file with the header.
	The second change is to replace snail mail address with the license
	URL. It is unreasonable to expect users to send an actual letter to
	a US address if the user is in, say, Germany. Postage is expensive.
2018-04-27 09:31:21 -04:00
Koz 0f7c424f3f Relicensing to GPL-3.0 2017-10-24 11:37:27 +13:00
Oliver Feiler 486fa09995 Import the old snownews code into git. The old hg repo blew up anyway. :( 2015-07-02 18:27:59 +02:00