summaryrefslogtreecommitdiff
path: root/src/VBox/HostServices/DragAndDrop/dndmanager.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2014-03-26 19:21:20 +0000
committer <>2014-05-08 15:03:54 +0000
commitfb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch)
treec2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/HostServices/DragAndDrop/dndmanager.cpp
parent58ed4748338f9466599adfc8a9171280ed99e23f (diff)
downloadVirtualBox-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/dndmanager.cpp')
-rw-r--r--src/VBox/HostServices/DragAndDrop/dndmanager.cpp13
1 files changed, 8 insertions, 5 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));