VirtualBox

Changeset 59582 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Feb 4, 2016 3:01:22 PM (9 years ago)
Author:
vboxsync
Message:

ApplianceImplImport.cpp: Simplifications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp

    r59577 r59582  
    20762076    else
    20772077    {
    2078         bool fGzipUsed = !(di.strCompression.compare("gzip",Utf8Str::CaseInsensitive));
     2078        bool fGzipUsed = di.strCompression.compare("gzip",Utf8Str::CaseInsensitive) == 0;
    20792079        /* check read file to GZIP compression */
    20802080        try
     
    21352135            bool chExt = m->optListImport.contains(ImportOptions_ImportToVDI);
    21362136
    2137             char *pszSuff = NULL;
    2138 
    2139             if ((pszSuff = RTPathSuffix(strTargetPath->c_str()))!=NULL)
     2137            char *pszSuff = RTPathSuffix(strTargetPath->c_str());
     2138            if (pszSuff != NULL)
    21402139            {
    21412140                /*
     
    21832182                if (FAILED(rc))
    21842183                    throw rc;
    2185                 else
    2186                 {
    2187                     for (ULONG j = 0; j < mediumFormatCap.size(); j++)
    2188                         lCabs |= mediumFormatCap[j];
    2189                 }
    2190 
    2191                 if (!(   ((lCabs & MediumFormatCapabilities_CreateFixed) == MediumFormatCapabilities_CreateFixed)
    2192                       || ((lCabs & MediumFormatCapabilities_CreateDynamic) == MediumFormatCapabilities_CreateDynamic)))
     2184
     2185                for (ULONG j = 0; j < mediumFormatCap.size(); j++)
     2186                    lCabs |= mediumFormatCap[j];
     2187
     2188                if (   !(lCabs & MediumFormatCapabilities_CreateFixed)
     2189                    && !(lCabs & MediumFormatCapabilities_CreateDynamic) )
    21932190                    throw setError(VBOX_E_NOT_SUPPORTED,
    21942191                                   tr("Could not find a valid medium format for the target disk '%s'"),
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette