Changeset 524

Show
Ignore:
Timestamp:
05/13/09 14:06:58 (3 years ago)
Author:
uncle_fungus
Message:

Stricter string handling

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/benchmarksDialog.cpp

    r451 r524  
    268268                        clientLocation.Replace(_T("/"), _T("\\")); 
    269269#endif 
    270                 clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation); 
     270                clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation.c_str()); 
    271271 
    272272                if(clientName.IsEmpty() == false) 
  • trunk/src/clientDialog.cpp

    r484 r524  
    172172 
    173173 
    174 int ClientDialog::ShowModal(wxUint32 clientId, wxString filename) 
     174int ClientDialog::ShowModal(wxUint32 clientId, wxString const &filename) 
    175175{ 
    176176        const Client* clientToEdit; 
  • trunk/src/core.cpp

    r482 r524  
    2626 
    2727 
    28 wxString Core::mCoreLongName[CORE_ID_COUNT] = { 
     28wxString const Core::mCoreLongName[CORE_ID_COUNT] = { 
    2929        _T("Tinker"), 
    3030        _T("Gromacs"), 
     
    4949        _T("GPU2 NV MT") 
    5050}; 
    51 wxString Core::mCoreShortName[CORE_ID_COUNT] = { 
     51wxString const Core::mCoreShortName[CORE_ID_COUNT] = { 
    5252        _T("tinker"), 
    5353        _T("gromacs"), 
     
    7474 
    7575 
    76 CoreId Core::ShortNameToId(const wxString& name) 
     76CoreId const Core::ShortNameToId(const wxString& name) 
    7777{ 
    7878        CoreId identifier; 
     
    9090 
    9191 
    92 wxString Core::IdToShortName(CoreId identifier) 
     92wxString const Core::IdToShortName(CoreId identifier) 
    9393{ 
    9494        if(identifier >= CORE_ID_COUNT) 
     
    101101 
    102102 
    103 wxString Core::IdToLongName(CoreId identifier) 
     103wxString const Core::IdToLongName(CoreId identifier) 
    104104{ 
    105105        if(identifier >= CORE_ID_COUNT) 
     
    112112 
    113113 
    114 wxString Core::IdToClientType(CoreId identifier) 
     114wxString const Core::IdToClientType(CoreId identifier) 
    115115{ 
    116116        wxString clientType; 
  • trunk/src/ftpConnection.cpp

    r505 r524  
    3333 
    3434 
    35 bool FTPConnection::GetFTPFile(wxString url, wxString tempFile) 
     35bool FTPConnection::GetFTPFile(wxString const &url, wxString const &tempFile) 
    3636{ 
    3737        bool isUsingProxy; 
     
    8787 
    8888 
    89 long FTPConnection::GetFTPResponseCode(wxString url) 
     89long FTPConnection::GetFTPResponseCode(wxString const &url) 
    9090{ 
    9191        bool isUsingProxy; 
     
    120120 
    121121 
    122 wxDateTime FTPConnection::GetFTPFileModificationTime(wxString url) 
     122wxDateTime FTPConnection::GetFTPFileModificationTime(wxString const &url) 
    123123{ 
    124124        bool isUsingProxy; 
     
    152152 
    153153 
    154 bool FTPConnection::PutFTPFile(wxString url, wxString tempFile) 
     154bool FTPConnection::PutFTPFile(wxString const &url, wxString const &tempFile) 
    155155{ 
    156156        bool isUsingProxy; 
  • trunk/src/httpDownloader.cpp

    r453 r524  
    3333 
    3434 
    35 bool HTTPDownloader::GetHTTPFile(wxString url, wxString tempFile) 
     35bool HTTPDownloader::GetHTTPFile(wxString const &url, wxString const &tempFile) 
    3636{ 
    3737        bool isUsingProxy; 
     
    7373 
    7474 
    75 long HTTPDownloader::GetHTTPResponseCode(wxString url) 
     75long HTTPDownloader::GetHTTPResponseCode(wxString const &url) 
    7676{ 
    7777        bool isUsingProxy; 
     
    105105 
    106106 
    107 wxString HTTPDownloader::GetHTTPHeader(wxString url, wxString header) 
     107wxString HTTPDownloader::GetHTTPHeader(wxString const &url, wxString const &header) 
    108108{ 
    109109        bool isUsingProxy; 
  • trunk/src/include/clientDialog.h

    r371 r524  
    9494         * @param filename The location of the client to add. 
    9595         **/ 
    96         int ShowModal(wxUint32 clientId, wxString filename); 
     96        int ShowModal(wxUint32 clientId, wxString const &filename); 
    9797 
    9898 
  • trunk/src/include/core.h

    r464 r524  
    7676         * @return Indentifier for core 
    7777         **/ 
    78         static CoreId   ShortNameToId(wxString const &name); 
     78        static const CoreId   ShortNameToId(wxString const &name); 
    7979 
    8080        /** 
     
    8383         * @return String containing short core name. 
    8484         **/ 
    85         static wxString IdToShortName(CoreId identifier); 
     85        static const wxString IdToShortName(CoreId identifier); 
    8686 
    8787        /** 
     
    9090         * @return String containing the full core name. 
    9191         **/ 
    92         static wxString IdToLongName(CoreId identifier); 
     92        static const wxString IdToLongName(CoreId identifier); 
    9393 
    9494        /** 
     
    9797         * @return String containing the client type. 
    9898         **/ 
    99         static wxString IdToClientType(CoreId identifier); 
     99        static const wxString IdToClientType(CoreId identifier); 
    100100 
    101101 
     
    105105         * The elements are case insensitive and need to match the order in _CORE_ID 
    106106         **/ 
    107         static wxString mCoreShortName[CORE_ID_COUNT]; 
     107        static const wxString mCoreShortName[CORE_ID_COUNT]; 
    108108 
    109109        /** 
     
    111111         * The elements need to match the order in _CORE_ID but are descriptions not identifiers. 
    112112         **/ 
    113         static wxString mCoreLongName[CORE_ID_COUNT]; 
     113        static const wxString mCoreLongName[CORE_ID_COUNT]; 
    114114}; 
    115115 
  • trunk/src/include/ftpConnection.h

    r480 r524  
    6161                 * @return Success of operation. 
    6262                 **/ 
    63                 static bool GetFTPFile(wxString url, wxString tempFile); 
     63                static bool GetFTPFile(wxString const &url, wxString const &tempFile); 
    6464 
    6565                /** 
     
    6868                 * @return The FTP response code 
    6969                 **/ 
    70                 static long GetFTPResponseCode(wxString url); 
     70                static long GetFTPResponseCode(wxString const &url); 
    7171 
    7272                /** 
     
    7777                 * @return Time last modified 
    7878                 **/ 
    79                 static wxDateTime GetFTPFileModificationTime(wxString url); 
     79                static wxDateTime GetFTPFileModificationTime(wxString const &url); 
    8080 
    8181                /** 
     
    8585                 * @return Success 
    8686                 **/ 
    87                 static bool PutFTPFile(wxString url, wxString tempFile); 
     87                static bool PutFTPFile(wxString const &url, wxString const &tempFile); 
    8888}; 
    8989 
  • trunk/src/include/httpDownloader.h

    r480 r524  
    7373                 * @return Success of operation. 
    7474                 **/ 
    75                 static bool GetHTTPFile(wxString url, wxString tempFile); 
     75                static bool GetHTTPFile(wxString const &url, wxString const &tempFile); 
    7676 
    7777                /** 
     
    8080                 * @return The HTTP response code 
    8181                 **/ 
    82                 static long GetHTTPResponseCode(wxString url); 
     82                static long GetHTTPResponseCode(wxString const &url); 
    8383 
    8484                /** 
     
    8888                 * @return Resulting header value if any. 
    8989                 **/ 
    90                 static wxString GetHTTPHeader(wxString url, wxString header); 
     90                static wxString GetHTTPHeader(wxString const &url, wxString const &header); 
    9191}; 
    9292 
  • trunk/src/include/mainDialog.h

    r502 r524  
    169169        static wxMutex     mMutexUpdateCheck; /**< Locks access to the update method */ 
    170170        static wxMutex     mMutexArrayBlocker; /**< Locks access to the s_clientThreadsArray */ 
     171        static wxMutex     mMutexClientInformation; /**< Locks access to updating client information in GUI */ 
    171172 
    172173        // Widgets used in the frame 
     
    408409         * @param resource The location of the file to download 
    409410         **/ 
    410         bool DownloadUpdateFile(wxString& fileName, ProgressManager& progressManager, wxString& errorMsg, wxString resource); 
     411        bool DownloadUpdateFile(wxString const &fileName, ProgressManager& progressManager, wxString& errorMsg, wxString const &resource); 
    411412 
    412413        /** 
  • trunk/src/include/preference.h

    r389 r524  
    7373         * @param value Boolean value 
    7474         **/ 
    75         Preference(wxString name, bool value); 
     75        Preference(wxString const &name, bool value); 
    7676 
    7777        /** 
     
    8080         * @param value Double value 
    8181         **/ 
    82         Preference(wxString name, double value); 
     82        Preference(wxString const &name, double value); 
    8383 
    8484        /** 
     
    8787         * @param value Int32 value 
    8888         **/ 
    89         Preference(wxString name, wxInt32 value); 
     89        Preference(wxString const &name, wxInt32 value); 
    9090 
    9191        /** 
     
    9494         * @param value Uint32 value 
    9595         **/ 
    96         Preference(wxString name, wxUint32 value); 
     96        Preference(wxString const&name, wxUint32 value); 
    9797 
    9898        /** 
     
    102102         * @param isHidden Hidden state 
    103103         **/ 
    104         Preference(wxString name, wxString const &value, bool isHidden = false); 
     104        Preference(wxString const &name, wxString const &value, bool isHidden = false); 
    105105 
    106106        /** 
  • trunk/src/include/queue.h

    r485 r524  
    236236         * @returns true/false depending on whether the queue could be read successfully. 
    237237        **/ 
    238         bool LoadQueueFile(wxString const &filename, wxString clientName, wxString& localname); 
     238        bool LoadQueueFile(wxString const &filename, wxString const &clientName, wxString& localname); 
    239239 
    240240        ProjectId         GetProjectId(void)    const {return mProjectId;} /**< Returns the WU project number */ 
  • trunk/src/include/tools.h

    r485 r524  
    8282         * @param localname Reference to an object to store the local filename. 
    8383         **/ 
    84         static bool     LoadFile(wxString const &filename, wxString& fileContent,wxString& localname, wxUint32 length = 0, bool fromStart = true ); 
     84        static bool     LoadFile(wxString const &filename, wxString& fileContent, wxString& localname, wxUint32 length = 0, bool fromStart = true ); 
    8585 
    8686        // Miscellaneous message boxes 
  • trunk/src/mainDialog.cpp

    r508 r524  
    159159wxMutex MainDialog::mMutexUpdateCheck; 
    160160wxMutex MainDialog::mMutexArrayBlocker; 
     161wxMutex MainDialog::mMutexClientInformation; 
    161162 
    162163 
     
    356357void MainDialog::UpdateClientInformation(ClientId clientId) 
    357358{ 
     359        wxMutexLocker lock(mMutexClientInformation); 
    358360        bool          autoUpdateProjects; 
    359361        wxUint32      deadlineDays; 
  • trunk/src/preference.cpp

    r406 r524  
    3434 
    3535 
    36 Preference::Preference(wxString name, bool value) 
     36Preference::Preference(wxString const &name, bool value) 
    3737{ 
    3838        mPrefType  = PT_BOOL; 
     
    4242 
    4343 
    44 Preference::Preference(wxString name, wxUint32 value) 
     44Preference::Preference(wxString const &name, wxUint32 value) 
    4545{ 
    4646        mPrefType  = PT_UINT; 
     
    5050 
    5151 
    52 Preference::Preference(wxString name, wxInt32 value) 
     52Preference::Preference(wxString const &name, wxInt32 value) 
    5353{ 
    5454        mPrefType = PT_INT; 
     
    5858 
    5959 
    60 Preference::Preference(wxString name, double value) 
     60Preference::Preference(wxString const &name, double value) 
    6161{ 
    6262        mPrefType    = PT_DOUBLE; 
     
    6666 
    6767 
    68 Preference::Preference(wxString name, wxString const &value, bool isHidden) 
     68Preference::Preference(wxString const &name, wxString const &value, bool isHidden) 
    6969{ 
    7070        // Hidden strings are stored in the same way as 'normal' strings 
  • trunk/src/queue.cpp

    r485 r524  
    4747} 
    4848 
    49 bool Queue::LoadQueueFile(wxString const &filename, wxString clientName, wxString& localname) 
     49bool Queue::LoadQueueFile(wxString const &filename, wxString const &clientName, wxString& localname) 
    5050{ 
    5151        queueformat       queuebuffer, *bp;