Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
brianferguson committed Dec 17, 2016
1 parent 03c3305 commit be91990
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Common/PathUtil.cpp
Expand Up @@ -32,7 +32,7 @@ bool IsAbsolute(const std::wstring& path)
IsUNC(path));
}

void AppendBacklashIfMissing(std::wstring& path)
void AppendBackslashIfMissing(std::wstring& path)
{
if (!path.empty() && !IsSeparator(path[path.length() - 1]))
{
Expand Down
2 changes: 1 addition & 1 deletion Common/PathUtil.h
Expand Up @@ -21,7 +21,7 @@ bool IsUNC(const std::wstring& path);

bool IsAbsolute(const std::wstring& path);

void AppendBacklashIfMissing(std::wstring& path);
void AppendBackslashIfMissing(std::wstring& path);

void RemoveTrailingBackslash(std::wstring& path);

Expand Down
8 changes: 4 additions & 4 deletions Common/PathUtil_Test.cpp
Expand Up @@ -43,18 +43,18 @@ TEST_CLASS(Common_PathUtil_Test)
Assert::IsFalse(IsAbsolute(L"C:"));
}

TEST_METHOD(TestAppendBacklashIfMissing)
TEST_METHOD(TestAppendBackslashIfMissing)
{
std::wstring path;
AppendBacklashIfMissing(path);
AppendBackslashIfMissing(path);
Assert::IsTrue(path.empty());

std::wstring path2 = L"C:\\test";
AppendBacklashIfMissing(path2);
AppendBackslashIfMissing(path2);
Assert::IsTrue(path2 == L"C:\\test\\");

std::wstring path3 = L"C:\\test\\";
AppendBacklashIfMissing(path3);
AppendBackslashIfMissing(path3);
Assert::IsTrue(path3 == L"C:\\test\\");
}

Expand Down
6 changes: 3 additions & 3 deletions Library/DialogNewSkin.cpp
Expand Up @@ -579,7 +579,7 @@ INT_PTR DialogNewSkin::TabNew::OnCommand(WPARAM wParam, LPARAM lParam)
{
HWND tree = GetControl(Id_ItemsTreeView);
std::wstring folder = m_ParentFolder + GetTreeSelectionPath(tree, false);
PathUtil::AppendBacklashIfMissing(folder);
PathUtil::AppendBackslashIfMissing(folder);
CommandHandler::RunFile(folder.c_str());
}
break;
Expand Down Expand Up @@ -850,7 +850,7 @@ INT_PTR DialogNewSkin::TabNew::OnNotify(WPARAM wParam, LPARAM lParam)

// Add selection to item
newItem += GetTreeSelectionPath(tree, false);
PathUtil::AppendBacklashIfMissing(newItem);
PathUtil::AppendBackslashIfMissing(newItem);

if (isFolder)
{
Expand All @@ -874,7 +874,7 @@ INT_PTR DialogNewSkin::TabNew::OnNotify(WPARAM wParam, LPARAM lParam)

newItem = newItem.substr(0, pos + 1);
newItem += name;
PathUtil::AppendBacklashIfMissing(newItem);
PathUtil::AppendBackslashIfMissing(newItem);

// New folder already exists, re-enter folder name
if (_waccess(newItem.c_str(), 0) == 0)
Expand Down
2 changes: 1 addition & 1 deletion Library/MeasureDiskSpace.cpp
Expand Up @@ -173,7 +173,7 @@ void MeasureDiskSpace::ReadOptions(ConfigParser& parser, const WCHAR* section)
else
{
// A trailing backslash is required for GetDiskFreeSpaceEx().
PathUtil::AppendBacklashIfMissing(m_Drive);
PathUtil::AppendBackslashIfMissing(m_Drive);
}

m_Type = parser.ReadBool(section, L"Type", false);
Expand Down
2 changes: 1 addition & 1 deletion Library/MeterImage.cpp
Expand Up @@ -129,7 +129,7 @@ void MeterImage::ReadOptions(ConfigParser& parser, const WCHAR* section)

// Deprecated!
std::wstring path = parser.ReadString(section, L"Path", L"");
PathUtil::AppendBacklashIfMissing(path);
PathUtil::AppendBackslashIfMissing(path);

// Read tinting options
m_Image.ReadOptions(parser, section, path.c_str());
Expand Down
2 changes: 1 addition & 1 deletion Library/Rainmeter.cpp
Expand Up @@ -331,7 +331,7 @@ int Rainmeter::Initialize(LPCWSTR iniPath, LPCWSTR layout)
// Try Rainmeter.ini first
m_SkinPath.assign(buffer, len);
PathUtil::ExpandEnvironmentVariables(m_SkinPath);
PathUtil::AppendBacklashIfMissing(m_SkinPath);
PathUtil::AppendBackslashIfMissing(m_SkinPath);
}
else if (bDefaultIniLocation &&
SUCCEEDED(SHGetFolderPath(nullptr, CSIDL_MYDOCUMENTS, nullptr, SHGFP_TYPE_CURRENT, buffer)))
Expand Down
2 changes: 1 addition & 1 deletion Library/TintedImage.cpp
Expand Up @@ -615,7 +615,7 @@ void TintedImage::ReadOptions(ConfigParser& parser, const WCHAR* section, const
std::wstring oldPath = m_Path;

m_Path = parser.ReadString(section, m_OptionArray[OptionIndexImagePath], imagePath);
PathUtil::AppendBacklashIfMissing(m_Path);
PathUtil::AppendBackslashIfMissing(m_Path);

m_HasPathChanged = (oldPath != m_Path);

Expand Down

0 comments on commit be91990

Please sign in to comment.