Browse Source

Fix command description

master
boisso 7 years ago
parent
commit
7e629db4ea
  1. 9
      k-meleon/KmCommand.cpp
  2. 3
      k-meleon/KmCommand.h

9
k-meleon/KmCommand.cpp

@ -67,22 +67,19 @@ UINT KmCmdService::GetList(kmeleonCommand* cmdList, UINT size, BOOL def)
while (pCurVal != NULL)
{
cmdList[i].id = pCurVal->value.id;
char* aCmd = strdup(T2CA(pCurVal->key));
strncpy(cmdList[i].cmd, aCmd, sizeof(cmdList[i].cmd));
cmdList[i].cmd[sizeof(cmdList[i].cmd)-1] = 0;
WideCharToMultiByte(CP_UTF8, 0, pCurVal->key, -1, cmdList[i].cmd, sizeof(cmdList[i].cmd), NULL, NULL);
//if (!IsPluginCommand(pCurVal->value.id)) {
CString str = pCurVal->value.GetDesc();
if (!str.GetLength())
str.LoadString(pCurVal->value.id);
strncpy(cmdList[i].desc, T2CA(str), sizeof(cmdList[i].desc));
cmdList[i].desc[sizeof(cmdList[i].desc)-1] = 0;
WideCharToMultiByte(CP_UTF8, 0, str, -1, cmdList[i].desc, sizeof(cmdList[i].desc), NULL, NULL);
/*}
else {
char *plugin, *parameter;
if (ParseCommand(aCmd, &plugin, &parameter))
theApp.plugins.SendMessage(plugin, "*", "GetCmds", (long)parameter, (long)&cmdList[i]);
}*/
free(aCmd);
ASSERT(i<=num);
if (++i > num) break;
if (--size == 0) break;

3
k-meleon/KmCommand.h

@ -29,8 +29,9 @@ const UINT kPluginIdRange[kPluginIdRangeNumber][2] = { { 0x1800, 0x6FFF }, {0x90
class CMfcEmbedApp;
struct KmCommand
class KmCommand
{
public:
UINT id;
CString desc;

Loading…
Cancel
Save