Changeset 59381 in vbox
- Timestamp:
- Jan 18, 2016 5:17:24 PM (9 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
-
Frontends/VirtualBox/src/globals/VBoxGlobal.cpp (modified) (1 diff)
-
Main/idl/VirtualBox.xidl (modified) (2 diffs)
-
Main/include/HostUSBDeviceImpl.h (modified) (1 diff)
-
Main/include/RemoteUSBDeviceImpl.h (modified) (1 diff)
-
Main/include/USBDeviceImpl.h (modified) (1 diff)
-
Main/src-client/RemoteUSBDeviceImpl.cpp (modified) (1 diff)
-
Main/src-client/USBDeviceImpl.cpp (modified) (1 diff)
-
Main/src-server/HostUSBDeviceImpl.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r59032 r59381 884 884 else 885 885 { 886 QString m = aDevice.GetManufacturer().trimmed(); 887 QString p = aDevice.GetProduct().trimmed(); 886 QVector<QString> devInfoVector = aDevice.GetDeviceInfo(); 887 QString m; 888 QString p; 889 890 if (devInfoVector.size() >= 1) 891 m = devInfoVector[0].trimmed(); 892 if (devInfoVector.size() >= 2) 893 p = devInfoVector[1].trimmed(); 888 894 889 895 if (m.isEmpty() && p.isEmpty()) -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r59117 r59381 18021 18021 uuid="5915d179-83c7-4f2b-a323-9a97f46f4e29" 18022 18022 wsmap="managed" 18023 reservedAttributes=" 3"18023 reservedAttributes="2" 18024 18024 > 18025 18025 <desc> … … 18108 18108 <desc> 18109 18109 The backend which will be used to communicate with this device. 18110 </desc> 18111 </attribute> 18112 18113 <attribute name="deviceInfo" type="wstring" readonly="yes" safearray="yes"> 18114 <desc> 18115 Array of device attributes as single strings. 18116 18117 So far the following are used: 18118 0: The manufacturer string, if the device doesn't expose the ID one is taken 18119 from an internal database or an empty string if none is found. 18120 1: The product string, if the device doesn't expose the ID one is taken 18121 from an internal database or an empty string if none is found. 18110 18122 </desc> 18111 18123 </attribute> -
trunk/src/VBox/Main/include/HostUSBDeviceImpl.h
r59117 r59381 261 261 HRESULT getSpeed(USBConnectionSpeed_T *aSpeed); 262 262 HRESULT getRemote(BOOL *aRemote); 263 HRESULT getName(com::Utf8Str &aName);264 263 HRESULT getState(USBDeviceState_T *aState); 265 264 HRESULT getBackend(com::Utf8Str &aBackend); 265 HRESULT getDeviceInfo(std::vector<com::Utf8Str> &aInfo); 266 266 267 267 -
trunk/src/VBox/Main/include/RemoteUSBDeviceImpl.h
r59117 r59381 80 80 HRESULT getRemote(BOOL *aRemote); 81 81 HRESULT getBackend(com::Utf8Str &aBackend); 82 HRESULT getDeviceInfo(std::vector<com::Utf8Str> &aInfo); 82 83 83 84 // wrapped IHostUSBDevice properties -
trunk/src/VBox/Main/include/USBDeviceImpl.h
r59117 r59381 60 60 HRESULT getRemote(BOOL *aRemote); 61 61 HRESULT getBackend(com::Utf8Str &aBackend); 62 HRESULT getDeviceInfo(std::vector<com::Utf8Str> &aInfo); 62 63 63 64 struct Data -
trunk/src/VBox/Main/src-client/RemoteUSBDeviceImpl.cpp
r59122 r59381 279 279 } 280 280 281 HRESULT RemoteUSBDevice::getDeviceInfo(std::vector<com::Utf8Str> &aInfo) 282 { 283 /* this is const, no need to lock */ 284 aInfo.resize(2); 285 aInfo[0] = mData.manufacturer; 286 aInfo[1] = mData.product; 287 288 return S_OK; 289 } 290 281 291 // IHostUSBDevice properties 282 292 //////////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/src-client/USBDeviceImpl.cpp
r59117 r59381 325 325 } 326 326 327 HRESULT OUSBDevice::getDeviceInfo(std::vector<com::Utf8Str> &aInfo) 328 { 329 /* this is const, no need to lock */ 330 aInfo.resize(2); 331 aInfo[0] = mData.manufacturer; 332 aInfo[1] = mData.product; 333 334 return S_OK; 335 } 336 327 337 // private methods 328 338 ///////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp
r59119 r59381 168 168 169 169 aManufacturer = mUsb->pszManufacturer; 170 if (mUsb->pszManufacturer == NULL || mUsb->pszManufacturer[0] == 0)171 aManufacturer = USBIdDatabase::findVendor(mUsb->idVendor);172 170 return S_OK; 173 171 } … … 179 177 180 178 aProduct = mUsb->pszProduct; 181 if (mUsb->pszProduct == NULL || mUsb->pszProduct[0] == 0)182 aProduct = USBIdDatabase::findProduct(mUsb->idVendor, mUsb->idProduct);183 179 return S_OK; 184 180 } … … 316 312 } 317 313 314 315 HRESULT HostUSBDevice::getDeviceInfo(std::vector<com::Utf8Str> &aInfo) 316 { 317 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 318 319 com::Utf8Str strManufacturer; 320 com::Utf8Str strProduct; 321 322 if (mUsb->pszManufacturer && *mUsb->pszManufacturer) 323 strManufacturer = mUsb->pszManufacturer; 324 else 325 strManufacturer = USBIdDatabase::findVendor(mUsb->idVendor); 326 327 if (mUsb->pszProduct && *mUsb->pszProduct) 328 strProduct = mUsb->pszProduct; 329 else 330 strProduct = USBIdDatabase::findProduct(mUsb->idVendor, mUsb->idProduct); 331 332 aInfo.resize(2); 333 aInfo[0] = strManufacturer; 334 aInfo[1] = strProduct; 335 336 return S_OK; 337 } 338 318 339 // public methods only for internal purposes 319 340 //////////////////////////////////////////////////////////////////////////////// … … 335 356 if (haveManufacturer && haveProduct) 336 357 name = Utf8StrFmt("%s %s", mUsb->pszManufacturer, mUsb->pszProduct); 337 else if (haveManufacturer)338 name = mUsb->pszManufacturer;339 else if (haveProduct)340 name = mUsb->pszProduct;341 358 else 342 359 { 343 360 Utf8Str strProduct; 344 361 Utf8Str strVendor = USBIdDatabase::findVendorAndProduct(mUsb->idVendor, mUsb->idProduct, &strProduct); 345 if (strVendor.isNotEmpty() && strProduct.isNotEmpty()) 346 name = Utf8StrFmt("%s %s", strVendor.c_str(), strProduct.c_str()); 362 if ( (strVendor.isNotEmpty() || haveManufacturer) 363 && (strProduct.isNotEmpty() || haveProduct)) 364 name = Utf8StrFmt("%s %s", haveManufacturer ? mUsb->pszManufacturer 365 : strVendor.c_str(), 366 haveProduct ? mUsb->pszProduct 367 : strProduct.c_str()); 347 368 else 348 369 {
Note:
See TracChangeset
for help on using the changeset viewer.

