Changeset 33438 in vbox
- Timestamp:
- Oct 25, 2010 5:45:24 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 67028
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.cpp
r33421 r33438 552 552 } 553 553 } 554 CVFSExplorer explorer = appliance->CreateVFSExplorer(uri( ));554 CVFSExplorer explorer = appliance->CreateVFSExplorer(uri(false /* fWithFile */)); 555 555 CProgress progress = explorer.Update(); 556 556 bool fResult = explorer.isOk(); … … 631 631 } 632 632 633 QString UIExportApplianceWzdPage4::uri( ) const633 QString UIExportApplianceWzdPage4::uri(bool fWithFile) const 634 634 { 635 635 StorageType type = field("storageType").value<StorageType>(); 636 637 QString path = field("path").toString(); 638 if (!fWithFile) 639 { 640 QFileInfo fi(path); 641 path = fi.path(); 642 } 636 643 switch (type) 637 644 { 638 645 case Filesystem: 639 646 { 640 return field("path").toString();647 return path; 641 648 } 642 649 case SunCloud: … … 649 656 if (!field("username").toString().isEmpty() || !field("username").toString().isEmpty()) 650 657 uri = QString("%1@").arg(uri); 651 uri = QString("%1%2/%3/%4").arg(uri).arg("object.storage.network.com").arg(field("bucket").toString()).arg( field("path").toString());658 uri = QString("%1%2/%3/%4").arg(uri).arg("object.storage.network.com").arg(field("bucket").toString()).arg(path); 652 659 return uri; 653 660 } … … 661 668 if (!field("username").toString().isEmpty() || !field("password").toString().isEmpty()) 662 669 uri = QString("%1@").arg(uri); 663 uri = QString("%1%2/%3/%4").arg(uri).arg(field("hostname").toString()).arg(field("bucket").toString()).arg( field("path").toString());670 uri = QString("%1%2/%3/%4").arg(uri).arg(field("hostname").toString()).arg(field("bucket").toString()).arg(path); 664 671 return uri; 665 672 } -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/exportappliance/UIExportApplianceWzd.h
r33421 r33438 188 188 bool exportAppliance(); 189 189 bool exportVMs(CAppliance &appliance); 190 QString uri( ) const;190 QString uri(bool fWithFile = true) const; 191 191 192 192 ExportAppliancePointer applianceWidget() const { return m_pApplianceWidget; } -
trunk/src/VBox/Main/VFSExplorerImpl.cpp
r32718 r33438 293 293 try 294 294 { 295 pszPath = RTStrDup(m->strPath.c_str()); 296 RTPathStripFilename(pszPath); 297 int vrc = RTDirOpen(&pDir, pszPath); 295 int vrc = RTDirOpen(&pDir, m->strPath.c_str()); 298 296 if (RT_FAILURE(vrc)) 299 297 throw setError(VBOX_E_FILE_ERROR, tr ("Can't open directory '%s' (%Rrc)"), pszPath, vrc); … … 570 568 { 571 569 CheckComArgStrNotEmptyOrNull(aDir); 572 CheckComArgOutPointerValid(aProgress); 573 574 return E_NOTIMPL; 570 571 AutoCaller autoCaller(this); 572 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 573 574 { 575 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 576 m->strPath = aDir; 577 } 578 579 return Update(aProgress); 575 580 } 576 581 577 582 STDMETHODIMP VFSExplorer::CdUp(IProgress **aProgress) 578 583 { 579 CheckComArgOutPointerValid(aProgress); 580 581 return E_NOTIMPL; 584 AutoCaller autoCaller(this); 585 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 586 587 Utf8Str strUpPath; 588 { 589 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 590 /* Remove lowest dir entry in a platform neutral way. */ 591 char *pszNewPath = RTStrDup(m->strPath.c_str()); 592 RTPathStripTrailingSlash(pszNewPath); 593 RTPathStripFilename(pszNewPath); 594 strUpPath = pszNewPath; 595 RTStrFree(pszNewPath); 596 } 597 598 return Cd(Bstr(strUpPath).raw(), aProgress); 582 599 } 583 600 … … 626 643 std::list<BSTR> listExists; 627 644 628 std::list<VFSExplorer::Data::DirEntry>::const_iterator it;629 for (it = m->entryList.begin();630 it != m->entryList.end();631 ++it)632 {633 const VFSExplorer::Data::DirEntry &entry = (*it);634 for (size_t a=0; a < sfaNames.size(); ++a)635 {645 for (size_t a=0; a < sfaNames.size(); ++a) 646 { 647 std::list<VFSExplorer::Data::DirEntry>::const_iterator it; 648 for (it = m->entryList.begin(); 649 it != m->entryList.end(); 650 ++it) 651 { 652 const VFSExplorer::Data::DirEntry &entry = (*it); 636 653 if (entry.name == RTPathFilename(Utf8Str(sfaNames[a]).c_str())) 637 654 {
Note:
See TracChangeset
for help on using the changeset viewer.