Changeset 74953 in vbox for trunk/src/VBox/Main
- Timestamp:
- Oct 19, 2018 5:28:17 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp
r74734 r74953 2899 2899 2900 2900 const size_t cSources = aSources.size(); 2901 if ( aFilters.size() != cSources2902 || aFlags.size() != cSources)2901 if ( (aFilters.size() && aFilters.size() != cSources) 2902 || (aFlags.size() && aFlags.size() != cSources)) 2903 2903 { 2904 2904 return setError(E_INVALIDARG, tr("Parameter array sizes don't match to the number of sources specified")); … … 2929 2929 } 2930 2930 2931 Utf8Str strFlags; 2932 if (itFlags != aFlags.end()) 2933 { 2934 strFlags = *itFlags; 2935 ++itFlags; 2936 } 2937 2938 Utf8Str strFilter; 2939 if (itFilter != aFilters.end()) 2940 { 2941 strFilter = *itFilter; 2942 ++itFilter; 2943 } 2944 2931 2945 GuestSessionFsSourceSpec source; 2932 2946 source.strSource = *itSource; 2933 source.strFilter = *itFilter;2947 source.strFilter = strFilter; 2934 2948 source.enmType = objData.mType; 2935 2949 source.enmPathStyle = i_getPathStyle(); … … 2938 2952 if (source.enmType == FsObjType_Directory) 2939 2953 { 2940 hrc = GuestSession::i_directoryCopyFlagFromStr( *itFlags, &source.Type.Dir.fCopyFlags);2954 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 2941 2955 source.Type.Dir.fRecursive = true; /* Implicit. */ 2942 2956 } 2943 2957 else if (source.enmType == FsObjType_File) 2944 hrc = GuestSession::i_fileCopyFlagFromStr( *itFlags, &source.Type.File.fCopyFlags);2958 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 2945 2959 else 2946 2960 return setError(E_INVALIDARG, tr("Source type %d invalid / not supported"), source.enmType); … … 2951 2965 2952 2966 ++itSource; 2953 ++itFilter;2954 ++itFlags;2955 2967 } 2956 2968 … … 2966 2978 2967 2979 const size_t cSources = aSources.size(); 2968 if ( aFilters.size() != cSources2969 || aFlags.size() != cSources)2980 if ( (aFilters.size() && aFilters.size() != cSources) 2981 || (aFlags.size() && aFlags.size() != cSources)) 2970 2982 { 2971 2983 return setError(E_INVALIDARG, tr("Parameter array sizes don't match to the number of sources specified")); … … 2990 3002 } 2991 3003 3004 Utf8Str strFlags; 3005 if (itFlags != aFlags.end()) 3006 { 3007 strFlags = *itFlags; 3008 ++itFlags; 3009 } 3010 3011 Utf8Str strFilter; 3012 if (itFilter != aFilters.end()) 3013 { 3014 strFilter = *itFilter; 3015 ++itFilter; 3016 } 3017 2992 3018 GuestSessionFsSourceSpec source; 2993 3019 source.strSource = *itSource; 2994 source.strFilter = *itFilter;3020 source.strFilter = strFilter; 2995 3021 source.enmType = GuestBase::fileModeToFsObjType(objInfo.Attr.fMode); 2996 3022 source.enmPathStyle = i_getPathStyle(); … … 2999 3025 if (source.enmType == FsObjType_Directory) 3000 3026 { 3001 hrc = GuestSession::i_directoryCopyFlagFromStr( *itFlags, &source.Type.Dir.fCopyFlags);3027 hrc = GuestSession::i_directoryCopyFlagFromStr(strFlags, &source.Type.Dir.fCopyFlags); 3002 3028 source.Type.Dir.fFollowSymlinks = true; /** @todo Add a flag for that in DirectoryCopyFlag_T. Later. */ 3003 3029 source.Type.Dir.fRecursive = true; /* Implicit. */ 3004 3030 } 3005 3031 else if (source.enmType == FsObjType_File) 3006 hrc = GuestSession::i_fileCopyFlagFromStr( *itFlags, &source.Type.File.fCopyFlags);3032 hrc = GuestSession::i_fileCopyFlagFromStr(strFlags, &source.Type.File.fCopyFlags); 3007 3033 else 3008 3034 return setError(E_INVALIDARG, tr("Source type %d invalid / not supported"), source.enmType); … … 3013 3039 3014 3040 ++itSource; 3015 ++itFilter;3016 ++itFlags;3017 3041 } 3018 3042
Note:
See TracChangeset
for help on using the changeset viewer.