This commit is contained in:
Manohar
2006-03-06 09:54:36 +00:00
parent d01ef968e0
commit 0bc1f679e4
5 changed files with 78 additions and 83 deletions

View File

@@ -187,7 +187,7 @@ extern "C" APIEXPORT int FPM_GetProfileList(char **profileList[], int *profileFl
strcpy(profList[profileCount],temp);
profFlag[profileCount] = 0;
PrintMessage(MESG_ERROR, "\n GetProfileList : Found profile = [%s]", profList[profileCount]);
PrintMessage(MESG_DEBUG, "\n GetProfileList : Found profile = [%s]", profList[profileCount]);
profileCount++;
continue;
}
@@ -219,52 +219,53 @@ extern "C" APIEXPORT int FPM_GetProfileList(char **profileList[], int *profileFl
extern "C" APIEXPORT int FPM_FirefoxProfileInit(char *profileName)
{
int retValue;
int profileIndex = -1;
int isObjectExist = FPM_FALSE;
// check if the profile is already initialized...
int profileIndex = -1;
// Check if the object for specified profile already present...
for(int i=0; i< profileCount; i++)
{
if( profileManager[i].profileName != NULL )
{
if( STRCMPI(profileManager[i].profileName, profileName) == 0 )
{
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Specified profile object [%s] is already present ", profileName);
profileIndex = i;
isObjectExist = FPM_TRUE;
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Object for specified profile %s exist ", profileName);
profileIndex = i;
break;
}
}
}
// This is new profile...
if( (profileIndex == -1) && ( (profileCount + 1) >= MAX_PROFILE_COUNT) )
if( profileIndex == -1)
{
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Max profile count exceeded.");
return FPM_PROFILE_LIMIT_EXCEEDED;
}
if(profileIndex == -1 )
{
profileIndex = profileCount;
profileCount++;
}
// If not already initialized then go and initialize it...
if( profileManager[profileIndex].isInitialized == FPM_FALSE )
{
if( (retValue = profileManager[profileIndex].ProfileInit(profileName)) != FPM_TRUE )
if( (profileCount + 1) >= MAX_PROFILE_COUNT)
{
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Failed to initialize the profile %s ", profileName);
return retValue;
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Max profile count exceeded.");
return FPM_PROFILE_LIMIT_EXCEEDED;
}
}
else
{
PrintMessage(MESG_DEBUG, "\n FirefoxProfileInit : Firefox profile %s is already initialized ", profileName);
return FPM_TRUE;
profileIndex = profileCount;
profileCount++;
}
// check if the profile is already initialized...
if( profileManager[profileIndex].isInitialized == FPM_TRUE )
{
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Specified profile %s is already initialized", profileName);
return FPM_TRUE;
}
if( (retValue = profileManager[profileIndex].ProfileInit(profileName)) != FPM_TRUE )
{
PrintMessage(MESG_ERROR, "\n FirefoxProfileInit : Failed to initialize the profile %s ", profileName);
return retValue;
}
PrintMessage(MESG_DEBUG, "\n FirefoxProfileInit : Firefox profile %s initialized successfully ", profileName);
return FPM_TRUE;
}