Merge pull request #556 from bebehei/cleanup

Cleanup
This commit is contained in:
Nikos Tsipinakis 2018-11-01 22:14:41 +02:00 committed by GitHub
commit 5eb34fae4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 15 additions and 22 deletions

View File

@ -569,7 +569,7 @@ static struct raw_image *get_raw_image_from_data_hint(GVariant *icon_data)
return image;
}
int initdbus(void)
int dbus_init(void)
{
guint owner_id;
@ -592,7 +592,7 @@ int initdbus(void)
return owner_id;
}
void dbus_tear_down(int owner_id)
void dbus_teardown(int owner_id)
{
g_clear_pointer(&introspection_data, g_dbus_node_info_unref);

View File

@ -15,8 +15,8 @@ enum reason {
REASON_MAX = 4, /**< Maximum value, useful for boundary checking */
};
int initdbus(void);
void dbus_tear_down(int id);
int dbus_init(void);
void dbus_teardown(int id);
void signal_notification_closed(struct notification *n, enum reason reason);
void signal_action_invoked(const struct notification *n, const char *identifier);

View File

@ -30,8 +30,6 @@
GMainLoop *mainloop = NULL;
GSList *rules = NULL;
/* misc functions */
static gboolean run(void *data);
@ -143,7 +141,7 @@ int dunst_main(int argc, char *argv[])
usage(EXIT_SUCCESS);
}
int owner_id = initdbus();
int dbus_owner_id = dbus_init();
mainloop = g_main_loop_new(NULL, FALSE);
@ -182,7 +180,7 @@ int dunst_main(int argc, char *argv[])
g_source_remove(term_src);
g_source_remove(int_src);
dbus_tear_down(owner_id);
dbus_teardown(dbus_owner_id);
teardown();

View File

@ -14,7 +14,6 @@
#define ColFG 1
#define ColBG 0
extern GSList *rules;
extern const char *colors[3][3];
void wake_up(void);
@ -23,8 +22,6 @@ int dunst_main(int argc, char *argv[]);
void usage(int exit_status);
void print_version(void);
void context_menu(void);
void pause_signal_handler(int sig);
#endif
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */

View File

@ -15,13 +15,6 @@ static bool is_readable_file(const char *filename)
return (access(filename, R_OK) != -1);
}
const char *get_filename_ext(const char *filename)
{
const char *dot = strrchr(filename, '.');
if (!dot || dot == filename) return "";
return dot + 1;
}
static cairo_status_t read_from_buf(void *closure, unsigned char *data, unsigned int size)
{
GByteArray *buf = (GByteArray *)closure;

View File

@ -270,10 +270,7 @@ char *invoke_dmenu(const char *dmenu_input)
return ret;
}
/*
* Open the context menu that let's the user
* select urls/actions/etc
*/
/* see menu.h */
void context_menu(void)
{
GError *err = NULL;

View File

@ -7,5 +7,10 @@ void open_browser(const char *in);
void invoke_action(const char *action);
void regex_teardown(void);
/**
* Open the context menu that lets the user select urls/actions/etc.
*/
void context_menu(void);
#endif
/* vim: set tabstop=8 shiftwidth=8 expandtab textwidth=0: */

View File

@ -7,6 +7,8 @@
#include "dunst.h"
GSList *rules = NULL;
/*
* Apply rule to notification.
*/

View File

@ -24,6 +24,7 @@
#include "src/dunst.h"
#include "src/log.h"
#include "src/markup.h"
#include "src/menu.h"
#include "src/notification.h"
#include "src/queues.h"
#include "src/settings.h"