mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Some minor fixes.
This commit is contained in:
parent
98c1f70f17
commit
2e32b0f5c1
@ -408,7 +408,8 @@ void CMeterImage::ReadConfig(const WCHAR* section)
|
|||||||
m_Path = parser.ReadString(section, L"Path", L"");
|
m_Path = parser.ReadString(section, L"Path", L"");
|
||||||
if (!m_Path.empty())
|
if (!m_Path.empty())
|
||||||
{
|
{
|
||||||
if (m_Path[m_Path.length() - 1] != L'\\')
|
WCHAR ch = m_Path[m_Path.length() - 1];
|
||||||
|
if (ch != L'\\' && ch != L'/')
|
||||||
{
|
{
|
||||||
m_Path += L"\\";
|
m_Path += L"\\";
|
||||||
}
|
}
|
||||||
|
@ -4377,7 +4377,8 @@ std::wstring CMeterWindow::MakePathAbsolute(std::wstring path)
|
|||||||
|
|
||||||
std::wstring root = m_SkinPath + m_SkinName;
|
std::wstring root = m_SkinPath + m_SkinName;
|
||||||
|
|
||||||
if (root[root.length() - 1] != L'\\')
|
WCHAR ch = root[root.length() - 1];
|
||||||
|
if (ch != L'\\' && ch != L'/')
|
||||||
{
|
{
|
||||||
root += L"\\";
|
root += L"\\";
|
||||||
}
|
}
|
||||||
|
@ -1368,11 +1368,15 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
|
|||||||
m_PluginPath = ConvertToWide(tmpSz);
|
m_PluginPath = ConvertToWide(tmpSz);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_SkinPath.empty() && m_SkinPath[m_SkinPath.size() - 1] != L'\\')
|
if (!m_SkinPath.empty())
|
||||||
|
{
|
||||||
|
WCHAR ch = m_SkinPath[m_SkinPath.size() - 1];
|
||||||
|
if (ch != L'\\' && ch != L'/')
|
||||||
{
|
{
|
||||||
m_SkinPath += L"\\";
|
m_SkinPath += L"\\";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DebugLog(L"Path: %s", m_Path.c_str());
|
DebugLog(L"Path: %s", m_Path.c_str());
|
||||||
DebugLog(L"IniFile: %s", m_IniFile.c_str());
|
DebugLog(L"IniFile: %s", m_IniFile.c_str());
|
||||||
@ -3106,6 +3110,11 @@ void CRainmeter::ShowContextMenu(POINT pos, CMeterWindow* meterWindow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
HMENU configMenu = CreateConfigMenu(m_ConfigMenu);
|
HMENU configMenu = CreateConfigMenu(m_ConfigMenu);
|
||||||
|
if (!configMenu)
|
||||||
|
{
|
||||||
|
configMenu = CreatePopupMenu();
|
||||||
|
AppendMenu(configMenu, MF_GRAYED, 0, L"No configs available");
|
||||||
|
}
|
||||||
if (configMenu)
|
if (configMenu)
|
||||||
{
|
{
|
||||||
AppendMenu(configMenu, MF_SEPARATOR, 0, NULL);
|
AppendMenu(configMenu, MF_SEPARATOR, 0, NULL);
|
||||||
@ -3655,12 +3664,12 @@ void CRainmeter::TestSettingsFile(bool bDefaultIniLocation)
|
|||||||
|
|
||||||
std::wstring CRainmeter::ExtractPath(const std::wstring& strFilePath)
|
std::wstring CRainmeter::ExtractPath(const std::wstring& strFilePath)
|
||||||
{
|
{
|
||||||
size_t pos = strFilePath.rfind(L"\\");
|
std::wstring::size_type pos = strFilePath.find_last_of(L"\\/");
|
||||||
if (pos != std::wstring::npos)
|
if (pos != std::wstring::npos)
|
||||||
{
|
{
|
||||||
return strFilePath.substr(0, pos + 1);
|
return strFilePath.substr(0, pos + 1);
|
||||||
}
|
}
|
||||||
return L".";
|
return L".\\";
|
||||||
}
|
}
|
||||||
|
|
||||||
void CRainmeter::ExpandEnvironmentVariables(std::wstring& strPath)
|
void CRainmeter::ExpandEnvironmentVariables(std::wstring& strPath)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user