Reverted fd5de00

This commit is contained in:
Birunthan Mohanathas 2012-11-13 18:39:54 +02:00
parent 6394b447ba
commit bd0ec4ece0

View File

@ -1505,20 +1505,11 @@ void CRainmeter::SetSkinPath(const std::wstring& skinPath)
void CRainmeter::SetSkinEditor(const std::wstring& path) void CRainmeter::SetSkinEditor(const std::wstring& path)
{ {
assert(!path.empty()); if (!path.empty())
const WCHAR* pathSz = path.c_str();
WCHAR buffer[MAX_PATH];
DWORD cchOut = MAX_PATH;
HRESULT hr = AssocQueryString(ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, L".ini", L"open", buffer, &cchOut);
if (SUCCEEDED(hr) && _wcsicmp(pathSz, buffer) == 0)
{ {
// The selected editor and the associated editor is the same, so remove from Rainmeter.ini. m_SkinEditor = path;
pathSz = NULL; WritePrivateProfileString(L"Rainmeter", L"ConfigEditor", path.c_str(), m_IniFile.c_str());
} }
m_SkinEditor = path;
WritePrivateProfileString(L"Rainmeter", L"ConfigEditor", pathSz, m_IniFile.c_str());
} }
void CRainmeter::WriteActive(const std::wstring& folderPath, int fileIndex) void CRainmeter::WriteActive(const std::wstring& folderPath, int fileIndex)