Minor changes

This commit is contained in:
Birunthan Mohanathas 2012-06-17 18:35:57 +03:00
parent 1d38698c7a
commit d7fb5f4bb5
2 changed files with 11 additions and 6 deletions

View File

@ -489,8 +489,8 @@ bool CDialogInstall::ReadPackage()
{
m_PackageSkins.insert(item);
}
else if (_wcsicmp(component, L"Themes") == 0 &&
_wcsicmp(extension, L".thm") == 0 &&
else if (_wcsicmp(component, m_PackageFormat == PackageFormat::Old ? L"Themes" : L"Layouts") == 0 &&
_wcsicmp(extension, m_PackageFormat == PackageFormat::Old ? L".thm" : L".ini") == 0 &&
!IsIgnoredTheme(itemSz))
{
m_PackageThemes.insert(item);
@ -773,10 +773,15 @@ bool CDialogInstall::InstallPackage()
targetPath += path;
error = !ExtractCurrentFile(targetPath);
}
else if (_wcsicmp(component, L"Themes") == 0 &&
_wcsicmp(extension, L".thm") == 0 &&
else if (_wcsicmp(component, m_PackageFormat == PackageFormat::New ? L"Layouts" : L"Themes") == 0 &&
_wcsicmp(extension, m_PackageFormat == PackageFormat::New ? L".ini" : L".thm") == 0 &&
m_PackageThemes.find(item) != m_PackageThemes.end())
{
if (m_PackageFormat == PackageFormat::New)
{
wcscpy_s(extension, 5, L".thm");
}
targetPath = g_Data.settingsPath;
targetPath += L"Themes\\";
targetPath += path;

View File

@ -282,8 +282,8 @@ bool CDialogPackage::CreatePackage()
for (auto iter = m_ThemeFolders.cbegin(); iter != m_ThemeFolders.cend(); ++iter)
{
std::wstring realPath = (*iter).second + L"Rainmeter.thm";
std::wstring zipPath = L"Themes\\" + (*iter).first;
zipPath += L"\\Rainmeter.thm";
std::wstring zipPath = L"Layouts\\" + (*iter).first;
zipPath += L"\\Rainmeter.ini";
if (!AddFileToPackage(realPath.c_str(), zipPath.c_str()))
{
std::wstring error = L"Error adding theme '";