diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
|---|---|---|
| committer | <> | 2014-05-08 15:03:54 +0000 |
| commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
| tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/HostServices/DragAndDrop | |
| parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
| download | VirtualBox-master.tar.gz | |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/HostServices/DragAndDrop')
| -rw-r--r-- | src/VBox/HostServices/DragAndDrop/dndmanager.cpp | 13 | ||||
| -rw-r--r-- | src/VBox/HostServices/DragAndDrop/service.cpp | 8 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp index 8512ca4f..5766a8e9 100644 --- a/src/VBox/HostServices/DragAndDrop/dndmanager.cpp +++ b/src/VBox/HostServices/DragAndDrop/dndmanager.cpp @@ -513,10 +513,13 @@ int DnDHGSendDataMessage::progressCallback(size_t cbDone, void *pvUser) pSelf->m_cbTransfered += cbDone; /* Advance progress info */ - if (pSelf->m_pfnProgressCallback) - return pSelf->m_pfnProgressCallback(100.0 / pSelf->m_cbAll * pSelf->m_cbTransfered, DragAndDropSvc::DND_PROGRESS_RUNNING, pSelf->m_pvProgressUser); - else - return VINF_SUCCESS; + int rc = VINF_SUCCESS; + if ( pSelf->m_pfnProgressCallback + && pSelf->m_cbAll) + rc = pSelf->m_pfnProgressCallback((uint64_t)pSelf->m_cbTransfered * 100 / pSelf->m_cbAll, + DragAndDropSvc::DND_PROGRESS_RUNNING, pSelf->m_pvProgressUser); + + return rc; } /****************************************************************************** @@ -739,7 +742,7 @@ int DnDManager::nextMessage(uint32_t uMsg, uint32_t cParms, VBOXHGCMSVCPARM paPa clear(); /* Create a new cancel message to inform the guest. */ m_pCurMsg = new DnDHGCancelMessage(); - m_pfnProgressCallback(100.0, DragAndDropSvc::DND_PROGRESS_CANCELLED, m_pvProgressUser); + m_pfnProgressCallback(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, m_pvProgressUser); } DO(("next msg: %d %d %Rrc\n", uMsg, cParms, rc)); diff --git a/src/VBox/HostServices/DragAndDrop/service.cpp b/src/VBox/HostServices/DragAndDrop/service.cpp index 1bb87451..54c50256 100644 --- a/src/VBox/HostServices/DragAndDrop/service.cpp +++ b/src/VBox/HostServices/DragAndDrop/service.cpp @@ -138,15 +138,17 @@ int DragAndDropService::clientConnect(uint32_t u32ClientID, void *pvClient) int DragAndDropService::clientDisconnect(uint32_t u32ClientID, void *pvClient) { /* Remove all waiters with this clientId. */ - while (!m_clientQueue.isEmpty()) + for (size_t i = 0; i < m_clientQueue.size(); ) { - HGCM::Client *pClient = m_clientQueue.first(); + HGCM::Client *pClient = m_clientQueue.at(i); if (pClient->clientId() == u32ClientID) { m_pHelpers->pfnCallComplete(pClient->handle(), VERR_INTERRUPTED); - m_clientQueue.removeFirst(); + m_clientQueue.removeAt(i); delete pClient; } + else + i++; } return VINF_SUCCESS; |
