Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: BUG report (Read 2162 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

BUG report

in plugin "albumlist":

open its config dialog, double click the item in the listbox, then edit the value, click "ok", but the listbox still display the former value, don't refresh automatically.

this is the source code(include bug):
Code: [Select]
      case IDC_VIEWS | (LBN_DBLCLK<<16):
   {
       unsigned idx = uSendMessage((HWND)lp,LB_GETCURSEL,0,0);
       if (idx != (unsigned)(-1))
       {
     edit_view_param p;
     p.b_new = false;
     p.name = cfg_view_list.get_name(idx);
     p.value = cfg_view_list.get_value(idx);
     if (run_edit_view(p,wnd))
     {
         cfg_view_list.modify_item(idx,p.value);
     }
       }
   }
   break;


should be modified as the follow:
Code: [Select]
      case IDC_LIST_FILENAME | (LBN_DBLCLK<<16):
   {
       HWND list = uGetDlgItem(wnd,IDC_LIST_FILENAME);
       unsigned m = cfg_view_list.get_count();
       unsigned idx = uSendMessage((HWND)lp,LB_GETCURSEL,0,0);
       if (idx != (unsigned)(-1))
       {
     edit_view_param p;
     p.b_new = false;
     p.name = cfg_view_list.get_name(idx);
     p.value = cfg_view_list.get_value(idx);
     if (run_edit_view(p,wnd))
     {
         string8 temp;
         cfg_view_list.modify_item(idx,p.value);
         cfg_view_list.format_display(idx, temp);
         uSendMessage(list, LB_DELETESTRING, idx, 0);
         uSendMessageText(list, LB_INSERTSTRING, idx<(m-1)?idx:-1, temp );
         uSendMessage(list,LB_SETCURSEL,idx,0);
     }
       }
   }
   break;
Good good study, day day up, :)
[span style=\'color:red\']The superman is the meaning of the earth.
Let your will say: the superman shall be the meaning of the earth![/span]