summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hammond <chipx86@chipx86.com>2005-08-10 08:16:16 +0000
committerChristian Hammond <chipx86@chipx86.com>2005-08-10 08:16:16 +0000
commit341489c738e2273591ec7e01b7b9140fc30f992d (patch)
treefd0a7563059578431a415beba64cfb02c65d477e
parenta0273b6c37e7e538a609b97c88a67a4d44177185 (diff)
downloadlibnotify-341489c738e2273591ec7e01b7b9140fc30f992d.tar.gz
Simplify notify-send a little, and nuke tools/test-replace. It doesn't belong there.
-rw-r--r--ChangeLog7
-rw-r--r--tools/notify-send.c16
-rw-r--r--tools/test-replace.c28
3 files changed, 13 insertions, 38 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c11346..7a8d112 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
* NEWS:
diff --git a/tools/notify-send.c b/tools/notify-send.c
index 63a61ff..dd07be4 100644
--- a/tools/notify-send.c
+++ b/tools/notify-send.c
@@ -74,8 +74,7 @@ main(int argc, const char **argv)
exit(1);
}
- if (args[0] != NULL)
- summary = args[0];
+ summary = args[0];
if (summary == NULL)
{
@@ -83,15 +82,12 @@ main(int argc, const char **argv)
exit(1);
}
- if (args[1] != NULL)
- {
- body = args[1];
+ body = args[1];
- if (args[2] != NULL)
- {
- poptPrintUsage(opt_ctx, stderr, 0);
- exit(1);
- }
+ if (body != NULL && args[2] != NULL)
+ {
+ poptPrintUsage(opt_ctx, stderr, 0);
+ exit(1);
}
if (icons != NULL)
diff --git a/tools/test-replace.c b/tools/test-replace.c
deleted file mode 100644
index feb624e..0000000
--- a/tools/test-replace.c
+++ /dev/null
@@ -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;
-}