Author: ashaposhnikov
Date: Sun Sep 3 20:37:14 2017
New Revision: 75758
URL:
http://svn.reactos.org/svn/reactos?rev=75758&view=rev
Log:
[RAPPS] Formatting fixes
- CAvailableApplicationInfo: added m_ prefixes to members
- CAvailableApps: renamed EnumAvailableApplications to Enum
- Renamed LICENSE_TYPE enum to LicenseType and renamed enum values
- unattended.cpp: Added license header
Modified:
branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/available.cpp [iso-8859-1]
Sun Sep 3 20:37:14 2017
@@ -21,16 +21,16 @@
CAvailableApplicationInfo::CAvailableApplicationInfo(const ATL::CStringW&
sFileNameParam)
: m_Parser(sFileNameParam)
{
- LicenseType = LICENSE_TYPE::None;
-
- sFileName = sFileNameParam;
+ m_LicenseType = LicenseType::LICENSE_NONE;
+
+ m_sFileName = sFileNameParam;
RetrieveGeneralInfo();
}
VOID CAvailableApplicationInfo::RefreshAppInfo()
{
- if (szUrlDownload.IsEmpty())
+ if (m_szUrlDownload.IsEmpty())
{
RetrieveGeneralInfo();
}
@@ -39,23 +39,23 @@
// Lazily load general info from the file
VOID CAvailableApplicationInfo::RetrieveGeneralInfo()
{
- Category = m_Parser.GetInt(L"Category");
-
- if (!GetString(L"Name", szName)
- || !GetString(L"URLDownload", szUrlDownload))
+ m_Category = m_Parser.GetInt(L"Category");
+
+ if (!GetString(L"Name", m_szName)
+ || !GetString(L"URLDownload", m_szUrlDownload))
{
return;
}
- GetString(L"RegName", szRegName);
- GetString(L"Version", szVersion);
- GetString(L"License", szLicense);
- GetString(L"Description", szDesc);
- GetString(L"Size", szSize);
- GetString(L"URLSite", szUrlSite);
- GetString(L"CDPath", szCDPath);
- GetString(L"Language", szRegName);
- GetString(L"SHA1", szSHA1);
+ GetString(L"RegName", m_szRegName);
+ GetString(L"Version", m_szVersion);
+ GetString(L"License", m_szLicense);
+ GetString(L"Description", m_szDesc);
+ GetString(L"Size", m_szSize);
+ GetString(L"URLSite", m_szUrlSite);
+ GetString(L"CDPath", m_szCDPath);
+ GetString(L"Language", m_szRegName);
+ GetString(L"SHA1", m_szSHA1);
RetrieveLicenseType();
RetrieveLanguages();
@@ -68,16 +68,16 @@
VOID CAvailableApplicationInfo::RetrieveInstalledStatus()
{
- m_IsInstalled = ::GetInstalledVersion(NULL, szRegName)
- || ::GetInstalledVersion(NULL, szName);
+ m_IsInstalled = ::GetInstalledVersion(NULL, m_szRegName)
+ || ::GetInstalledVersion(NULL, m_szName);
}
VOID CAvailableApplicationInfo::RetrieveInstalledVersion()
{
- ATL::CStringW szNameVersion = szName + L" " + szVersion;
- m_HasInstalledVersion = ::GetInstalledVersion(&szInstalledVersion, szRegName)
- || ::GetInstalledVersion(&szInstalledVersion, szName)
- || ::GetInstalledVersion(&szInstalledVersion, szNameVersion);
+ ATL::CStringW szNameVersion = m_szName + L" " + m_szVersion;
+ m_HasInstalledVersion = ::GetInstalledVersion(&m_szInstalledVersion,
m_szRegName)
+ || ::GetInstalledVersion(&m_szInstalledVersion, m_szName)
+ || ::GetInstalledVersion(&m_szInstalledVersion, szNameVersion);
}
VOID CAvailableApplicationInfo::RetrieveLanguages()
@@ -105,7 +105,7 @@
{
if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
{
- Languages.Add(static_cast<LCID>(iLCID));
+ m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
m_szLocale.Empty();
}
}
@@ -116,7 +116,7 @@
{
if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID))
{
- Languages.Add(static_cast<LCID>(iLCID));
+ m_LanguageLCIDs.Add(static_cast<LCID>(iLCID));
}
}
@@ -127,13 +127,13 @@
{
INT IntBuffer = m_Parser.GetInt(L"LicenseType");
- if (IntBuffer < 0 || IntBuffer > LICENSE_TYPE::Max)
- {
- LicenseType = LICENSE_TYPE::None;
+ if (IsLicenseType(IntBuffer))
+ {
+ m_LicenseType = static_cast<LicenseType>(IntBuffer);
}
else
{
- LicenseType = (LICENSE_TYPE) IntBuffer;
+ m_LicenseType = LicenseType::LICENSE_NONE;
}
}
@@ -145,10 +145,10 @@
}
//Find locale code in the list
- const INT nLanguagesSize = Languages.GetSize();
+ const INT nLanguagesSize = m_LanguageLCIDs.GetSize();
for (INT i = 0; i < nLanguagesSize; ++i)
{
- if (Languages[i] == what)
+ if (m_LanguageLCIDs[i] == what)
{
return TRUE;
}
@@ -184,12 +184,12 @@
BOOL CAvailableApplicationInfo::HasUpdate() const
{
- return (szInstalledVersion.Compare(szVersion) < 0) ? TRUE : FALSE;
+ return (m_szInstalledVersion.Compare(m_szVersion) < 0) ? TRUE : FALSE;
}
VOID CAvailableApplicationInfo::SetLastWriteTime(FILETIME* ftTime)
{
- RtlCopyMemory(&ftCacheStamp, ftTime, sizeof(FILETIME));
+ RtlCopyMemory(&m_ftCacheStamp, ftTime, sizeof(FILETIME));
}
inline BOOL CAvailableApplicationInfo::GetString(LPCWSTR lpKeyName, ATL::CStringW&
ReturnedString)
@@ -317,7 +317,7 @@
return UpdateAppsDB();
}
-BOOL CAvailableApps::EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc)
+BOOL CAvailableApps::Enum(INT EnumType, AVAILENUMPROC lpEnumProc)
{
HANDLE hFind = INVALID_HANDLE_VALUE;
@@ -343,10 +343,10 @@
Info = m_InfoList.GetNext(CurrentListPosition);
// do we already have this entry in cache?
- if (Info->sFileName == FindFileData.cFileName)
+ if (Info->m_sFileName == FindFileData.cFileName)
{
// is it current enough, or the file has been modified since our last
time here?
- if (CompareFileTime(&FindFileData.ftLastWriteTime,
&Info->ftCacheStamp) == 1)
+ if (CompareFileTime(&FindFileData.ftLastWriteTime,
&Info->m_ftCacheStamp) == 1)
{
// recreate our cache, this is the slow path
m_InfoList.RemoveAt(LastListPosition);
@@ -371,10 +371,10 @@
m_InfoList.AddTail(Info);
skip_if_cached:
- if (Info->Category == FALSE)
+ if (Info->m_Category == FALSE)
continue;
- if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE)
+ if (EnumType != Info->m_Category && EnumType != ENUM_ALL_AVAILABLE)
continue;
Info->RefreshAppInfo();
@@ -388,7 +388,7 @@
return TRUE;
}
-CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppName)
+CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppName)
const
{
if (m_InfoList.IsEmpty())
{
@@ -401,7 +401,7 @@
while (CurrentListPosition != NULL)
{
info = m_InfoList.GetNext(CurrentListPosition);
- if (info->szName == szAppName)
+ if (info->m_szName == szAppName)
{
return info;
}
@@ -409,7 +409,7 @@
return NULL;
}
-ATL::CSimpleArray<CAvailableApplicationInfo*> CAvailableApps::FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames)
+ATL::CSimpleArray<CAvailableApplicationInfo*> CAvailableApps::FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const
{
ATL::CSimpleArray<CAvailableApplicationInfo*> result;
for (INT i = 0; i < arrAppsNames.GetSize(); ++i)
@@ -423,32 +423,32 @@
return result;
}
-const ATL::CStringW& CAvailableApps::GetFolderPath()
+const ATL::CStringW& CAvailableApps::GetFolderPath() const
{
return m_szPath;
}
-const ATL::CStringW& CAvailableApps::GetAppPath()
+const ATL::CStringW& CAvailableApps::GetAppPath() const
{
return m_szAppsPath;
}
-const ATL::CStringW& CAvailableApps::GetCabPath()
+const ATL::CStringW& CAvailableApps::GetCabPath() const
{
return m_szCabPath;
}
-const LPCWSTR CAvailableApps::GetFolderPathString()
+LPCWSTR CAvailableApps::GetFolderPathString() const
{
return m_szPath.GetString();
}
-const LPCWSTR CAvailableApps::GetAppPathString()
+LPCWSTR CAvailableApps::GetAppPathString() const
{
return m_szPath.GetString();
}
-const LPCWSTR CAvailableApps::GetCabPathString()
+LPCWSTR CAvailableApps::GetCabPathString() const
{
return m_szPath.GetString();
}
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/gui.cpp [iso-8859-1] Sun Sep
3 20:37:14 2017
@@ -90,7 +90,7 @@
else
InsertLoadedTextNewl_RichEdit(IDS_STATUS_INSTALLED, CFE_ITALIC);
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_VERSION,
Info->szInstalledVersion, CFE_BOLD, 0);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_VERSION,
Info->m_szInstalledVersion, CFE_BOLD, 0);
}
else
{
@@ -102,29 +102,29 @@
InsertLoadedTextNewl_RichEdit(IDS_STATUS_NOTINSTALLED, CFE_ITALIC);
}
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_AVAILABLEVERSION, Info->szVersion,
CFE_BOLD, 0);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_AVAILABLEVERSION, Info->m_szVersion,
CFE_BOLD, 0);
}
static VOID InsertLicenseInfo_RichEdit(CAvailableApplicationInfo* Info)
{
ATL::CStringW szLicense;
- switch (Info->LicenseType)
- {
- case LICENSE_TYPE::OpenSource:
+ switch (Info->m_LicenseType)
+ {
+ case LicenseType::LICENSE_OPENSOURCE:
szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE);
break;
- case LICENSE_TYPE::Freeware:
+ case LicenseType::LICENSE_FREEWARE:
szLicense.LoadStringW(IDS_LICENSE_FREEWARE);
break;
- case LICENSE_TYPE::Trial:
+ case LicenseType::LICENSE_TRIAL:
szLicense.LoadStringW(IDS_LICENSE_TRIAL);
break;
default:
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_LICENSE, Info->szLicense,
CFE_BOLD, 0);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_LICENSE, Info->m_szLicense,
CFE_BOLD, 0);
return;
}
- szLicense += L" (" + Info->szLicense + L")";
+ szLicense += L" (" + Info->m_szLicense + L")";
InsertTextAfterLoaded_RichEdit(IDS_AINFO_LICENSE, szLicense, CFE_BOLD, 0);
}
@@ -135,7 +135,7 @@
return;
}
- const INT nTranslations = Info->Languages.GetSize();
+ const INT nTranslations = Info->m_LanguageLCIDs.GetSize();
ATL::CStringW szLangInfo;
ATL::CStringW szLoadedTextAvailability;
ATL::CStringW szLoadedAInfoText;
@@ -189,15 +189,15 @@
CAvailableApplicationInfo* Info = (CAvailableApplicationInfo*)
ListViewGetlParam(Index);
if (!Info) return FALSE;
- NewRichEditText(Info->szName, CFE_BOLD);
+ NewRichEditText(Info->m_szName, CFE_BOLD);
InsertVersionInfo_RichEdit(Info);
InsertLicenseInfo_RichEdit(Info);
InsertLanguageInfo_RichEdit(Info);
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0);
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD,
CFE_LINK);
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD,
0);
- InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload,
CFE_BOLD, CFE_LINK);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_SIZE, Info->m_szSize, CFE_BOLD, 0);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLSITE, Info->m_szUrlSite, CFE_BOLD,
CFE_LINK);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_DESCRIPTION, Info->m_szDesc,
CFE_BOLD, 0);
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLDOWNLOAD, Info->m_szUrlDownload,
CFE_BOLD, CFE_LINK);
return TRUE;
}
@@ -305,7 +305,7 @@
{ 0, ID_INSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0,
(INT_PTR) szInstallBtn },
{ 1, ID_UNINSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0,
(INT_PTR) szUninstallBtn },
{ 2, ID_MODIFY, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0,
(INT_PTR) szModifyBtn },
- { 3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE,{0}, 0,
(INT_PTR) szSelectAll},
+ { 3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0,
(INT_PTR) szSelectAll},
{-1, 0, TBSTATE_ENABLED, BTNS_SEP, { 0 }, 0, 0 },
{ 4, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0
},
{ 5, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0
},
@@ -1414,13 +1414,13 @@
return StrStrIW(szHaystack, szNeedle) != NULL;
}
- static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, ATL::CStringW &szName,
PINSTALLED_INFO Info)
+ static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, ATL::CStringW
&m_szName, PINSTALLED_INFO Info)
{
PINSTALLED_INFO ItemInfo;
ATL::CStringW szText;
INT Index;
- if (!SearchPatternMatch(szName.GetString(), szSearchPattern))
+ if (!SearchPatternMatch(m_szName.GetString(), szSearchPattern))
{
RegCloseKey(Info->hSubKey);
return TRUE;
@@ -1433,7 +1433,7 @@
return FALSE;
}
- Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) ItemInfo);
+ Index = ListViewAddItem(ItemIndex, 0, m_szName, (LPARAM) ItemInfo);
/* Get version info */
GetApplicationString(ItemInfo->hSubKey, L"DisplayVersion", szText);
@@ -1453,15 +1453,15 @@
HIMAGELIST hImageListView = ListView_GetImageList(hListView, LVSIL_SMALL);
- if (!SearchPatternMatch(Info->szName, szSearchPattern) &&
- !SearchPatternMatch(Info->szDesc, szSearchPattern))
+ if (!SearchPatternMatch(Info->m_szName, szSearchPattern) &&
+ !SearchPatternMatch(Info->m_szDesc, szSearchPattern))
{
return TRUE;
}
/* Load icon from file */
ATL::CStringW szIconPath;
- szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath,
Info->szName);
+ szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath,
Info->m_szName);
hIcon = (HICON) LoadImageW(NULL,
szIconPath.GetString(),
IMAGE_ICON,
@@ -1478,11 +1478,11 @@
Index = ImageList_AddIcon(hImageListView, hIcon);
DestroyIcon(hIcon);
- Index = ListViewAddItem(Info->Category, Index, Info->szName, (LPARAM)
Info);
+ Index = ListViewAddItem(Info->m_Category, Index, Info->m_szName, (LPARAM)
Info);
ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL);
- ListView_SetItemText(hListView, Index, 1,
const_cast<LPWSTR>(Info->szVersion.GetString()));
- ListView_SetItemText(hListView, Index, 2,
const_cast<LPWSTR>(Info->szDesc.GetString()));
+ ListView_SetItemText(hListView, Index, 1,
const_cast<LPWSTR>(Info->m_szVersion.GetString()));
+ ListView_SetItemText(hListView, Index, 2,
const_cast<LPWSTR>(Info->m_szDesc.GetString()));
return TRUE;
}
@@ -1556,7 +1556,7 @@
}
// Enum available applications
- m_AvailableApps.EnumAvailableApplications(EnumType, s_EnumAvailableAppProc);
+ m_AvailableApps.Enum(EnumType, s_EnumAvailableAppProc);
}
SelectedEnumType = EnumType;
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
---
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h [iso-8859-1]
(original)
+++
branches/GSoC_2017/rapps/reactos/base/applications/rapps/include/available.h [iso-8859-1]
Sun Sep 3 20:37:14 2017
@@ -4,6 +4,7 @@
#include <atlstr.h>
#include <atlsimpcoll.h>
#include <atlcoll.h>
+
#include "misc.h"
/* EnumType flags for EnumAvailableApplications */
@@ -31,41 +32,46 @@
inline BOOL IsAvailableEnum(INT x)
{
- return (x >= ENUM_AVAILABLE_MIN && x <= ENUM_AVAILABLE_MAX);
+ return (x >= AvailableCategories::ENUM_AVAILABLE_MIN && x <=
AvailableCategories::ENUM_AVAILABLE_MAX);
}
-typedef enum LICENSE_TYPE
+enum LicenseType
{
- None,
- OpenSource,
- Freeware,
- Trial,
- Max = Trial,
- Min = None
-} *PLICENSE_TYPE;
+ LICENSE_NONE,
+ LICENSE_OPENSOURCE,
+ LICENSE_FREEWARE,
+ LICENSE_TRIAL,
+ LICENSE_MIN = LICENSE_NONE,
+ LICENSE_MAX = LICENSE_TRIAL
+};
+
+inline BOOL IsLicenseType(INT x)
+{
+ return (x >= LicenseType::LICENSE_MIN && x <=
LicenseType::LICENSE_MAX);
+}
struct CAvailableApplicationInfo
{
- INT Category;
- LICENSE_TYPE LicenseType;
- ATL::CStringW szName;
- ATL::CStringW szRegName;
- ATL::CStringW szVersion;
- ATL::CStringW szLicense;
- ATL::CStringW szDesc;
- ATL::CStringW szSize;
- ATL::CStringW szUrlSite;
- ATL::CStringW szUrlDownload;
- ATL::CStringW szCDPath;
- ATL::CSimpleArray<LCID> Languages;
+ INT m_Category;
+ LicenseType m_LicenseType;
+ ATL::CStringW m_szName;
+ ATL::CStringW m_szRegName;
+ ATL::CStringW m_szVersion;
+ ATL::CStringW m_szLicense;
+ ATL::CStringW m_szDesc;
+ ATL::CStringW m_szSize;
+ ATL::CStringW m_szUrlSite;
+ ATL::CStringW m_szUrlDownload;
+ ATL::CStringW m_szCDPath;
+ ATL::CSimpleArray<LCID> m_LanguageLCIDs;
// Caching mechanism related entries
- ATL::CStringW sFileName;
- FILETIME ftCacheStamp;
+ ATL::CStringW m_sFileName;
+ FILETIME m_ftCacheStamp;
// Optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string
form)
- ATL::CStringW szSHA1;
- ATL::CStringW szInstalledVersion;
+ ATL::CStringW m_szSHA1;
+ ATL::CStringW m_szInstalledVersion;
CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam);
@@ -115,16 +121,18 @@
static BOOL UpdateAppsDB();
static BOOL ForceUpdateAppsDB();
+ static VOID DeleteCurrentAppsDB();
VOID FreeCachedEntries();
- static VOID DeleteCurrentAppsDB();
- BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc);
- CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName);
- ATL::CSimpleArray<CAvailableApplicationInfo*> FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames);
- const ATL::CStringW& GetFolderPath();
- const ATL::CStringW& GetAppPath();
- const ATL::CStringW& GetCabPath();
- const LPCWSTR GetFolderPathString();
- const LPCWSTR GetAppPathString();
- const LPCWSTR GetCabPathString();
+ BOOL Enum(INT EnumType, AVAILENUMPROC lpEnumProc);
+
+ CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName) const;
+ ATL::CSimpleArray<CAvailableApplicationInfo*> FindInfoList(const
ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) const;
+
+ const ATL::CStringW& GetFolderPath() const;
+ const ATL::CStringW& GetAppPath() const;
+ const ATL::CStringW& GetCabPath() const;
+ LPCWSTR GetFolderPathString() const;
+ LPCWSTR GetAppPathString() const;
+ LPCWSTR GetCabPathString() const;
};
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/loaddlg.cpp [iso-8859-1] Sun
Sep 3 20:37:14 2017
@@ -72,12 +72,12 @@
{
DownloadInfo() {}
DownloadInfo(const CAvailableApplicationInfo& AppInfo)
- :szUrl(AppInfo.szUrlDownload), szName(AppInfo.szName), szSHA1(AppInfo.szSHA1)
+ :szUrl(AppInfo.m_szUrlDownload), m_szName(AppInfo.m_szName),
szSHA1(AppInfo.m_szSHA1)
{
}
ATL::CStringW szUrl;
- ATL::CStringW szName;
+ ATL::CStringW m_szName;
ATL::CStringW szSHA1;
};
@@ -259,7 +259,7 @@
{
for (INT i = 0; i < arrInfo.GetSize(); ++i)
{
- AddRow(i, arrInfo[i].szName.GetString(), DOWNLOAD_STATUS::DLWaiting);
+ AddRow(i, arrInfo[i].m_szName.GetString(), DOWNLOAD_STATUS::DLWaiting);
}
}
@@ -639,7 +639,7 @@
// Change caption to show the currently downloaded app
if (!bCab)
{
- szNewCaption.Format(szCaption, CurrentInfo.szName.GetString());
+ szNewCaption.Format(szCaption, CurrentInfo.m_szName.GetString());
}
else
{
@@ -868,7 +868,7 @@
{
static DownloadInfo DatabaseDLInfo;
DatabaseDLInfo.szUrl = lpUrl;
- DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
+ DatabaseDLInfo.m_szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
Download(DatabaseDLInfo, TRUE);
}
Modified: branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/GSoC_2017/rapps/reactos/base/ap…
==============================================================================
--- branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp [iso-8859-1]
(original)
+++ branches/GSoC_2017/rapps/reactos/base/applications/rapps/unattended.cpp [iso-8859-1]
Sun Sep 3 20:37:14 2017
@@ -1,3 +1,11 @@
+/*
+* PROJECT: ReactOS Applications Manager
+* LICENSE: GPL - See COPYING in the top level directory
+* FILE: base/applications/rapps/unattended.cpp
+* PURPOSE: Functions to parse command-line flags and process them
+* PROGRAMMERS: Alexander Shaposhnikov (chaez.san(a)gmail.com)
+*/
+
#include "unattended.h"
#include "defines.h"
#include "available.h"
@@ -5,13 +13,14 @@
#include "setupapi.h"
+#define MIN_ARGS 2
+
BOOL CmdParser(LPWSTR lpCmdLine)
{
INT argc;
LPWSTR* argv = CommandLineToArgvW(lpCmdLine, &argc);
- ATL::CString szName;
- if (!argv || argc < 2)
+ if (!argv || argc < MIN_ARGS)
{
return FALSE;
}
@@ -56,8 +65,9 @@
}
CAvailableApps apps;
- CAvailableApps::UpdateAppsDB();
- apps.EnumAvailableApplications(ENUM_ALL_AVAILABLE, NULL);
+ apps.UpdateAppsDB();
+ apps.Enum(ENUM_ALL_AVAILABLE, NULL);
+
ATL::CSimpleArray<CAvailableApplicationInfo*> arrAppInfo =
apps.FindInfoList(arrNames);
if (arrAppInfo.GetSize() > 0)
{