756 Commits

Author SHA1 Message Date
Nikos Tsipinakis
0c49b49254 Replace string_to_argv util function with g_shell_parse_argv
string_to_argv parsing was very simplistic and didn't properly handle
quotations. Since we are already using glib, g_shell_parse_argv serves
the same purpose with much better parsing and error handling.
2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
f0808f8d3f Fix alignment setting documentation
`alignment` specifies the alignment of the text within the notifications,
not the alignment of the notifications themselves.
2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
38856bc705 Fix wrong config path in notification test suite 2017-02-05 13:00:59 +02:00
Nikos Tsipinakis
4d55ccb0ee Check against MARKUP_NULL when checking if markup is set
Setting markup_mode to -1 might not work since in some implementations
enum might not be signed. For convenience, add a new enum value
`MARKUP_NULL` to serve the same purpose.
2017-02-05 13:00:59 +02:00
Eizen
51d5e57967 Update changelog and man page 2017-02-04 22:24:33 -03:00
Nikos Tsipinakis
d445661031 Add simple test for notification_replace_format 2017-02-04 22:10:51 +02:00
Nikos Tsipinakis
4e1b97f3cc Merge allow_markup and plain_text into markup
Merge the allow_markup and plain_text settings into a single setting.

These 2 settings had a similar function, allow_markup controlled whether
markup was parsed or stripped and plain_text whether the notification
was escaped and displayed as is.

To cover all the possible combinations of the settings mentioned above
`markup` can take the following values:

full:  The equivalent of allow_markup yes, plain_text no.
       Passes the text straight to pango with minimal parsing. All valid
       pango tags will be parsed.

strip: The equivalent of allow_markup no, plain_text no.
       Strips the markup using string_strip_delimited. The parsing is
       simplistic and if there are any unescaped '<' and/or '>'
       characters it might get tripped and strip out actual text.

       According to the GNOME notification specification, if a server
       doesn't support markup(and we don't advertise that we do if it is
       turned off) it should be stripped clientside, so this setting
       should rarely be used. It is mainly left in for compatibility
       with broken clients that don't follow the specification.

no:   The equivalent of allow_markup [yes/no](any value), plain_text
      yes.
      Makes the notification content be rendered as plain text
      regardless if it contains markup. Any Markup will be shown as
      regular text.

Markup inside 'format' will still be parsed regardless of what markup is
set to.

Closes #279
2017-02-04 22:10:51 +02:00
Nikos Tsipinakis
4aa4e93123 Format the settings file better 2017-02-04 22:10:51 +02:00
Eizen
0c7406f1ba Merge pull request #290 from 'EdwardBetts-master' 2017-02-01 12:45:18 -03:00
Edward Betts
d73526975e fix spelling mistakes 2017-02-01 10:02:01 +00:00
Eizen
c7a19d9eb8 Update Changelog 2017-01-30 16:36:15 -03:00
Eizen
36ad645c47 Update Readme 2017-01-29 16:18:22 -03:00
Nikos Tsipinakis
3126714b79 Merge pull request #287 from fkmclane/patch-1
fix 'always_run_script' typo
2017-01-29 19:48:42 +02:00
Foster McLane
d6e2e70cd8 fix 'always_run_script' typo 2017-01-29 12:30:24 -05:00
Nikos Tsipinakis
0deff4412e Add initial notification test suite
The beginnings of the notification test suite, currently only includes
tests for `notification_is_duplicate`.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
a788770a0f Add the ability to call load_settings more than once
free_ini() didn't properly reset `section_count` and `sections` which
caused a segfault if load_ini_file was called multiple times in the same
run.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
63bb4ad857 Move setting enums to settings.h
Not sure why these were in dunst.h in the first place since they are
mostly used by the settings struct.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
964688699e Use include guards consistently
* Don't mix pragma guards and include guards, prefer classic include
  guards since apparently pragma guards are not a standard yet.
* Use the DUNST_FILE_H naming convention for all include guards.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
f34b846041 Fix memory leaks in the unit tests
Making valgrind complain less should help finding actual memory leaks in
the long run.
2017-01-29 15:32:36 +02:00
Nikos Tsipinakis
a3cce0ec2f Add raw_icon and timeout to notification printout 2017-01-28 12:16:20 +02:00
Nikos Tsipinakis
1e735c69a6 Merge pull request #285 from Stebalien/fix-double-free
Fix a double free in on_get_capabilities.
2017-01-27 16:48:29 +02:00
Steven Allen
2b2992de38 Fix a double free in on_get_capabilities.
`value` was already being freed by `g_dbus_method_invocation_return_value`.

Fixes #215
2017-01-26 16:38:38 -08:00
Eizen
5e9c3cbc95 Fix Readme
Github markdown doesn't support irc URI scheme. Move issue tracker link to the end.
2017-01-23 17:00:47 -03:00
Eizen
97bc56847b Update README
Replace old issue tracker link. Add travis status image. Add missing dependency.
2017-01-23 16:39:34 -03:00
Nikos Tsipinakis
4afe2b6924 Vertically align icons 2017-01-21 09:37:02 +02:00
Nikos Tsipinakis
f51f9a19b7 Add missing semicolon 2017-01-21 09:19:02 +02:00
Nikos Tsipinakis
bba3cfe700 Fix segfault when checking for duplicate notifications with raw icons
If a notification has a raw icon, icon is set to NULL which was passed
without checking to strcmp. We don't (yet) support comparing raw icons so
if a raw icon is set, we can safely assume the notification is not a
duplicate.
2017-01-21 09:13:03 +02:00
John Chen
1e477395d9 Fix #281 bad free. Also fix a memory leak. (#282)
* Fix #281 bad free. Also fix a memory leak.

With `n->icon = r->new_icon` and later `free(n->icon)`
`r->new_icon` is wrongly freed. Fix that with strdup.
Also fix an obvious memory leak by the way.
2017-01-21 08:38:36 +02:00
Nikos Tsipinakis
dd4deb3b00 Fix raw icon error handling in dunstify 2017-01-20 19:54:37 +02:00
Nikos Tsipinakis
86c917fc95 Implement raw icon support for dunstify
Add the ability to send raw icons with dunstify -I <file path>.
2017-01-20 19:26:16 +02:00
Eizen
ec7905f50f Check file existence instead of null string 2017-01-18 16:58:48 -03:00
Eizen
ce37a46b0f Fix svg icons and free call
Now looks properly in folder for svg icons. Also g_free should be used for maybe_icon_path.
2017-01-18 01:06:27 -03:00
Nikos Tsipinakis
c4a002bc79 Initialise default icon before checking for duplicates
Since we are also comparing the icons, the icon path should be set
before the duplicate check is done
2017-01-16 17:46:06 +02:00
Nikos Tsipinakis
f0ca0c8e6b Merge pull request #278 from dunst-project/unit_testing
Merge the work that was done in a separate repository.
2017-01-14 20:32:56 +02:00
Sascha kruse
a44a870728 travis: irc notifications 2017-01-13 19:10:12 +01:00
Sascha kruse
88760c98bd .travis.yml: add missing config 2017-01-13 19:04:34 +01:00
Sascha kruse
36e008d3ac travis: use ubuntu 14.04
on ubuntu 12.04 the dependencies are too old
2017-01-13 18:51:26 +01:00
Sascha kruse
5b34cc2455 .travis.yml: explicitly list dependencies 2017-01-13 18:42:08 +01:00
Sascha kruse
d468e3ed5c initial .travis.yml 2017-01-13 18:37:01 +01:00
Sascha kruse
cfef422515 run tests on 'make test' 2017-01-13 17:37:01 +01:00
Sascha kruse
3dead11869 Merge remote-tracking branch 'tsipinakis/master' into unit_testing 2017-01-13 17:36:08 +01:00
Sascha kruse
23d8755b81 remove unmaintained notice 2017-01-12 16:01:21 +01:00
Nikos Tsipinakis
2614b4d06e Move functional tests to a different subdirectory 2017-01-04 11:13:21 +02:00
Nikos Tsipinakis
ae87efc0a2 Fix a few minor issues in the makefile & remove debug target
* Fix a bug that would cause distclean to fail if config.h didn't exist
* Make sure the options target is run when running make dunst
* Remove debug target as the optimization override it was doing was only
  applied in the linking phase. Optimizations are applied during
  compilation, not linking, and I don't see any easy way to fix that so
  let's drop the target entirely.
2017-01-04 11:05:10 +02:00
Nikos Tsipinakis
655abd7cc8 Remove unnecessary notification field initializations
Since notification_create was implemented memory is zeroed when a
notification is allocated, as such we don't need to manually set things
to null.
2017-01-01 20:06:01 +02:00
Nikos Tsipinakis
9ec8dbe5db Initialize null fields with sane defaults in notification_init 2017-01-01 20:04:59 +02:00
Nikos Tsipinakis
c6d783f5e2 Replace null checks with assert calls
In my opinion, it's better to crash early when something is wrong than
to pretend it never happened. This change will allow us to catch more
in the long run.
2017-01-01 17:15:29 +02:00
Nikos Tsipinakis
86fbde2de1 Implement distclean target
distclean target should restore the directory tree to the state it
originally before make was invoked. In our case it means calling the
clean target to remove the compiled blobs and removing the
auto-generated config.h.
2017-01-01 17:08:10 +02:00
Nikos Tsipinakis
0cb1524cc6 Don't check return status of notification_create
notification_create is guaranteed to return a pointer to a notification,
if the memory allocation fails it throws an error and exits the program.
2017-01-01 17:05:25 +02:00
Nikos Tsipinakis
0a0c02021d Update functions in dbus.c to use camel_case for consistency 2016-12-22 20:00:45 +02:00