make style consistent

This commit is contained in:
Daniel Micay 2013-02-20 02:37:46 -05:00
parent 8a2a053857
commit c41934c5fd
1 changed files with 8 additions and 11 deletions

View File

@ -756,33 +756,30 @@ gboolean entry_key_press_cb(GtkEntry *entry, GdkEventKey *event, keybind_info *i
case GDK_KEY_7: case GDK_KEY_7:
case GDK_KEY_8: case GDK_KEY_8:
case GDK_KEY_9: case GDK_KEY_9:
if(info->panel.mode == overlay_mode::urlselect && info->config.quick_url) if (info->panel.mode == overlay_mode::urlselect && info->config.quick_url) {
{
const char *const text = gtk_entry_get_text(entry); const char *const text = gtk_entry_get_text(entry);
char* fulltext = g_strndup(text, strlen(text)+1); char *fulltext = g_strndup(text, strlen(text) + 1);
fulltext[strlen(text)] = (char)event->keyval; fulltext[strlen(text)] = (char)event->keyval;
gboolean exalpha = FALSE; gboolean exalpha = FALSE;
for(int i = 0; text[i] != '\0'; i++) { for (unsigned i = 0; text[i] != '\0'; i++) {
if(!g_ascii_isdigit(text[i])) { if (!g_ascii_isdigit(text[i])) {
exalpha = TRUE; exalpha = TRUE;
break; break;
} }
} }
if(exalpha) if (exalpha)
break; break;
char* str_ptr = (char*)malloc(sizeof(text)); char *str_ptr = (char*)malloc(sizeof(text));
sprintf(str_ptr, "%d", (int)info->panel.url_list.size()); sprintf(str_ptr, "%d", (int)info->panel.url_list.size());
int url_num = (int)strlen(str_ptr); int url_num = (int)strlen(str_ptr);
delete str_ptr; free(str_ptr);
int inp_num = (int)strlen(fulltext); int inp_num = (int)strlen(fulltext);
if(url_num == inp_num) if (url_num == inp_num) {
{
launch_url(info->config.browser, fulltext, &info->panel); launch_url(info->config.browser, fulltext, &info->panel);
ret = TRUE; ret = TRUE;
} }
} }
break; break;
case GDK_KEY_Tab: case GDK_KEY_Tab:
synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down); synthesize_keypress(GTK_WIDGET(entry), GDK_KEY_Down);
return TRUE; return TRUE;