C4Group: Do not use C4Config

This disables writing the maker name into the group. But this bit of meta
data will be lost anyway when we move to ZIPs.

The temp directory and registration check bits are unnecessary, anyway.
stable-5.2
Günther Brammer 2009-06-17 21:45:41 +02:00
parent fb249aafcd
commit 6ff9c8c48a
4 changed files with 18 additions and 17 deletions

View File

@ -501,8 +501,6 @@ c4group_CPPFLAGS = \
c4group_SOURCES = \
group/c4group_ng.cpp \
engine/src/C4Config.cpp \
engine/sec/C4ConfigShareware.cpp \
engine/src/C4Group.cpp \
engine/src/C4InputValidation.cpp \
engine/sec/C4SecurityCertificates.cpp \

View File

@ -987,7 +987,8 @@ bool C4Group::Save(BOOL fReOpen)
{
// Create target temp file (in temp directory!)
SCopy(FileName,szGrpFileName,_MAX_FNAME);
SCopy(Config.AtTempPath(GetFilename(FileName)),szTempFileName,_MAX_FNAME);
if (C4Group_TempPath[0]) { SCopy(C4Group_TempPath,szTempFileName,_MAX_FNAME); SAppend(GetFilename(FileName),szTempFileName,_MAX_FNAME); }
else SCopy(FileName,szTempFileName,_MAX_FNAME);
MakeTempFilename(szTempFileName);
// (Temp file must not have the same name as the group.)
if (SEqual(szTempFileName,szGrpFileName))

View File

@ -706,6 +706,8 @@ BOOL C4UpdatePackage::MakeUpdate(const char *strFile1, const char *strFile2, con
return TRUE;
}
extern char C4Group_TempPath[_MAX_PATH+1];
BOOL C4UpdatePackage::MkUp(C4Group *pGrp1, C4Group *pGrp2, C4GroupEx *pUpGrp, BOOL *fModified)
{
// (CAUTION: pGrp1 may be NULL - that means that there is no counterpart for Grp2
@ -756,7 +758,8 @@ BOOL C4UpdatePackage::MkUp(C4Group *pGrp1, C4Group *pGrp2, C4GroupEx *pUpGrp, BO
if(!UpdGroup.OpenAsChild(pUpGrp, strItemName))
{
// create new group (may be temporary)
SCopy(GetCfg()->AtTempPath("~upd"), strTempGroupName, _MAX_FNAME);
if (C4Group_TempPath[0]) { SCopy(C4Group_TempPath,strTempGroupName,_MAX_FNAME); SAppend("~upd",strTempGroupName,_MAX_FNAME); }
else SCopy("~upd",strTempGroupName,_MAX_FNAME);
MakeTempFilename(strTempGroupName);
if(!UpdGroup.Open(strTempGroupName, TRUE)) { delete pChildGrp1; WriteLog("Error: could not create temp group\n"); return FALSE; }
}

View File

@ -56,13 +56,6 @@ char strExecuteAtEnd[_MAX_PATH + 1] = "";
int iResult = 0;
C4ConfigShareware Config;
C4Config *GetCfg() {
return &Config;
}
CDDrawCfg DDrawCfg; // to satisfy the linker
bool Log(const char *msg) {
if (!fQuiet)
printf("%s\n", msg);
@ -77,6 +70,13 @@ BOOL LogF(const char *strMessage, ...) {
// Log
return Log(Buf.getData());
}
BOOL DebugLogF(const char *strMessage ...)
{
va_list args; va_start(args, strMessage);
StdStrBuf Buf;
Buf.FormatV(strMessage, args);
return Log(Buf.getData());
}
bool ProcessGroup(const char *FilenamePar) {
@ -95,11 +95,10 @@ bool ProcessGroup(const char *FilenamePar) {
LogF("Group: %s", szFilename);
// Open group file
if (hGroup.Open(szFilename, TRUE && Config.Registered())) {
if (hGroup.Open(szFilename, TRUE)) {
// No commands: display contents
if (iFirstCommand >= argc) {
hGroup.SetStdOutput(true);
if (Config.Registered())
hGroup.View("*");
hGroup.SetStdOutput(!fQuiet);
}
@ -450,12 +449,12 @@ int main(int argc, char *argv[]) {
LogF("RedWolf Design C4Group %s", C4VERSION);
// Registration check
Config.Init();
Config.Load(FALSE);
/* Config.Init();
Config.Load(FALSE);*/
// Init C4Group
C4Group_SetMaker(Config.General.Name);
C4Group_SetTempPath(Config.General.TempPath);
/* C4Group_SetMaker(Config.General.Name);
C4Group_SetTempPath(Config.General.TempPath);*/
C4Group_SetSortList(C4CFN_FLS);
// Store command line parameters