Project

General

Profile

Bug #89 ยป xbmc4xbox-makelegalfilepath-builtins.diff

nuka1195, 19/08/2010 02:20 PM

View differences:

xbmc/lib/libPython/xbmcmodule/xbmcmodule.cpp (working copy)
if (!PyXBMCGetUnicodeString(strText, pObjectText, 1)) return NULL;
CStdString strFilename;
strFilename = CUtil::MakeLegalPath(strText);
strFilename = CUtil::MakeLegalPath(strText, LEGAL_FATX);
return Py_BuildValue((char*)"s", strFilename.c_str());
}
xbmc/Util.cpp (working copy)
// check if the filename is a legal FATX one.
if (LegalType == LEGAL_FATX)
{
result.Replace(':', '_');
result.Replace('*', '_');
result.Replace('?', '_');
result.Replace('\"', '_');
result.Replace('<', '_');
result.Replace('>', '_');
result.Replace('|', '_');
result.Replace(',', '_');
result.Replace('=', '_');
result.Replace('+', '_');
result.Replace(';', '_');
result.Replace('"', '_');
result.Replace('\'', '_');
result.TrimRight(".");
result.TrimRight(" ");
GetFatXQualifiedPath(result);
}
......
{ "Control.Message", true, "Send a given message to a control within a given window" },
{ "SendClick", true, "Send a click message from the given control to the given window" },
{ "LoadProfile", true, "Load the specified profile (note; if locks are active it won't work)" },
{ "SetProperty", true, "Sets a window property for the current window (key,value)" },
{ "SetProperty", true, "Sets a window property for the current focused window/dialog (key,value)" },
{ "ClearProperty", true, "Clears a window property for the current focused window/dialog (key,value)" },
{ "PlayWith", true, "Play the selected item with the specified core" },
{ "WakeOnLan", true, "Sends the wake-up packet to the broadcast address for the specified MAC address" }
};
......
}
else if (execute.Equals("setproperty") && params.size() == 2)
{
CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetActiveWindow());
CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
if (window)
window->SetProperty(params[0],params[1]);
}
else if (execute.Equals("clearproperty") && params.size() == 2)
{
CGUIWindow *window = g_windowManager.GetWindow(g_windowManager.GetFocusedWindow());
if (window)
window->SetProperty(params[0],"");
}
else if (execute.Equals("wakeonlan"))
{
g_network.WakeOnLan((char*)params[0].c_str());
    (1-1/1)