745 Commits

Author SHA1 Message Date
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
Nikos Tsipinakis
de9c52f98f Implement notification_create function
notification_create currently simply allocates memory and zeroes it to
properly initialise a notification. Since we currently have at least 2
places in the code that create notifications(startup notification in
dunst.c and notifications from dbus in dbus.c) the creation should be
handled from a central location in case we ever need to change the
creation procedure later on.
2016-12-22 19:49:29 +02:00
Nikos Tsipinakis
6c9de72c7d Don't consider notifications duplicate if icon or urgency differ
Expand the duplication checking functionality to also check for urgency
and icons. If icons are turned off in the settings the icon check is
skipped.

Icons matching is done based on the given path, if the path differs or
an icon name is used for one notification but an absolute path for
another, the icons are considered different even if they refer to the
same file.
2016-12-22 19:45:38 +02:00
Eizen
f32659adb7 Add systemd service unit to contrib
Apply sed to reflect prefix but don't install it and clean service file in makefile. Add service file to gitignore
2016-12-21 01:57:16 -03:00
Nikos Tsipinakis
810637b2b6 Fix typos 2016-12-18 17:14:02 +02:00
Eizen
16256d316e Merge release notes into a single file 2016-12-17 17:25:46 -03:00
Luke Shumaker
2c93c7a277 Use the appropriate string search functions instead of strstr everywhere.
This mostly means using strchr, but I also found:
  option_parser.c:load_ini_file:
    - replace multiple calls to strstr with strpbrk
  notification.c:notification_init:
    - replace string_replace in a while loop with a single call to
      string_replace_char

redo string replace all
2016-12-17 17:00:43 -03:00
Nikos Tsipinakis
187d3f9ab9 Invalid boolean values should fall back to the default
Previously, an invalid value was always false
2016-12-15 19:13:08 +02:00
Nikos Tsipinakis
a2e0a6efe7 Remove whitespace from empty line 2016-12-15 18:38:34 +02:00
Eizen
bfd24224aa Merge pull request #270 2016-12-13 20:36:55 -03:00
Nikos Tsipinakis
f54d698cba Bring default config up to date
Some of the settings weren't included in the default config before.
2016-12-11 14:14:18 +02:00
Nikos Tsipinakis
e3cbe3883a The manpage should be built to the docs directory
In the spirit of keeping everything organised, the compiled docs should
be in the same directory as the files used to compile them.
2016-12-11 13:48:12 +02:00