Changeset 11663 for trunk


Ignore:
Timestamp:
2006-04-21T10:27:53+12:00 (18 years ago)
Author:
mdewsnip
Message:

Fixed up the line endings.

Location:
trunk/gsinstaller
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsinstaller/DiskSpace.h

    r2324 r11663  
    1717  unsigned long totalFreeSpace();
    1818};
     19
    1920#endif
  • trunk/gsinstaller/configurable.cpp

    r2534 r11663  
    2626{   return this->option;
    2727}
    28 void configurable::setFirst(bool isFirst)
    29 {   this->first = isFirst;
    30 }
    31 
    32 bool configurable::isFirst()
    33 {   return this->first;
    34 }
    35 void configurable::setFinal(bool isFinal)
    36 {   this->final = isFinal;
    37 }
    38 bool configurable::isFinal()
    39 {   return this->final;
    40 }
     28void configurable::setFirst(bool isFirst){  this->first = isFirst;}bool configurable::isFirst()
     29{   return this->first;}
     30void configurable::setFinal(bool isFinal){  this->final = isFinal;}
     31bool configurable::isFinal(){   return this->final;}
  • trunk/gsinstaller/copyProgress.h

    r2534 r11663  
    11#ifndef _COPYPROGRESS_H_
    22#define _COPYPROGRESS_H_
     3
    34#include <windows.h>
    45#include <time.h>
     6
    57
    68class copyProgressBar
     
    1618        bool              showing;
    1719      time_t          startTime;
     20
    1821    public:
    1922      // constructors/destructors
     
    2124
    2225        copyProgressBar(unsigned long totalSize, unsigned long totalFiles);
     26
    2327       ~copyProgressBar(); // destructor introduced to ensure that open windows are closed
    2428
    2529       void registerClass();    // does the registration of the window classes into Windows
     30
    2631    // the window procedure itself
    2732    LRESULT CALLBACK windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);
     
    2934    // timing methods
    3035    void setStartTime() { this->startTime = time(NULL); }
     36
    3137    // messaging methods
    3238    void done(unsigned long bytesDone);
     
    3642    // reinitialise the progress bar, giving a new total completion size
    3743    void init(unsigned long totalSize, unsigned long totalFiles);
     44
    3845    // show the progress bar
    3946    void show();
     47
    4048    // close (hide) the progress bar
    4149    void close();
     50
    4251};
     52
    4353#endif
  • trunk/gsinstaller/file.cpp

    r2534 r11663  
    55// #include <stdio.h>
    66
    7 #include "file.h"
    8 
    9 #include <direct.h>
     7#include "file.h"#include <direct.h>
    108
    119void File::_getDetails()
     
    107105{   return this->size;
    108106}
    109 unsigned long File::getFileSize()
    110 {   unsigned long size, files;
    111 
    112     this->getFileSize(size, files);
    113    return size;
    114 }
     107unsigned long File::getFileSize(){  unsigned long size, files;  this->getFileSize(size, files);   return size;}
    115108void File::getFileSize(unsigned long &totalSize, unsigned long &totalFiles)
    116 {   totalSize   = 0;
    117     totalFiles  = 1;
     109{   totalSize   = 0;    totalFiles  = 1;
    118110
    119111    if (this->is_dir)
     
    122114
    123115      while (here != end)
    124     {  unsigned long ldata, lcount;
    125 
    126       here->getFileSize(ldata, lcount);
    127     totalSize   +=  ldata;
    128       totalFiles  += lcount;
     116    {  unsigned long ldata, lcount;      here->getFileSize(ldata, lcount);      totalSize   +=  ldata;      totalFiles  += lcount;
    129117        here ++;
    130       }
    131   }
    132 
    133   totalSize +=  this->size;
    134 }
     118      }  }  totalSize   +=  this->size;}
    135119
    136120
     
    154138{ return this->does_exist;
    155139}
    156 bool File::remove()
    157 {  bool ok = true;
    158 
    159     if (this->is_dir)
    160     {
    161         vector<File>::iterator here = this->children.begin();
    162       vector<File>::iterator end     = this->children.end();
    163 
    164       while (here != end)
    165       {  ok = here->remove() && ok;
    166         here ++;
    167       }
    168 
    169       ok = RemoveDirectory(this->path.c_str()) && ok;
    170    }
    171    else
    172    {    ok = DeleteFile(this->path.c_str()) != 0 ? true : false;
    173    }
    174    return ok;
    175 }
     140bool File::remove(){  bool ok = true;   if (this->is_dir)   {       vector<File>::iterator here = this->children.begin();      vector<File>::iterator end    = this->children.end();      while (here != end)      {  ok = here->remove() && ok;        here ++;      }      ok = RemoveDirectory(this->path.c_str()) && ok;   }   else   { ok = DeleteFile(this->path.c_str()) != 0 ? true : false;   }   return ok;}
    176141void File::copy(char *to)
    177142{
  • trunk/gsinstaller/gsManifest.cpp

    r2534 r11663  
    324324  if (actionName == "Manifest.CreateDir" || actionName == "CreateDir")
    325325    {
    326       if (!RemoveDirectory(params[0].c_str()))
    327       {
    328             this->removeFailed.add(params[0]);
    329       }
     326      if (!RemoveDirectory(params[0].c_str()))    {         this->removeFailed.add(params[0]);    }
    330327      return true;
    331328    }
     
    336333         if (!f.remove())
    337334           {
    338               this->removeFailed.add(params[0]);
    339            }
     335              this->removeFailed.add(params[0]);           }
    340336         return true;
    341337      }
  • trunk/gsinstaller/gsProfile.cpp

    r2534 r11663  
    2727{ if (actionName == "ProfileCreate")
    2828  { if (this->fileName == params[0])
    29     {   DeleteFile(params[0].c_str());
    30         return true;
     29    {   DeleteFile(params[0].c_str());      return true;
    3130    }
    3231  }
     
    10099{   if (!WritePrivateProfileString( sectionName.c_str(), itemName.c_str(),
    101100                                                                    itemValue.c_str(), this->fileName.c_str()))
    102     { DWORD error = GetLastError();
    103 /*      char buffer[201];
    104         FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
     101    { DWORD error = GetLastError();/*       char buffer[201];       FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
    105102      MessageBox(0, buffer, "Write error", MB_OK);
    106103*/
     
    115112{ if (!WritePrivateProfileString( sectionName.c_str(), itemName.c_str(),
    116113                                    NULL, this->fileName.c_str()))
    117     {  DWORD error = GetLastError();
    118       if (error != 3)
    119       {     char buffer[201];
    120 
    121             MessageBox(0, "Failed", itemName.c_str(), MB_OK);
    122             FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
     114    {  DWORD error = GetLastError();      if (error != 3)      {    char buffer[201];           MessageBox(0, "Failed", itemName.c_str(), MB_OK);           FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, 0, 0, buffer, 200, NULL);
    123115          MessageBox(0, buffer, "Write error", MB_OK);
    124116            return false;
    125117    }
    126118      WritePrivateProfileString(NULL, NULL, NULL, this->fileName.c_str());
    127         MessageBox(0, this->fileName.c_str(), sectionName.c_str(), MB_OK);
    128   }
     119        MessageBox(0, this->fileName.c_str(), sectionName.c_str(), MB_OK);  }
    129120  return true;
    130121}
  • trunk/gsinstaller/unInstall.cpp

    r2532 r11663  
    2828    FilePath p(this->logfileName);
    2929    FilePath *parent = p.parent();
    30     command.addParameter(parent->pathString());
    31     delete parent;
     30    command.addParameter(parent->pathString());    delete parent;
    3231
    3332    if (this->modules["default"].begin()->command != "InstallRoot")
     
    6160{   string command;
    6261    stringArray params;
    63 
    6462    // don't try to open an non-existing log; this has serious
    6563    // repercussions with bad old VC++
     
    8482            }
    8583            else
    86             {   unInstallCommand action(command, params);
    87 
    88                 this->storeCommand(action);
     84            {   unInstallCommand action(command, params);               this->storeCommand(action);
    8985            }
    9086        }
     
    109105
    110106bool installManager::storeCommand(unInstallCommand &command)
    111 {
    112     this->modules[this->currentModule].push_back(command);
    113 
    114     this->changed = true; // set the "changed" flag
     107{   this->modules[this->currentModule].push_back(command);  this->changed = true; // set the "changed" flag
    115108    return true;
    116109}
     
    245238  return command;
    246239}
    247 void installManager::abortLog()
    248 {   this->changed = false;
    249 }
     240void installManager::abortLog(){    this->changed = false;}
    250241bool installManager::recordLog()
    251242{   // just return if there are no changes to record
Note: See TracChangeset for help on using the changeset viewer.