Changeset 73218 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 18, 2018 4:19:08 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 123823
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/CloudUserProfileListImpl.cpp
r73216 r73218 149 149 HRESULT hrc = S_OK; 150 150 if (aSectionName.isEmpty()) 151 hrc = VERR_INVALID_PARAMETER; 151 hrc = VERR_INVALID_PARAMETER; /** @todo r=bird: You're mixing error codes... */ 152 152 else 153 153 mSections.insert(make_pair(aSectionName, section)); … … 408 408 if (FAILED(hrc)) 409 409 { 410 throw hrc; 410 throw hrc; /** @todo r=bird: WTF? Try return it! */ 411 411 } 412 412 LogRel(("Successfully parsed %d profiles\n", mpProfiles->getNumberOfSections())); … … 416 416 { 417 417 LogRel(("Empty path to config file\n")); 418 hrc = VERR_INVALID_PARAMETER; 418 hrc = VERR_INVALID_PARAMETER; /** @todo r=bird: You're mixing error codes... */ 419 419 } 420 420 … … 464 464 } 465 465 else 466 hrc = VERR_NOT_FOUND; 466 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 467 467 468 468 return hrc; … … 474 474 aProfilesNames = mpProfiles->getSectionsNames(); 475 475 if (aProfilesNames.empty()) 476 hrc = VERR_NOT_FOUND; 476 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 477 477 478 478 return hrc; … … 503 503 } 504 504 else 505 hrc = VERR_NOT_FOUND; 505 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 506 506 507 507 return hrc; … … 545 545 hrc = mpProfiles->updateSection(aProfileName, aProfile); 546 546 else 547 hrc = VERR_NOT_FOUND; 547 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 548 548 549 549 return hrc; … … 572 572 aProfile = reqProfile; 573 573 else 574 hrc = VERR_NOT_FOUND; 575 576 return hrc; 577 } 578 574 hrc = VERR_NOT_FOUND; /** @todo r=bird: You're mixing error codes... */ 575 576 return hrc; 577 } 578 -
trunk/src/VBox/Main/src-server/CloudUserProfileManagerImpl.cpp
r73204 r73218 128 128 if (SUCCEEDED(hrc)) 129 129 { 130 char szHomeDir[RTPATH_MAX]; 131 int vrc = RTPathUserHome(szHomeDir, sizeof(szHomeDir)); 130 char szOciConfigPath[RTPATH_MAX]; 131 int vrc = RTPathUserHome(szOciConfigPath, sizeof(szOciConfigPath)); 132 if (RT_SUCCESS(vrc)) 133 vrc = RTPathAppend(szOciConfigPath, sizeof(szOciConfigPath), ".oci" RTPATH_SLASH_STR "config"); 132 134 if (RT_SUCCESS(vrc)) 133 135 { 134 Utf8Str strConfigPath(szHomeDir); 135 strConfigPath.append(RTPATH_SLASH_STR) 136 .append(".oci") 137 .append(RTPATH_SLASH_STR) 138 .append("config"); 139 LogRel(("config = %s\n", strConfigPath.c_str())); 140 if (RTFileExists(strConfigPath.c_str())) 136 LogRel(("config = %s\n", szOciConfigPath)); 137 if (RTFileExists(szOciConfigPath)) 141 138 { 142 hrc = ptrOCIUserProfileList->readProfiles(s trConfigPath);139 hrc = ptrOCIUserProfileList->readProfiles(szOciConfigPath); 143 140 if (SUCCEEDED(hrc)) 144 { 145 LogRel(("Reading profiles from %s has been done\n", strConfigPath.c_str())); 146 } 141 LogRel(("Reading profiles from %s has been done\n", szOciConfigPath)); 147 142 else 148 { 149 LogRel(("Reading profiles from %s hasn't been done\n", strConfigPath.c_str())); 150 } 143 LogRel(("Reading profiles from %s hasn't been done\n", szOciConfigPath)); 151 144 152 145 ptrCloudUserProfileList = ptrOCIUserProfileList; … … 154 147 } 155 148 else 156 { 157 hrc = setError(VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"), 158 strConfigPath.c_str()); 159 } 149 /** @todo r=bird: You are constantly mixing up status codes. 150 * VERR_FILE_NOT_FOUND, VERR_INVALID_PARAMETER and VERR_NOT_FOUND are all VBox 151 * status codes. They don't work for HRESULT types, because that's for 152 * COM/XPCOM status codes. Here you should use setErrorBoth or setErrorVrc. */ 153 hrc = setError(VERR_FILE_NOT_FOUND, tr("Could not locate the config file '%s'"), szOciConfigPath); 160 154 } 161 155 else
Note:
See TracChangeset
for help on using the changeset viewer.