Changeset 1673 for trunk/gsinstaller


Ignore:
Timestamp:
2000-11-16T09:13:48+13:00 (23 years ago)
Author:
cs025
Message:

Fixed problem in uninstalling which appeared when uninstalling the shortcut
icons.
Parameters to undo didn't permit two parameters to be the same, and if for
example a shortcut was in a group with the same name, a parameter
disappeared. Fixed by extending stringArray class to be configured to accept
duplicate entries.

Location:
trunk/gsinstaller
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsinstaller/stringArray.cpp

    r1498 r1673  
    2626}
    2727
     28void stringArray::permitDuplication(bool permit)
     29{   this->permitDups    = permit;
     30}
     31
    2832/**
    2933 * Add a new string to the array
    3034 */
    3135void stringArray::add(string member)
    32 {   if (!this->includes(member))
     36{   if (this->permitDups || !this->includes(member))
    3337    { this->array.push_back(member);
    3438  }
  • trunk/gsinstaller/stringArray.h

    r1539 r1673  
    1919{
    2020private:
     21  vector<string> array;
     22  bool                   permitDups;
    2123protected:
    2224public:
    23   vector<string> array;
    2425  stringArray();
    2526  stringArray(char *list, char *divider);
     27  void permitDuplication(bool permit);
    2628  void add(char *member);
    2729  void add(string member);
  • trunk/gsinstaller/unInstall.cpp

    r1639 r1673  
    5757    // open the log file
    5858    this->logfile.open(this->logfileName.c_str(), ios::in);
     59#ifndef __BORLANDC__
    5960    if (this->logfile.is_open())
     61#else
     62    if (this->logfile.rdbuf()->is_open())
     63#endif
    6064    {
    6165        // Get the commands into this object from the existing log file
     
    225229
    226230bool installManager::recordLog()
    227 {
    228     // just return if there are no changes to record
     231{   // just return if there are no changes to record
    229232    if (this->changed == false)
    230     {   return true;
     233    { return true;
    231234    }
    232235
     
    237240    this->ensureLog();
    238241    this->logfile.open(this->logfileName.c_str(), ios::out);
     242#ifndef __BORLANDC__
    239243    if (!this->logfile.is_open())
     244#else
     245    if (!this->logfile.rdbuf()->is_open())
     246#endif
    240247    {   MessageBox(0, "Unable to open log file", "Test", MB_OK);
    241248    }
  • trunk/gsinstaller/unInstall.h

    r1639 r1673  
    3232  stringArray parameters;
    3333
    34   unInstallCommand() { };
    35   unInstallCommand(string commandname) { this->command = commandname; };
     34  unInstallCommand()
     35  { this->parameters.permitDuplication(true);
     36  }
     37  unInstallCommand(string commandname)
     38  { this->command = commandname;
     39    this->parameters.permitDuplication(true);
     40  }
    3641  unInstallCommand(string commandname, stringArray params)
    37   { 
     42  {
    3843    this->command = commandname;
    3944    this->parameters = params;
     45    this->parameters.permitDuplication(true);
    4046  };
    4147  void addParameter(string parameter) { this->parameters.add(parameter); };
Note: See TracChangeset for help on using the changeset viewer.