Changeset 56506 in vbox
- Timestamp:
- Jun 18, 2015 11:37:04 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
r56215 r56506 438 438 "Please make sure that all selected elements can be accessed and that your guest user has " 439 439 "the appropriate rights.")); 440 break; 441 442 case VERR_TIMEOUT: 443 strError += Utf8StrFmt(tr("The guest was not able to fetch the drag and drop data within time.")); 440 444 break; 441 445 … … 848 852 { 849 853 rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp); 850 if (RT_FAILURE(rc)) 851 { 852 if (rc == VERR_CANCELLED) 853 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS); 854 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */ 855 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc, 856 GuestDnDSource::i_hostErrorToString(rc)); 857 } 858 else 854 if (RT_SUCCESS(rc)) 859 855 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS); 860 856 } … … 871 867 #undef UNREGISTER_CALLBACK 872 868 873 if (rc == VERR_CANCELLED) 874 { 875 int rc2 = sendCancel(); 876 AssertRC(rc2); 869 if (RT_FAILURE(rc)) 870 { 871 if (rc == VERR_CANCELLED) 872 { 873 int rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS); 874 AssertRC(rc2); 875 876 rc2 = sendCancel(); 877 AssertRC(rc2); 878 } 879 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */ 880 { 881 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, 882 rc, GuestDnDSource::i_hostErrorToString(rc)); 883 } 877 884 } 878 885 … … 939 946 if (RT_SUCCESS(rc)) 940 947 { 948 LogFlowFunc(("Waiting ...\n")); 949 941 950 rc = waitForEvent(msTimeout, pCtx->mCallback, pCtx->mpResp); 942 if (RT_FAILURE(rc)) 943 { 944 if (rc == VERR_CANCELLED) 945 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS); 946 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */ 947 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, rc, 948 GuestDnDSource::i_hostErrorToString(rc)); 949 } 950 else 951 if (RT_SUCCESS(rc)) 951 952 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_COMPLETE, VINF_SUCCESS); 953 954 LogFlowFunc(("Waiting ended with rc=%Rrc\n", rc)); 952 955 } 953 956 … … 969 972 int rc2; 970 973 971 if (rc == VERR_CANCELLED) 972 { 973 rc2 = sendCancel(); 974 AssertRC(rc2); 974 if (RT_FAILURE(rc)) 975 { 976 if (rc == VERR_CANCELLED) 977 { 978 rc2 = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_CANCELLED, VINF_SUCCESS); 979 AssertRC(rc2); 980 981 rc2 = sendCancel(); 982 AssertRC(rc2); 983 } 984 else if (rc != VERR_GSTDND_GUEST_ERROR) /* Guest-side error are already handled in the callback. */ 985 { 986 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, 987 rc, GuestDnDSource::i_hostErrorToString(rc)); 988 } 975 989 } 976 990 … … 1136 1150 1137 1151 pCtx->mpResp->reset(); 1152 1138 1153 if (RT_SUCCESS(pCBData->rc)) 1139 1154 pCBData->rc = VERR_GENERAL_FAILURE; /* Make sure some error is set. */ 1140 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc); 1155 1156 rc = pCtx->mpResp->setProgress(100, DragAndDropSvc::DND_PROGRESS_ERROR, pCBData->rc, 1157 GuestDnDSource::i_guestErrorToString(pCBData->rc)); 1141 1158 if (RT_SUCCESS(rc)) 1142 rcCallback = pCBData->rc;1159 rcCallback = VERR_GSTDND_GUEST_ERROR; 1143 1160 break; 1144 1161 }
Note:
See TracChangeset
for help on using the changeset viewer.

