Revision: 7029
Author: ek.kato
Date: Sun May 8 21:31:29 2011
Log: * emacs/candidate.c (select_candidate) : Remove unused code.
* emacs/helper.c (helper_send_im_list) : Ditto.
* notify/uim-libnotify.c : Don't use C++ style comment.
* helper/toolbar-standalone-gtk.c (motion_notify_event_cb) :
Remove unused code.
* helper/dict-word-list-win-gtk.c (activate_radio_action) : Ditto.
* helper/im-switcher-gtk.c (get_selected_im_name) : Ditto.
* uim/m17nlib.c
- (get_left_of_cursor)
- (get_right_of_cursor)
- (get_left_of_candidate)
- (get_selected_candidate)
- (get_right_of_candidate)
- Remove unused code. Simplify using MAKE_STR_DIRECTLY().
http://code.google.com/p/uim/source/detail?r=7029
Modified:
/trunk/emacs/candidate.c
/trunk/emacs/helper.c
/trunk/helper/dict-word-list-win-gtk.c
/trunk/helper/im-switcher-gtk.c
/trunk/helper/toolbar-standalone-gtk.c
/trunk/notify/uim-libnotify.c
/trunk/uim/m17nlib.c
=======================================
--- /trunk/emacs/candidate.c Thu Jan 6 18:09:56 2011
+++ /trunk/emacs/candidate.c Sun May 8 21:31:29 2011
@@ -189,10 +189,8 @@
select_candidate(uim_context context, candidate_info *cand, int index)
{
int new_page;
- int index_in_page;
new_page = cand->disp_limit ? index / cand->disp_limit : 0;
- index_in_page = cand->disp_limit ? index % cand->disp_limit : index;
cand->index = index;
=======================================
--- /trunk/emacs/helper.c Thu Jan 6 18:09:56 2011
+++ /trunk/emacs/helper.c Sun May 8 21:31:29 2011
@@ -63,18 +63,11 @@
#define HEADER_FORMAT "im_list\ncharset=%s\n"
- for (i = 0; i < uim_get_nr_im(ua->context); i++) {
- const char *name, *lang, *shortd;
- name = uim_get_im_name(ua->context, i);
- lang = uim_get_im_language(ua->context, i);
- shortd = uim_get_im_short_desc(ua->context, i);
- }
-
buflen = uim_asprintf(&buf, HEADER_FORMAT, ua->encoding);
#undef HEADER_FORMAT
- for (i = 0 ; i < uim_get_nr_im(ua->context); i++) {
+ for (i = 0 ; i < nim; i++) {
const char *name, *lang, *shortd;
char *tmpbuf;
=======================================
--- /trunk/helper/dict-word-list-win-gtk.c Fri Feb 11 22:21:43 2011
+++ /trunk/helper/dict-word-list-win-gtk.c Sun May 8 21:31:29 2011
@@ -647,13 +647,10 @@
gpointer data)
{
WordListWindow *window;
- const gchar *name, *typename;
gboolean active;
guint value;
window = WORD_LIST_WINDOW(data);
- name = gtk_action_get_name(GTK_ACTION(current));
- typename = G_OBJECT_TYPE_NAME(GTK_ACTION(current));
active = gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(current));
value = gtk_radio_action_get_current_value(GTK_RADIO_ACTION(current));
=======================================
--- /trunk/helper/im-switcher-gtk.c Fri Feb 11 19:07:35 2011
+++ /trunk/helper/im-switcher-gtk.c Sun May 8 21:31:29 2011
@@ -196,11 +196,9 @@
{
GtkTreeSelection *sel =
gtk_tree_view_get_selection(GTK_TREE_VIEW(switcher_tree_view));
GtkTreeModel *model;
- GtkTreeStore *store;
GtkTreeIter iter;
gchar *str_data;
if (gtk_tree_selection_get_selected (sel, &model, &iter) == TRUE) {
- store = GTK_TREE_STORE(model);
gtk_tree_model_get (model, &iter,
NAME_COLUMN, &str_data,
-1);
=======================================
--- /trunk/helper/toolbar-standalone-gtk.c Sat Feb 19 18:38:12 2011
+++ /trunk/helper/toolbar-standalone-gtk.c Sun May 8 21:31:29 2011
@@ -157,17 +157,6 @@
{
if (toolbar_dragging) {
gint wx, wy;
- gint w, h, sc_w, sc_h;
-
- sc_w = gdk_screen_width();
- sc_h = gdk_screen_height();
-
-#if GTK_CHECK_VERSION(2, 90, 0)
- w = gdk_window_get_width(gtk_widget_get_window(widget));
- h = gdk_window_get_height(gtk_widget_get_window(widget));
-#else
- gdk_drawable_get_size(gtk_widget_get_window(widget), &w, &h);
-#endif
wx = window_drag_start_x + ((gint)event->x_root -
pointer_drag_start_x);
wy = window_drag_start_y + ((gint)event->y_root -
pointer_drag_start_y);
=======================================
--- /trunk/notify/uim-libnotify.c Sat May 7 22:54:47 2011
+++ /trunk/notify/uim-libnotify.c Sun May 8 21:31:29 2011
@@ -74,8 +74,8 @@
}
#ifdef NOTIFY_CHECK_VERSION
- // libnotify 0.7.0 contains this API change
- // and introduced the macro NOTIFY_CHECK_VERSION.
+ /* libnotify 0.7.0 contains this API change
+ and introduced the macro NOTIFY_CHECK_VERSION. */
notification = notify_notification_new("uim", gmsg, UIM_ICON);
#else
notification = notify_notification_new("uim", gmsg, UIM_ICON, NULL);
=======================================
--- /trunk/uim/m17nlib.c Thu Jan 6 18:09:56 2011
+++ /trunk/uim/m17nlib.c Sun May 8 21:31:29 2011
@@ -279,7 +279,7 @@
static uim_lisp
get_left_of_cursor(uim_lisp id_)
{
- int id, buflen, i;
+ int id, i;
uim_lisp buf_;
char *buf, *p;
MInputContext *ic;
@@ -300,9 +300,7 @@
p = m17nlib_utf8_find_next_char(p);
*p = '\0';
- buflen = strlen(buf);
- buf_ = MAKE_STR(buf);
- free(buf);
+ buf_ = MAKE_STR_DIRECTLY(buf);
return buf_;
}
@@ -310,7 +308,7 @@
static uim_lisp
get_right_of_cursor(uim_lisp id_)
{
- int id, buflen, i;
+ int id, i;
uim_lisp buf_;
char *buf, *p;
MInputContext *ic;
@@ -327,9 +325,7 @@
for (i = 0; i < ic->cursor_pos ;i++)
p = m17nlib_utf8_find_next_char(p);
- buflen = strlen(p);
- buf_ = MAKE_STR(p);
- free(buf);
+ buf_ = MAKE_STR_DIRECTLY(p);
return buf_;
}
@@ -337,7 +333,7 @@
static uim_lisp
get_left_of_candidate(uim_lisp id_)
{
- int id, buflen, i;
+ int id, i;
uim_lisp buf_;
char *buf, *p;
MInputContext *ic;
@@ -358,9 +354,7 @@
p = m17nlib_utf8_find_next_char(p);
*p = '\0';
- buflen = strlen(buf);
- buf_ = MAKE_STR(buf);
- free(buf);
+ buf_ = MAKE_STR_DIRECTLY(buf);
return buf_;
}
@@ -368,7 +362,7 @@
static uim_lisp
get_selected_candidate(uim_lisp id_)
{
- int id, buflen, i;
+ int id, i;
uim_lisp buf_;
char *buf, *p, *start;
MInputContext *ic;
@@ -393,9 +387,7 @@
p = m17nlib_utf8_find_next_char(p);
*p = '\0';
- buflen = strlen(start);
- buf_ = MAKE_STR(start);
- free(buf);
+ buf_ = MAKE_STR_DIRECTLY(start);
return buf_;
}
@@ -403,7 +395,7 @@
static uim_lisp
get_right_of_candidate(uim_lisp id_)
{
- int id, buflen, i;
+ int id, i;
uim_lisp buf_;
char *buf, *p;
MInputContext *ic;
@@ -420,9 +412,7 @@
for (i = 0; i < ic->candidate_to ;i++)
p = m17nlib_utf8_find_next_char(p);
- buflen = strlen(p);
- buf_ = MAKE_STR(p);
- free(buf);
+ buf_ = MAKE_STR_DIRECTLY(p);
return buf_;
}