[RAPPS] Style-addendum, no functional change (#5091)

* Just rename the 4 new files. Absolutely no other change.
* CMakeLists.txt, adapt the filenames
* Adapt all includes to make it compile
* CApplicationDB->CAppDB
* CApplicationInfo->CAppInfo
* Follow Mark Jansens good example and antipad the headers
This commit is contained in:
Joachim Henze 2023-02-28 01:00:29 +01:00 committed by GitHub
parent 60851914a8
commit a9b1e059f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 133 additions and 133 deletions

View file

@ -5,8 +5,8 @@ include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/conutils)
include_directories(include) include_directories(include)
list(APPEND SOURCE list(APPEND SOURCE
applicationdb.cpp appdb.cpp
applicationinfo.cpp appinfo.cpp
appview.cpp appview.cpp
asyncinet.cpp asyncinet.cpp
cabinet.cpp cabinet.cpp
@ -19,8 +19,8 @@ list(APPEND SOURCE
settingsdlg.cpp settingsdlg.cpp
unattended.cpp unattended.cpp
winmain.cpp winmain.cpp
include/applicationdb.h include/appdb.h
include/applicationinfo.h include/appinfo.h
include/appview.h include/appview.h
include/asyncinet.h include/asyncinet.h
include/configparser.h include/configparser.h

View file

@ -8,7 +8,7 @@
*/ */
#include "rapps.h" #include "rapps.h"
#include "applicationdb.h" #include "appdb.h"
#include "configparser.h" #include "configparser.h"
#include "settings.h" #include "settings.h"
@ -18,29 +18,29 @@ static REGSAM g_RegSamEnum[3] = {KEY_WOW64_32KEY, KEY_WOW64_32KEY, KEY_WOW64_64K
#define UNINSTALL_SUBKEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall" #define UNINSTALL_SUBKEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
static VOID static VOID
ClearList(CAtlList<CApplicationInfo *> &list) ClearList(CAtlList<CAppInfo *> &list)
{ {
POSITION InfoListPosition = list.GetHeadPosition(); POSITION InfoListPosition = list.GetHeadPosition();
while (InfoListPosition) while (InfoListPosition)
{ {
CApplicationInfo *Info = list.GetNext(InfoListPosition); CAppInfo *Info = list.GetNext(InfoListPosition);
delete Info; delete Info;
} }
list.RemoveAll(); list.RemoveAll();
} }
CApplicationDB::CApplicationDB(const CStringW &path) : m_BasePath(path) CAppDB::CAppDB(const CStringW &path) : m_BasePath(path)
{ {
m_BasePath.Canonicalize(); m_BasePath.Canonicalize();
} }
CApplicationInfo * CAppInfo *
CApplicationDB::FindByPackageName(const CStringW &name) CAppDB::FindByPackageName(const CStringW &name)
{ {
POSITION CurrentListPosition = m_Available.GetHeadPosition(); POSITION CurrentListPosition = m_Available.GetHeadPosition();
while (CurrentListPosition) while (CurrentListPosition)
{ {
CApplicationInfo *Info = m_Available.GetNext(CurrentListPosition); CAppInfo *Info = m_Available.GetNext(CurrentListPosition);
if (Info->szIdentifier == name) if (Info->szIdentifier == name)
{ {
return Info; return Info;
@ -50,16 +50,16 @@ CApplicationDB::FindByPackageName(const CStringW &name)
} }
void void
CApplicationDB::GetApps(CAtlList<CApplicationInfo *> &List, AppsCategories Type) const CAppDB::GetApps(CAtlList<CAppInfo *> &List, AppsCategories Type) const
{ {
const BOOL UseInstalled = IsInstalledEnum(Type); const BOOL UseInstalled = IsInstalledEnum(Type);
const CAtlList<CApplicationInfo *> &list = UseInstalled ? m_Installed : m_Available; const CAtlList<CAppInfo *> &list = UseInstalled ? m_Installed : m_Available;
const BOOL IncludeAll = UseInstalled ? (Type == ENUM_ALL_INSTALLED) : (Type == ENUM_ALL_AVAILABLE); const BOOL IncludeAll = UseInstalled ? (Type == ENUM_ALL_INSTALLED) : (Type == ENUM_ALL_AVAILABLE);
POSITION CurrentListPosition = list.GetHeadPosition(); POSITION CurrentListPosition = list.GetHeadPosition();
while (CurrentListPosition) while (CurrentListPosition)
{ {
CApplicationInfo *Info = list.GetNext(CurrentListPosition); CAppInfo *Info = list.GetNext(CurrentListPosition);
if (IncludeAll || Type == Info->iCategory) if (IncludeAll || Type == Info->iCategory)
{ {
@ -69,7 +69,7 @@ CApplicationDB::GetApps(CAtlList<CApplicationInfo *> &List, AppsCategories Type)
} }
BOOL BOOL
CApplicationDB::EnumerateFiles() CAppDB::EnumerateFiles()
{ {
ClearList(m_Available); ClearList(m_Available);
@ -91,7 +91,7 @@ CApplicationDB::EnumerateFiles()
PathRemoveExtensionW(szPkgName.GetBuffer(MAX_PATH)); PathRemoveExtensionW(szPkgName.GetBuffer(MAX_PATH));
szPkgName.ReleaseBuffer(); szPkgName.ReleaseBuffer();
CApplicationInfo *Info = FindByPackageName(szPkgName); CAppInfo *Info = FindByPackageName(szPkgName);
ATLASSERT(Info == NULL); ATLASSERT(Info == NULL);
if (!Info) if (!Info)
{ {
@ -118,7 +118,7 @@ CApplicationDB::EnumerateFiles()
} }
VOID VOID
CApplicationDB::UpdateAvailable() CAppDB::UpdateAvailable()
{ {
if (!CreateDirectoryW(m_BasePath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS) if (!CreateDirectoryW(m_BasePath, NULL) && GetLastError() != ERROR_ALREADY_EXISTS)
return; return;
@ -142,7 +142,7 @@ CApplicationDB::UpdateAvailable()
} }
VOID VOID
CApplicationDB::UpdateInstalled() CAppDB::UpdateInstalled()
{ {
// Remove all old entries // Remove all old entries
ClearList(m_Installed); ClearList(m_Installed);
@ -239,7 +239,7 @@ DeleteWithWildcard(const CPathW &Dir, const CStringW &Filter)
} }
VOID VOID
CApplicationDB::RemoveCached() CAppDB::RemoveCached()
{ {
// Delete icons // Delete icons
CPathW AppsPath = m_BasePath; CPathW AppsPath = m_BasePath;
@ -263,7 +263,7 @@ CApplicationDB::RemoveCached()
} }
BOOL BOOL
CApplicationDB::RemoveInstalledAppFromRegistry(const CApplicationInfo *Info) CAppDB::RemoveInstalledAppFromRegistry(const CAppInfo *Info)
{ {
// Validate that this is actually an installed app / update // Validate that this is actually an installed app / update
ATLASSERT(Info->iCategory == ENUM_INSTALLED_APPLICATIONS || Info->iCategory == ENUM_UPDATES); ATLASSERT(Info->iCategory == ENUM_INSTALLED_APPLICATIONS || Info->iCategory == ENUM_UPDATES);

View file

@ -10,12 +10,12 @@
#include "rapps.h" #include "rapps.h"
#include "appview.h" #include "appview.h"
CApplicationInfo::CApplicationInfo(const CStringW &Identifier, AppsCategories Category) CAppInfo::CAppInfo(const CStringW &Identifier, AppsCategories Category)
: szIdentifier(Identifier), iCategory(Category) : szIdentifier(Identifier), iCategory(Category)
{ {
} }
CApplicationInfo::~CApplicationInfo() CAppInfo::~CAppInfo()
{ {
} }
@ -24,7 +24,7 @@ CAvailableApplicationInfo::CAvailableApplicationInfo(
const CStringW &PkgName, const CStringW &PkgName,
AppsCategories Category, AppsCategories Category,
const CPathW &BasePath) const CPathW &BasePath)
: CApplicationInfo(PkgName, Category), m_Parser(Parser), m_ScrnshotRetrieved(false), m_LanguagesLoaded(false) : CAppInfo(PkgName, Category), m_Parser(Parser), m_ScrnshotRetrieved(false), m_LanguagesLoaded(false)
{ {
m_Parser->GetString(L"Name", szDisplayName); m_Parser->GetString(L"Name", szDisplayName);
m_Parser->GetString(L"Version", szDisplayVersion); m_Parser->GetString(L"Version", szDisplayVersion);
@ -369,7 +369,7 @@ CInstalledApplicationInfo::CInstalledApplicationInfo(
const CStringW &KeyName, const CStringW &KeyName,
AppsCategories Category, AppsCategories Category,
int KeyIndex) int KeyIndex)
: CApplicationInfo(KeyName, Category), m_hKey(Key), iKeyIndex(KeyIndex) : CAppInfo(KeyName, Category), m_hKey(Key), iKeyIndex(KeyIndex)
{ {
if (GetApplicationRegString(L"DisplayName", szDisplayName)) if (GetApplicationRegString(L"DisplayName", szDisplayName))
{ {

View file

@ -914,7 +914,7 @@ CAppInfoDisplay::Create(HWND hwndParent)
} }
VOID VOID
CAppInfoDisplay::ShowAppInfo(CApplicationInfo *Info) CAppInfoDisplay::ShowAppInfo(CAppInfo *Info)
{ {
CStringW ScrnshotLocation; CStringW ScrnshotLocation;
if (Info->RetrieveScreenshot(ScrnshotLocation)) if (Info->RetrieveScreenshot(ScrnshotLocation))
@ -1280,7 +1280,7 @@ CAppsListView::SetViewMode(DWORD ViewMode)
} }
BOOL BOOL
CAppsListView::AddApplication(CApplicationInfo *AppInfo, BOOL InitialCheckState) CAppsListView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
{ {
if (ApplicationViewType == AppViewTypeInstalledApps) if (ApplicationViewType == AppViewTypeInstalledApps)
{ {
@ -1474,7 +1474,7 @@ CApplicationView::ProcessWindowMessage(
if (ApplicationViewType == AppViewTypeAvailableApps) if (ApplicationViewType == AppViewTypeAvailableApps)
{ {
m_MainWindow->InstallApplication( m_MainWindow->InstallApplication(
(CApplicationInfo *)m_ListView->GetItemData(Item->iItem)); (CAppInfo *)m_ListView->GetItemData(Item->iItem));
} }
} }
} }
@ -1851,7 +1851,7 @@ CApplicationView::SetDisplayAppType(APPLICATION_VIEW_TYPE AppType)
} }
BOOL BOOL
CApplicationView::AddApplication(CApplicationInfo *AppInfo, BOOL InitialCheckState) CApplicationView::AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState)
{ {
return m_ListView->AddApplication(AppInfo, InitialCheckState); return m_ListView->AddApplication(AppInfo, InitialCheckState);
} }
@ -1897,7 +1897,7 @@ CApplicationView::ItemGetFocus(LPVOID CallbackParam)
{ {
if (CallbackParam) if (CallbackParam)
{ {
CApplicationInfo *Info = static_cast<CApplicationInfo *>(CallbackParam); CAppInfo *Info = static_cast<CAppInfo *>(CallbackParam);
m_AppsInfo->ShowAppInfo(Info); m_AppsInfo->ShowAppInfo(Info);
if (ApplicationViewType == AppViewTypeInstalledApps) if (ApplicationViewType == AppViewTypeInstalledApps)

View file

@ -86,7 +86,7 @@ CSideTreeView::~CSideTreeView()
// **** CMainWindow **** // **** CMainWindow ****
CMainWindow::CMainWindow(CApplicationDB *db) : m_ClientPanel(NULL), m_Db(db), SelectedEnumType(ENUM_ALL_INSTALLED) CMainWindow::CMainWindow(CAppDB *db) : m_ClientPanel(NULL), m_Db(db), SelectedEnumType(ENUM_ALL_INSTALLED)
{ {
} }
@ -276,7 +276,7 @@ CMainWindow::RemoveSelectedAppFromRegistry()
if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES) if (MessageBoxW(szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES)
{ {
CApplicationInfo *InstalledApp = (CApplicationInfo *)m_ApplicationView->GetFocusedItemData(); CAppInfo *InstalledApp = (CAppInfo *)m_ApplicationView->GetFocusedItemData();
if (!InstalledApp) if (!InstalledApp)
return FALSE; return FALSE;
@ -292,7 +292,7 @@ CMainWindow::UninstallSelectedApp(BOOL bModify)
if (!IsInstalledEnum(SelectedEnumType)) if (!IsInstalledEnum(SelectedEnumType))
return FALSE; return FALSE;
CApplicationInfo *InstalledApp = (CApplicationInfo *)m_ApplicationView->GetFocusedItemData(); CAppInfo *InstalledApp = (CAppInfo *)m_ApplicationView->GetFocusedItemData();
if (!InstalledApp) if (!InstalledApp)
return FALSE; return FALSE;
@ -517,7 +517,7 @@ CMainWindow::OnCommand(WPARAM wParam, LPARAM lParam)
} }
else else
{ {
CApplicationInfo *App = (CApplicationInfo *)m_ApplicationView->GetFocusedItemData(); CAppInfo *App = (CAppInfo *)m_ApplicationView->GetFocusedItemData();
if (App) if (App)
{ {
InstallApplication(App); InstallApplication(App);
@ -578,12 +578,12 @@ CMainWindow::UpdateStatusBarText()
} }
VOID VOID
CMainWindow::AddApplicationsToView(CAtlList<CApplicationInfo *> &List) CMainWindow::AddApplicationsToView(CAtlList<CAppInfo *> &List)
{ {
POSITION CurrentListPosition = List.GetHeadPosition(); POSITION CurrentListPosition = List.GetHeadPosition();
while (CurrentListPosition) while (CurrentListPosition)
{ {
CApplicationInfo *Info = List.GetNext(CurrentListPosition); CAppInfo *Info = List.GetNext(CurrentListPosition);
if (szSearchPattern.IsEmpty() || SearchPatternMatch(Info->szDisplayName, szSearchPattern) || if (szSearchPattern.IsEmpty() || SearchPatternMatch(Info->szDisplayName, szSearchPattern) ||
SearchPatternMatch(Info->szComments, szSearchPattern)) SearchPatternMatch(Info->szComments, szSearchPattern))
{ {
@ -613,7 +613,7 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload)
// set the display type of application-view. this will remove all the item in application-view too. // set the display type of application-view. this will remove all the item in application-view too.
m_ApplicationView->SetDisplayAppType(AppViewTypeInstalledApps); m_ApplicationView->SetDisplayAppType(AppViewTypeInstalledApps);
CAtlList<CApplicationInfo *> List; CAtlList<CAppInfo *> List;
m_Db->GetApps(List, EnumType); m_Db->GetApps(List, EnumType);
AddApplicationsToView(List); AddApplicationsToView(List);
} }
@ -632,7 +632,7 @@ CMainWindow::UpdateApplicationsList(AppsCategories EnumType, BOOL bReload)
} }
else else
{ {
CAtlList<CApplicationInfo *> List; CAtlList<CAppInfo *> List;
m_Db->GetApps(List, EnumType); m_Db->GetApps(List, EnumType);
AddApplicationsToView(List); AddApplicationsToView(List);
} }
@ -697,7 +697,7 @@ CMainWindow::ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
if (bUpdating) if (bUpdating)
return; return;
CApplicationInfo *Info = (CApplicationInfo *)CallbackParam; CAppInfo *Info = (CAppInfo *)CallbackParam;
if (bChecked) if (bChecked)
{ {
@ -720,7 +720,7 @@ CMainWindow::ItemCheckStateChanged(BOOL bChecked, LPVOID CallbackParam)
// this function is called when one or more application(s) should be installed // this function is called when one or more application(s) should be installed
// if Info is not zero, this app should be installed. otherwise those checked apps should be installed // if Info is not zero, this app should be installed. otherwise those checked apps should be installed
BOOL BOOL
CMainWindow::InstallApplication(CApplicationInfo *Info) CMainWindow::InstallApplication(CAppInfo *Info)
{ {
if (Info) if (Info)
{ {
@ -785,7 +785,7 @@ CMainWindow::HandleTabOrder(int direction)
// **** CMainWindow **** // **** CMainWindow ****
VOID VOID
MainWindowLoop(CApplicationDB *db, INT nShowCmd) MainWindowLoop(CAppDB *db, INT nShowCmd)
{ {
HACCEL KeyBrd; HACCEL KeyBrd;
MSG Msg; MSG Msg;

View file

@ -0,0 +1,35 @@
#pragma once
#include <atlcoll.h>
#include <atlpath.h>
#include "appinfo.h"
class CAppDB
{
private:
CPathW m_BasePath;
CAtlList<CAppInfo *> m_Available;
CAtlList<CAppInfo *> m_Installed;
BOOL
EnumerateFiles();
public:
CAppDB(const CStringW &path);
VOID
GetApps(CAtlList<CAppInfo *> &List, AppsCategories Type) const;
CAppInfo *
FindByPackageName(const CStringW &name);
VOID
UpdateAvailable();
VOID
UpdateInstalled();
VOID
RemoveCached();
BOOL
RemoveInstalledAppFromRegistry(const CAppInfo *Info);
};

View file

@ -65,11 +65,11 @@ IsInstalledEnum(INT x)
class CAppRichEdit; class CAppRichEdit;
class CApplicationInfo class CAppInfo
{ {
public: public:
CApplicationInfo(const CStringW &Identifier, AppsCategories Category); CAppInfo(const CStringW &Identifier, AppsCategories Category);
virtual ~CApplicationInfo(); virtual ~CAppInfo();
const CStringW szIdentifier; // PkgName or KeyName const CStringW szIdentifier; // PkgName or KeyName
const AppsCategories iCategory; const AppsCategories iCategory;
@ -97,7 +97,7 @@ class CApplicationInfo
UninstallApplication(BOOL bModify) = 0; UninstallApplication(BOOL bModify) = 0;
}; };
class CAvailableApplicationInfo : public CApplicationInfo class CAvailableApplicationInfo : public CAppInfo
{ {
class CConfigParser *m_Parser; class CConfigParser *m_Parser;
CSimpleArray<CStringW> m_szScrnshotLocation; CSimpleArray<CStringW> m_szScrnshotLocation;
@ -143,7 +143,7 @@ class CAvailableApplicationInfo : public CApplicationInfo
UninstallApplication(BOOL bModify) override; UninstallApplication(BOOL bModify) override;
}; };
class CInstalledApplicationInfo : public CApplicationInfo class CInstalledApplicationInfo : public CAppInfo
{ {
CRegKey m_hKey; CRegKey m_hKey;
CStringW m_szInstallDate; CStringW m_szInstallDate;

View file

@ -1,35 +0,0 @@
#pragma once
#include <atlcoll.h>
#include <atlpath.h>
#include "applicationinfo.h"
class CApplicationDB
{
private:
CPathW m_BasePath;
CAtlList<CApplicationInfo *> m_Available;
CAtlList<CApplicationInfo *> m_Installed;
BOOL
EnumerateFiles();
public:
CApplicationDB(const CStringW &path);
VOID
GetApps(CAtlList<CApplicationInfo *> &List, AppsCategories Type) const;
CApplicationInfo *
FindByPackageName(const CStringW &name);
VOID
UpdateAvailable();
VOID
UpdateInstalled();
VOID
RemoveCached();
BOOL
RemoveInstalledAppFromRegistry(const CApplicationInfo *Info);
};

View file

@ -177,7 +177,7 @@ class CAppInfoDisplay : public CUiWindow<CWindowImpl<CAppInfoDisplay>>
Create(HWND hwndParent); Create(HWND hwndParent);
VOID VOID
ShowAppInfo(CApplicationInfo *Info); ShowAppInfo(CAppInfo *Info);
VOID VOID
SetWelcomeText(); SetWelcomeText();
VOID VOID
@ -263,7 +263,7 @@ class CAppsListView : public CUiWindow<CWindowImpl<CAppsListView, CListView>>
SetViewMode(DWORD ViewMode); SetViewMode(DWORD ViewMode);
BOOL BOOL
AddApplication(CApplicationInfo *AppInfo, BOOL InitialCheckState); AddApplication(CAppInfo *AppInfo, BOOL InitialCheckState);
// this function is called when parent window receiving an notification about checkstate changing // this function is called when parent window receiving an notification about checkstate changing
VOID VOID
@ -397,7 +397,7 @@ class CApplicationView : public CUiWindow<CWindowImpl<CApplicationView>>
SetDisplayAppType(APPLICATION_VIEW_TYPE AppType); SetDisplayAppType(APPLICATION_VIEW_TYPE AppType);
BOOL BOOL
AddApplication(CApplicationInfo *InstAppInfo, BOOL InitialCheckState); AddApplication(CAppInfo *InstAppInfo, BOOL InitialCheckState);
VOID VOID
SetWatermark(const CStringW &Text); SetWatermark(const CStringW &Text);

View file

@ -1,6 +1,6 @@
#pragma once #pragma once
#include "applicationinfo.h" #include "appinfo.h"
#include <windef.h> #include <windef.h>
#include <atlsimpcoll.h> #include <atlsimpcoll.h>
@ -11,12 +11,12 @@ CreateSettingsDlg(HWND hwnd);
// Main window // Main window
VOID VOID
MainWindowLoop(class CApplicationDB *db, INT nShowCmd); MainWindowLoop(class CAppDB *db, INT nShowCmd);
// Download dialogs // Download dialogs
VOID VOID
DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial); DownloadApplicationsDB(LPCWSTR lpUrl, BOOL IsOfficial);
BOOL BOOL
DownloadApplication(CApplicationInfo *pAppInfo); DownloadApplication(CAppInfo *pAppInfo);
BOOL BOOL
DownloadListOfApplications(const CAtlList<CApplicationInfo *> &AppsList, BOOL bIsModal); DownloadListOfApplications(const CAtlList<CAppInfo *> &AppsList, BOOL bIsModal);

View file

@ -54,8 +54,8 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
CApplicationView *m_ApplicationView = NULL; CApplicationView *m_ApplicationView = NULL;
CApplicationDB *m_Db; CAppDB *m_Db;
CAtlList<CApplicationInfo *> m_Selected; CAtlList<CAppInfo *> m_Selected;
BOOL bUpdating = FALSE; BOOL bUpdating = FALSE;
@ -63,7 +63,7 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
AppsCategories SelectedEnumType; AppsCategories SelectedEnumType;
public: public:
CMainWindow(CApplicationDB *db); CMainWindow(CAppDB *db);
~CMainWindow(); ~CMainWindow();
@ -106,7 +106,7 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
VOID VOID
UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE); UpdateApplicationsList(AppsCategories EnumType, BOOL bReload = FALSE);
VOID VOID
AddApplicationsToView(CAtlList<CApplicationInfo *> &List); AddApplicationsToView(CAtlList<CAppInfo *> &List);
public: public:
static ATL::CWndClassInfo & static ATL::CWndClassInfo &
@ -123,7 +123,7 @@ class CMainWindow : public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits>
// this function is called when application-view is asked to install an application // this function is called when application-view is asked to install an application
// if Info is not zero, this app should be installed. otherwise those checked apps should be installed // if Info is not zero, this app should be installed. otherwise those checked apps should be installed
BOOL BOOL
InstallApplication(CApplicationInfo *Info); InstallApplication(CAppInfo *Info);
// this function is called when search text is changed // this function is called when search text is changed
BOOL BOOL

View file

@ -8,8 +8,8 @@
#include "defines.h" #include "defines.h"
#include "dialogs.h" #include "dialogs.h"
#include "applicationinfo.h" #include "appinfo.h"
#include "applicationdb.h" #include "appdb.h"
#include "misc.h" #include "misc.h"
#include "configparser.h" #include "configparser.h"

View file

@ -85,7 +85,7 @@ struct DownloadInfo
DownloadInfo() DownloadInfo()
{ {
} }
DownloadInfo(const CApplicationInfo &AppInfo) : DLType(DLTYPE_APPLICATION) DownloadInfo(const CAppInfo &AppInfo) : DLType(DLTYPE_APPLICATION)
{ {
AppInfo.GetDownloadInfo(szUrl, szSHA1, SizeInBytes); AppInfo.GetDownloadInfo(szUrl, szSHA1, SizeInBytes);
szName = AppInfo.szDisplayName; szName = AppInfo.szDisplayName;
@ -1052,7 +1052,7 @@ CDownloadManager::LaunchDownloadDialog(BOOL bIsModal)
// CDownloadManager // CDownloadManager
BOOL BOOL
DownloadListOfApplications(const CAtlList<CApplicationInfo *> &AppsList, BOOL bIsModal) DownloadListOfApplications(const CAtlList<CAppInfo *> &AppsList, BOOL bIsModal)
{ {
if (AppsList.IsEmpty()) if (AppsList.IsEmpty())
return FALSE; return FALSE;
@ -1060,7 +1060,7 @@ DownloadListOfApplications(const CAtlList<CApplicationInfo *> &AppsList, BOOL bI
POSITION CurrentListPosition = AppsList.GetHeadPosition(); POSITION CurrentListPosition = AppsList.GetHeadPosition();
while (CurrentListPosition) while (CurrentListPosition)
{ {
const CApplicationInfo *Info = AppsList.GetNext(CurrentListPosition); const CAppInfo *Info = AppsList.GetNext(CurrentListPosition);
CDownloadManager::Add(DownloadInfo(*Info)); CDownloadManager::Add(DownloadInfo(*Info));
} }
@ -1071,7 +1071,7 @@ DownloadListOfApplications(const CAtlList<CApplicationInfo *> &AppsList, BOOL bI
} }
BOOL BOOL
DownloadApplication(CApplicationInfo *pAppInfo) DownloadApplication(CAppInfo *pAppInfo)
{ {
if (!pAppInfo) if (!pAppInfo)
return FALSE; return FALSE;

View file

@ -44,7 +44,7 @@ InitRappsConsole()
} }
static BOOL static BOOL
HandleInstallCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) HandleInstallCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
{ {
if (argcLeft < 1) if (argcLeft < 1)
{ {
@ -53,11 +53,11 @@ HandleInstallCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR
return FALSE; return FALSE;
} }
CAtlList<CApplicationInfo *> Applications; CAtlList<CAppInfo *> Applications;
for (int i = 0; i < argcLeft; i++) for (int i = 0; i < argcLeft; i++)
{ {
LPCWSTR PackageName = argvLeft[i]; LPCWSTR PackageName = argvLeft[i];
CApplicationInfo *AppInfo = db->FindByPackageName(PackageName); CAppInfo *AppInfo = db->FindByPackageName(PackageName);
if (AppInfo) if (AppInfo)
{ {
Applications.AddTail(AppInfo); Applications.AddTail(AppInfo);
@ -68,7 +68,7 @@ HandleInstallCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR
} }
static BOOL static BOOL
HandleSetupCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) HandleSetupCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
{ {
if (argcLeft != 1) if (argcLeft != 1)
{ {
@ -77,7 +77,7 @@ HandleSetupCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *a
return FALSE; return FALSE;
} }
CAtlList<CApplicationInfo *> Applications; CAtlList<CAppInfo *> Applications;
HINF InfHandle = SetupOpenInfFileW(argvLeft[0], NULL, INF_STYLE_WIN4, NULL); HINF InfHandle = SetupOpenInfFileW(argvLeft[0], NULL, INF_STYLE_WIN4, NULL);
if (InfHandle == INVALID_HANDLE_VALUE) if (InfHandle == INVALID_HANDLE_VALUE)
{ {
@ -92,7 +92,7 @@ HandleSetupCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *a
{ {
if (SetupGetStringFieldW(&Context, 1, szPkgName, _countof(szPkgName), NULL)) if (SetupGetStringFieldW(&Context, 1, szPkgName, _countof(szPkgName), NULL))
{ {
CApplicationInfo *AppInfo = db->FindByPackageName(szPkgName); CAppInfo *AppInfo = db->FindByPackageName(szPkgName);
if (AppInfo) if (AppInfo)
{ {
Applications.AddTail(AppInfo); Applications.AddTail(AppInfo);
@ -106,7 +106,7 @@ HandleSetupCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *a
} }
static BOOL static BOOL
HandleFindCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) HandleFindCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
{ {
if (argcLeft < 1) if (argcLeft < 1)
{ {
@ -114,7 +114,7 @@ HandleFindCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *ar
return FALSE; return FALSE;
} }
CAtlList<CApplicationInfo *> List; CAtlList<CAppInfo *> List;
db->GetApps(List, ENUM_ALL_AVAILABLE); db->GetApps(List, ENUM_ALL_AVAILABLE);
for (int i = 0; i < argcLeft; i++) for (int i = 0; i < argcLeft; i++)
@ -125,7 +125,7 @@ HandleFindCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *ar
POSITION CurrentListPosition = List.GetHeadPosition(); POSITION CurrentListPosition = List.GetHeadPosition();
while (CurrentListPosition) while (CurrentListPosition)
{ {
CApplicationInfo *Info = List.GetNext(CurrentListPosition); CAppInfo *Info = List.GetNext(CurrentListPosition);
if (SearchPatternMatch(Info->szDisplayName, lpszSearch) || SearchPatternMatch(Info->szComments, lpszSearch)) if (SearchPatternMatch(Info->szDisplayName, lpszSearch) || SearchPatternMatch(Info->szComments, lpszSearch))
{ {
@ -140,7 +140,7 @@ HandleFindCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *ar
} }
static BOOL static BOOL
HandleInfoCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft) HandleInfoCommand(CAppDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *argvLeft)
{ {
if (argcLeft < 1) if (argcLeft < 1)
{ {
@ -151,7 +151,7 @@ HandleInfoCommand(CApplicationDB *db, LPWSTR szCommand, int argcLeft, LPWSTR *ar
for (int i = 0; i < argcLeft; i++) for (int i = 0; i < argcLeft; i++)
{ {
LPCWSTR PackageName = argvLeft[i]; LPCWSTR PackageName = argvLeft[i];
CApplicationInfo *AppInfo = db->FindByPackageName(PackageName); CAppInfo *AppInfo = db->FindByPackageName(PackageName);
if (!AppInfo) if (!AppInfo)
{ {
ConResMsgPrintf(StdOut, NULL, IDS_CMD_PACKAGE_NOT_FOUND, PackageName); ConResMsgPrintf(StdOut, NULL, IDS_CMD_PACKAGE_NOT_FOUND, PackageName);
@ -231,7 +231,7 @@ ParseCmdAndExecute(LPWSTR lpCmdLine, BOOL bIsFirstLaunch, int nCmdShow)
CStringW Directory; CStringW Directory;
GetStorageDirectory(Directory); GetStorageDirectory(Directory);
CApplicationDB db(Directory); CAppDB db(Directory);
if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch) if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch)
{ {