• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ settings_get_bool函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中settings_get_bool函数的典型用法代码示例。如果您正苦于以下问题:C++ settings_get_bool函数的具体用法?C++ settings_get_bool怎么用?C++ settings_get_bool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了settings_get_bool函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: g_return_val_if_fail

char *channel_get_nickmode(CHANNEL_REC *channel, const char *nick)
{
        NICK_REC *nickrec;
        char *emptystr;

	g_return_val_if_fail(nick != NULL, NULL);

	if (!settings_get_bool("show_nickmode"))
                return "";

        emptystr = settings_get_bool("show_nickmode_empty") ? " " : "";

	nickrec = channel == NULL ? NULL :
		nicklist_find(channel, nick);
	return nickrec == NULL ? emptystr :
		(nickrec->op ? "@" : (nickrec->voice ? "+" : emptystr));
}
开发者ID:svn2github,项目名称:irssi,代码行数:17,代码来源:fe-messages.c


示例2: create_windows

static void create_windows(void)
{
	WINDOW_REC *window;
	int have_status = settings_get_bool("use_status_window");

	window = window_find_name("(status)");
	if (have_status) {
		if (window == NULL) {
			window = window_create(NULL, TRUE);
			window_set_refnum(window, 1);
			window_set_name(window, "(status)");
			window_set_level(window, MSGLEVEL_ALL ^
					 (settings_get_bool("use_msgs_window") ?
					  MSGS_WINDOW_LEVELS : 0));
			window_set_immortal(window, TRUE);
		}
	} else {
		if (window != NULL) {
			window_set_name(window, NULL);
			window_set_level(window, 0);
			window_set_immortal(window, FALSE);
		}
	}

	window = window_find_name("(msgs)");
	if (settings_get_bool("use_msgs_window")) {
		if (window == NULL) {
			window = window_create(NULL, TRUE);
			window_set_refnum(window, have_status ? 2 : 1);
			window_set_name(window, "(msgs)");
			window_set_level(window, MSGS_WINDOW_LEVELS);
			window_set_immortal(window, TRUE);
		}
	} else {
		if (window != NULL) {
			window_set_name(window, NULL);
			window_set_level(window, 0);
			window_set_immortal(window, FALSE);
		}
	}

	if (windows == NULL) {
		/* we have to have at least one window.. */
                window = window_create(NULL, TRUE);
	}
}
开发者ID:rrebello,项目名称:irssi,代码行数:46,代码来源:fe-common-core.c


示例3: sig_server_connecting

static void
sig_server_connecting(XMPP_SERVER_REC *server)
{
	if (!IS_XMPP_SERVER(server))
		return;
	if (settings_get_bool("xmpp_status_window"))
		fe_xmpp_status_get_window(server);
}
开发者ID:markhibberd,项目名称:irssi-xmpp,代码行数:8,代码来源:fe-xmpp-status.c


示例4: read_settings

void
read_settings(void)
{
	GSList *tmp;
	XMPP_SERVER_REC *server;
	const char *str;
	
	for (tmp = servers; tmp != NULL; tmp = tmp->next) {
		if ((server = XMPP_SERVER(tmp->data)) == NULL)
			continue;
		/* update priority */
		if (server->priority != settings_get_int("xmpp_priority"))
			signal_emit("xmpp set presence", 4, server,
			    server->show, server->away_reason,
			    settings_get_int("xmpp_priority"));
		/* update nick */
		if (settings_get_bool("xmpp_set_nick_as_username")) {
			if (strcmp(server->nick, server->user) != 0) {
				g_free(server->nick);
				server->nick = g_strdup(server->user);
			}
		} else {
			if (strcmp(server->nick, server->jid) != 0) {
				g_free(server->nick);
				server->nick = g_strdup(server->jid);
			}
		}
	}
	/* check validity */
	str = settings_get_str("xmpp_proxy_type");
#if 0
	/* TODO print error message */
	if (settings_get_bool("xmpp_use_proxy")
	    && (str == NULL || g_ascii_strcasecmp(str, XMPP_PROXY_HTTP) != 0))
		;
	str = settings_get_str("xmpp_default_away_mode");
	if (str == NULL
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_AWAY]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_CHAT]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_DND]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_XA]) != 0
	    || g_ascii_strcasecmp(str, xmpp_presence_show[XMPP_PRESENCE_ONLINE]) != 0)
		;
#endif
}
开发者ID:jahrome,项目名称:irssi-xmpp-android,代码行数:45,代码来源:xmpp-settings.c


示例5: event_text

static void event_text(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
{
	CHANNEL_REC *channel;
	GList *comp;
	char *line, *str, *ptr, comp_char;

	g_return_if_fail(data != NULL);
	if (item == NULL) return;

	line = settings_get_bool("expand_escapes") ?
		expand_escapes(data, server, item) : g_strdup(data);
	comp_char = *settings_get_str("completion_char");

	/* check for automatic nick completion */
        ptr = NULL;
	comp = NULL;
	channel = CHANNEL(item);

	if (channel != NULL && comp_char != '\0' &&
	    settings_get_bool("completion_auto")) {
		ptr = strchr(line, comp_char);
		if (ptr != NULL) {
			*ptr++ = '\0';
			if (nicklist_find(channel, line) == NULL) {
				comp = completion_channel_nicks(channel,
								line, NULL);
			}
		}
	}

	str = g_strdup_printf(ptr == NULL ? "%s %s" : "%s %s%c%s", item->name,
			      comp != NULL ? (char *) comp->data : line,
			      comp_char, ptr);
	signal_emit("command msg", 3, str, server, item);

	g_free(str);
	g_free(line);

	if (comp != NULL) {
		g_list_foreach(comp, (GFunc) g_free, NULL);
		g_list_free(comp);
	}

	signal_stop();
}
开发者ID:svn2github,项目名称:irssi,代码行数:45,代码来源:chat-completion.c


示例6: sig_statusbar_activity_hilight

static void sig_statusbar_activity_hilight(WINDOW_REC *window, gpointer oldlevel)
{
    GList *tmp;
    int inspos;

    g_return_if_fail(window != NULL);

    if (settings_get_bool("actlist_moves"))
    {
	/* Move the window to the first in the activity list */
	if (g_list_find(activity_list, window) != NULL)
	    activity_list = g_list_remove(activity_list, window);
	if (window->new_data != 0)
	    activity_list = g_list_prepend(activity_list, window);
	statusbar_item_redraw(activity_item);
	return;
    }

    if (g_list_find(activity_list, window) != NULL)
    {
	/* already in activity list */
	if (window->new_data == 0)
	{
	    /* remove from activity list */
	    activity_list = g_list_remove(activity_list, window);
	    statusbar_item_redraw(activity_item);
	}
	else if (window->new_data != GPOINTER_TO_INT(oldlevel) ||
		 window->last_color != 0)
	{
		/* different level as last time (or maybe different
		   hilight color?), just redraw it. */
		statusbar_item_redraw(activity_item);
	}
        return;
    }

    if (window->new_data == 0)
	    return;

    /* add window to activity list .. */
    inspos = 0;
    for (tmp = activity_list; tmp != NULL; tmp = tmp->next, inspos++)
    {
        WINDOW_REC *rec = tmp->data;

	if (window->refnum < rec->refnum)
	{
	    activity_list = g_list_insert(activity_list, window, inspos);
	    break;
	}
    }
    if (tmp == NULL)
	activity_list = g_list_append(activity_list, window);

    statusbar_item_redraw(activity_item);
}
开发者ID:svn2github,项目名称:irssi,代码行数:57,代码来源:statusbar-items.c


示例7: gui_windows_reset_settings

void gui_windows_reset_settings(void)
{
	GSList *tmp;

	for (tmp = windows; tmp != NULL; tmp = tmp->next) {
		WINDOW_REC *rec = tmp->data;
                GUI_WINDOW_REC *gui = WINDOW_GUI(rec);

                textbuffer_view_set_default_indent(gui->view,
						   settings_get_int("indent"),
						   !settings_get_bool("indent_always"),
                                                   get_default_indent_func());

		textbuffer_view_set_scroll(gui->view,
					   gui->use_scroll ? gui->scroll :
					   settings_get_bool("scroll"));
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:18,代码来源:gui-windows.c


示例8: sig_message_own_nick

static void sig_message_own_nick(SERVER_REC *server, const char *newnick,
				 const char *oldnick, const char *address)
{
        if (!settings_get_bool("show_own_nickchange_once"))
		print_nick_change(server, newnick, oldnick, address, TRUE);
	else {
		printformat(server, NULL, MSGLEVEL_NICKS,
			    TXT_YOUR_NICK_CHANGED, oldnick, newnick, "");
	}
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:fe-messages.c


示例9: sig_message_own_public

static void
sig_message_own_public(SERVER_REC *server, char *msg, char *target)
{
	WINDOW_REC *window;
	CHANNEL_REC *channel;
	char *nick, *nickmode, *freemsg = NULL, *recoded;
	gboolean print_channel;

	g_return_if_fail(server != NULL);
	g_return_if_fail(msg != NULL);
	g_return_if_fail(target != NULL);
	if (!IS_XMPP_SERVER(server))
		return;
	channel = channel_find(server, target);
	if (channel == NULL || channel->ownnick == NULL)
		return;
	nick = channel->ownnick->nick;
	nickmode = channel_get_nickmode(CHANNEL(channel), nick);
	window = (channel == NULL) ?
	    NULL : window_item_window((WI_ITEM_REC *)channel);
	print_channel = (window == NULL ||
	    window->active != (WI_ITEM_REC *) channel);
	if (!print_channel && settings_get_bool("print_active_channel") &&
	    window != NULL && g_slist_length(window->items) > 1)
		print_channel = TRUE;
	if (settings_get_bool("emphasis"))
		msg = freemsg = expand_emphasis((WI_ITEM_REC *)channel, msg);
	/* ugly from irssi: recode the sent message back for printing */
	recoded = recode_in(SERVER(server), msg, target);
	if (!print_channel)
		printformat_module(CORE_MODULE_NAME, server, target,
		    MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
		    TXT_OWN_MSG, nick, recoded, nickmode);
	else
		printformat_module(CORE_MODULE_NAME, server, target,
		    MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
		    TXT_OWN_MSG_CHANNEL, nick, target, recoded, nickmode);
	g_free(recoded);
	g_free(nickmode);
	g_free_not_null(freemsg);
	signal_stop();
	/* emit signal for chat-completion */
}
开发者ID:fschlich,项目名称:irssi-xmpp,代码行数:43,代码来源:fe-xmpp-messages.c


示例10: g_strdup

static char *channel_get_nickmode_rec(NICK_REC *nickrec)
{
        char *emptystr;
	char *nickmode;

	if (!settings_get_bool("show_nickmode"))
                return g_strdup("");

        emptystr = settings_get_bool("show_nickmode_empty") ? " " : "";

	if (nickrec == NULL || nickrec->prefixes[0] == '\0')
		nickmode = g_strdup(emptystr);
	else {
		nickmode = g_malloc(2);
		nickmode[0] = nickrec->prefixes[0];
		nickmode[1] = '\0';
	}
	return nickmode;
}
开发者ID:ailin-nemui,项目名称:irssi,代码行数:19,代码来源:fe-messages.c


示例11: read_settings

static void read_settings(void)
{
	if (daytag != -1) {
		g_source_remove(daytag);
		daytag = -1;
	}

	if (settings_get_bool("timestamps"))
		daytag = g_timeout_add(30000, (GSourceFunc) sig_check_daychange, NULL);
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:windows.c


示例12: event_motd

static void event_motd(IRC_SERVER_REC *server, const char *data,
                       const char *nick, const char *addr)
{
    /* don't ignore motd anymore after 3 seconds of connection time -
       we might have called /MOTD */
    if (settings_get_bool("skip_motd") && !server->motd_got)
        return;

    print_event_received(server, data, nick, FALSE);
}
开发者ID:svn2github,项目名称:irssi,代码行数:10,代码来源:fe-events-numeric.c


示例13: set_boolean

static void set_boolean(const char *key, const char *value)
{
	if (g_strcasecmp(value, "ON") == 0)
		settings_set_bool(key, TRUE);
	else if (g_strcasecmp(value, "OFF") == 0)
		settings_set_bool(key, FALSE);
	else if (g_strcasecmp(value, "TOGGLE") == 0)
		settings_set_bool(key, !settings_get_bool(key));
	else
		printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_NOT_TOGGLE);
}
开发者ID:svn2github,项目名称:irssi,代码行数:11,代码来源:fe-settings.c


示例14: read_settings

static void read_settings(void)
{
    int old_autolog = autolog_level;

    autolog_path = settings_get_str("autolog_path");
    autolog_level = !settings_get_bool("autolog") ? 0 :
                    level2bits(settings_get_str("autolog_level"));

    if (old_autolog && !autolog_level)
        autologs_close_all();
}
开发者ID:svn2github,项目名称:irssi,代码行数:11,代码来源:fe-log.c


示例15: fe_xmpp_status_init

void
fe_xmpp_status_init(void)
{
	signal_add("server connecting", (SIGNAL_FUNC)sig_server_connecting);
	signal_add("setup changed", (SIGNAL_FUNC)sig_setup_changed);

	settings_add_bool("xmpp_lookandfeel", "xmpp_status_window", FALSE);

	if (settings_get_bool("xmpp_status_window"))
		signal_add("xmpp presence changed", sig_presence_changed);
}
开发者ID:markhibberd,项目名称:irssi-xmpp,代码行数:11,代码来源:fe-xmpp-status.c


示例16: sig_message_irc_action

static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
				   const char *nick, const char *address,
				   const char *target)
{
	void *item;
	const char *oldtarget;
        char *freemsg = NULL;
	int level;

	oldtarget = target;
	target = skip_target(IRC_SERVER(server), target);

	level = MSGLEVEL_ACTIONS |
		(ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS);

	if (ignore_check(SERVER(server), nick, address, target, msg, level))
		return;

	if (ignore_check(SERVER(server), nick, address, target, msg,
			 level | MSGLEVEL_NO_ACT))
		level |= MSGLEVEL_NO_ACT;

	if (ischannel(*target))
		item = irc_channel_find(server, target);
        else
		item = privmsg_get_query(SERVER(server), nick, FALSE, level);

	if (settings_get_bool("emphasis"))
		msg = freemsg = expand_emphasis(item, msg);

	if (ischannel(*target)) {
		/* channel action */
		if (window_item_is_active(item) && target == oldtarget) {
			/* message to active channel in window */
			printformat(server, target, level,
				    IRCTXT_ACTION_PUBLIC, nick, msg);
		} else {
			/* message to not existing/active channel, or to @/+ */
			printformat(server, target, level,
				    IRCTXT_ACTION_PUBLIC_CHANNEL,
				    nick, oldtarget, msg);
		}
	} else {
		/* private action */
		printformat(server, nick, MSGLEVEL_ACTIONS | MSGLEVEL_MSGS,
			    item == NULL ? IRCTXT_ACTION_PRIVATE :
			    IRCTXT_ACTION_PRIVATE_QUERY,
			    nick, address == NULL ? "" : address, msg);
	}
	
	g_free_not_null(freemsg);
}
开发者ID:ameidatou,项目名称:irssi,代码行数:52,代码来源:fe-irc-messages.c


示例17: MAIN_WINDOW_TEXT_HEIGHT

static GUI_WINDOW_REC *gui_window_init(WINDOW_REC *window,
				       MAIN_WINDOW_REC *parent)
{
	GUI_WINDOW_REC *gui;

	window->width = parent->width;
        window->height = MAIN_WINDOW_TEXT_HEIGHT(parent);

	gui = g_new0(GUI_WINDOW_REC, 1);
	gui->parent = parent;
	gui->view = textbuffer_view_create(textbuffer_create(),
					   window->width, window->height,
					   settings_get_bool("scroll"),
					   term_type == TERM_TYPE_UTF8);
	textbuffer_view_set_default_indent(gui->view,
					   settings_get_int("indent"),
					   !settings_get_bool("indent_always"),
					   get_default_indent_func());
	if (parent->active == window)
		textbuffer_view_set_window(gui->view, parent->screen_win);
	return gui;
}
开发者ID:svn2github,项目名称:irssi,代码行数:22,代码来源:gui-windows.c


示例18: cmd_roster_full

/* SYNTAX: ROSTER FULL */
static void
cmd_roster_full(const char *data, XMPP_SERVER_REC *server, WI_ITEM_REC *item)
{
	gboolean oldvalue;

	CMD_XMPP_SERVER(server);
	oldvalue = settings_get_bool("xmpp_roster_show_offline");
	if (!oldvalue)
		settings_set_bool("xmpp_roster_show_offline", TRUE);
	signal_emit("xmpp roster show", 1, server);
	if (!oldvalue)
		settings_set_bool("xmpp_roster_show_offline", oldvalue);
}
开发者ID:markhibberd,项目名称:irssi-xmpp,代码行数:14,代码来源:xmpp-commands.c


示例19: server_start_connect

/* starts connecting to server */
int server_start_connect(SERVER_REC *server)
{
	const char *connect_address;
        int fd[2];

	g_return_val_if_fail(server != NULL, FALSE);
	if (!server->connrec->unix_socket && server->connrec->port <= 0)
		return FALSE;

	server->rawlog = rawlog_create();

	if (server->connrec->connect_handle != NULL) {
		/* already connected */
		GIOChannel *handle = server->connrec->connect_handle;

		server->connrec->connect_handle = NULL;
		server->handle = net_sendbuffer_create(handle, 0);
		server_connect_finished(server);
	} else if (server->connrec->unix_socket) {
		/* connect with unix socket */
		server_real_connect(server, NULL, server->connrec->address);
	} else {
		/* resolve host name */
		if (pipe(fd) != 0) {
			g_warning("server_connect(): pipe() failed.");
			g_free(server->tag);
			g_free(server->nick);
			return FALSE;
		}

		server->connect_pipe[0] = g_io_channel_unix_new(fd[0]);
		server->connect_pipe[1] = g_io_channel_unix_new(fd[1]);

		connect_address = server->connrec->proxy != NULL ?
			server->connrec->proxy : server->connrec->address;
		server->connect_pid =
			net_gethostbyname_nonblock(connect_address,
						   server->connect_pipe[1],
						   settings_get_bool("resolve_reverse_lookup"));
		server->connect_tag =
			g_input_add(server->connect_pipe[0], G_INPUT_READ,
				    (GInputFunction)
				    server_connect_callback_readpipe,
				    server);

		lookup_servers = g_slist_append(lookup_servers, server);

		signal_emit("server looking", 1, server);
	}
	return TRUE;
}
开发者ID:svn2github,项目名称:irssi,代码行数:52,代码来源:servers.c


示例20: settings_get_bool

char *recode_out(const SERVER_REC *server, const char *str, const char *target)
{
	char *recoded = NULL;
	const char *from = NULL;
	const char *to = NULL;
	char *translit_to = NULL;
	gboolean translit, term_is_utf8, recode;
	int len;

	if (!str)
		return NULL;

	recode = settings_get_bool("recode");
	if (!recode)
		return g_strdup(str);

	len = strlen(str);

	translit = settings_get_bool("recode_transliterate");

	to = find_conversion(server, target);
	if (to == NULL)
		/* default outgoing charset if set */
		to = settings_get_str("recode_out_default_charset");

	if (to && *to != '\0') {
		if (translit && !is_translit(to))
			to = translit_to = g_strconcat(to ,"//TRANSLIT", NULL);

		term_is_utf8 = recode_get_charset(&from);
		recoded = g_convert(str, len, to, from, NULL, NULL, NULL);
	}
	g_free(translit_to);
	if (!recoded)
		recoded = g_strdup(str);

	return recoded;
}
开发者ID:svn2github,项目名称:irssi,代码行数:38,代码来源:recode.c



注:本文中的settings_get_bool函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ settings_init函数代码示例发布时间:2022-05-30
下一篇:
C++ settings_add_bool函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap