This commit is contained in:
Birunthan Mohanathas 2012-09-30 18:10:54 +03:00
parent 378aa25a9a
commit 27e0e00911

View File

@ -628,42 +628,43 @@ void CDialogManage::CTabSkins::ReadSkin()
SetControls(); SetControls();
WCHAR* buffer = new WCHAR[MAX_LINE_LENGTH]; WCHAR* buffer = new WCHAR[MAX_LINE_LENGTH];
const WCHAR* fileSz = fileSz;
item = GetDlgItem(m_Window, IDC_MANAGESKINS_AUTHOR_TEXT); item = GetDlgItem(m_Window, IDC_MANAGESKINS_AUTHOR_TEXT);
if (GetPrivateProfileString(L"Metadata", L"Author", NULL, buffer, MAX_LINE_LENGTH, file.c_str()) == 0) if (GetPrivateProfileString(L"Metadata", L"Author", NULL, buffer, MAX_LINE_LENGTH, fileSz) == 0)
{ {
// For backwards compatibility. // For backwards compatibility.
GetPrivateProfileString(L"Rainmeter", L"Author", NULL, buffer, MAX_LINE_LENGTH, file.c_str()); GetPrivateProfileString(L"Rainmeter", L"Author", NULL, buffer, MAX_LINE_LENGTH, fileSz);
} }
SetWindowText(item, buffer); SetWindowText(item, buffer);
item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK); item = GetDlgItem(m_Window, IDC_MANAGESKINS_ADDMETADATA_LINK);
if (GetPrivateProfileSection(L"Metadata", buffer, 8, file.c_str()) > 0) if (GetPrivateProfileSection(L"Metadata", buffer, 8, fileSz) > 0)
{ {
ShowWindow(item, SW_HIDE); ShowWindow(item, SW_HIDE);
// Set metadata // Set metadata
item = GetDlgItem(m_Window, IDC_MANAGESKINS_VERSION_TEXT); item = GetDlgItem(m_Window, IDC_MANAGESKINS_VERSION_TEXT);
GetPrivateProfileString(L"Metadata", L"Version", NULL, buffer, MAX_LINE_LENGTH, file.c_str()); GetPrivateProfileString(L"Metadata", L"Version", NULL, buffer, MAX_LINE_LENGTH, fileSz);
SetWindowText(item, buffer); SetWindowText(item, buffer);
item = GetDlgItem(m_Window, IDC_MANAGESKINS_LICENSE_TEXT); item = GetDlgItem(m_Window, IDC_MANAGESKINS_LICENSE_TEXT);
GetPrivateProfileString(L"Metadata", L"License", NULL, buffer, MAX_LINE_LENGTH, file.c_str()); GetPrivateProfileString(L"Metadata", L"License", NULL, buffer, MAX_LINE_LENGTH, fileSz);
SetWindowText(item, buffer); SetWindowText(item, buffer);
item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT); item = GetDlgItem(m_Window, IDC_MANAGESKINS_DESCRIPTION_TEXT);
std::wstring text; std::wstring text;
if (GetPrivateProfileString(L"Metadata", L"Information", NULL, buffer, MAX_LINE_LENGTH, file.c_str()) > 0) if (GetPrivateProfileString(L"Metadata", L"Information", NULL, buffer, MAX_LINE_LENGTH, fileSz) > 0)
{ {
text = buffer; text = buffer;
} }
else else
{ {
// For backwards compatibility // For backwards compatibility
GetPrivateProfileString(L"Metadata", L"Description", NULL, buffer, MAX_LINE_LENGTH, file.c_str()); GetPrivateProfileString(L"Metadata", L"Description", NULL, buffer, MAX_LINE_LENGTH, fileSz);
text = buffer; text = buffer;
if (GetPrivateProfileString(L"Metadata", L"Instructions", NULL, buffer, MAX_LINE_LENGTH, file.c_str()) > 0) if (GetPrivateProfileString(L"Metadata", L"Instructions", NULL, buffer, MAX_LINE_LENGTH, fileSz) > 0)
{ {
text += L"\r\n\r\n"; text += L"\r\n\r\n";
text += buffer; text += buffer;