Simplify notify-send a little, and nuke tools/test-replace. It doesn't belong there.

This commit is contained in:
Christian Hammond 2005-08-10 08:16:16 +00:00
parent a0273b6c37
commit 341489c738
3 changed files with 13 additions and 38 deletions

View File

@ -1,3 +1,10 @@
Wed Aug 10 01:13:56 PDT 2005 Christian Hammond <chipx86@chipx86.com>
D tools/test-replace.c:
* tools/notify-send.c:
- Simplify notify-send a little, and nuke tools/test-replace. It
doesn't belong there.
Wed Aug 10 01:12:55 PDT 2005 Christian Hammond <chipx86@chipx86.com> Wed Aug 10 01:12:55 PDT 2005 Christian Hammond <chipx86@chipx86.com>
* NEWS: * NEWS:

View File

@ -74,8 +74,7 @@ main(int argc, const char **argv)
exit(1); exit(1);
} }
if (args[0] != NULL) summary = args[0];
summary = args[0];
if (summary == NULL) if (summary == NULL)
{ {
@ -83,15 +82,12 @@ main(int argc, const char **argv)
exit(1); exit(1);
} }
if (args[1] != NULL) body = args[1];
{
body = args[1];
if (args[2] != NULL) if (body != NULL && args[2] != NULL)
{ {
poptPrintUsage(opt_ctx, stderr, 0); poptPrintUsage(opt_ctx, stderr, 0);
exit(1); exit(1);
}
} }
if (icons != NULL) if (icons != NULL)

View File

@ -1,28 +0,0 @@
#include <libnotify/notify.h>
#include <stdio.h>
#include <unistd.h>
int main() {
notify_init("Replace Test");
NotifyHandle *n = notify_send_notification(NULL, // replaces nothing
NOTIFY_URGENCY_NORMAL,
"Summary", "Content",
NULL, // no icon
FALSE, 0, // does not expire
NULL, // no user data
0); // no actions
if (!n) {
fprintf(stderr, "failed to send notification\n");
return 1;
}
sleep(3);
notify_send_notification(n, NOTIFY_URGENCY_NORMAL, "Second Summary", "Second Content",
NULL, TRUE, time(NULL) + 5, NULL, 0);
return 0;
}