VirtualBox

Changeset 2239 in vbox for trunk


Ignore:
Timestamp:
Apr 19, 2007 4:30:43 PM (18 years ago)
Author:
vboxsync
Message:

Main: Use RTPathCompare() instead of #ifdef's.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r2148 r2239  
    31443144    }
    31453145
    3146     // then iterate and find by name
     3146    /* then iterate and find by name */
    31473147    bool found = false;
    31483148    if (aFilePathFull)
     
    31573157                continue;
    31583158
    3159             found =
    3160 #if defined (__LINUX__)
    3161                  hd->asVDI()->filePathFull() == aFilePathFull;
    3162 #else
    3163                  !hd->asVDI()->filePathFull().compareIgnoreCase (aFilePathFull);
    3164 #endif
     3159            found = RTPathCompare (Utf8Str (aFilePathFull),
     3160                                   Utf8Str (hd->asVDI()->filePathFull())) == 0;
    31653161            if (found && aImage)
    31663162                *aImage = hd->asVDI();
     
    32223218            found = (aId && (*it)->id() == *aId) ||
    32233219                    (aFilePathFull &&
    3224 #if defined (__LINUX__)
    3225                         (*it)->filePathFull() == aFilePathFull);
    3226 #else
    3227                         !(*it)->filePathFull().compareIgnoreCase (aFilePathFull));
    3228 #endif
     3220                     RTPathCompare (Utf8Str (aFilePathFull),
     3221                                    Utf8Str ((*it)->filePathFull())) == 0);
    32293222            if (found && aImage)
    32303223                *aImage = *it;
     
    32863279            found = (aId && (*it)->id() == *aId) ||
    32873280                    (aFilePathFull &&
    3288 #if defined (__LINUX__)
    3289                         (*it)->filePathFull() == aFilePathFull);
    3290 #else
    3291                         !(*it)->filePathFull().compareIgnoreCase (aFilePathFull));
    3292 #endif
     3281                     RTPathCompare (Utf8Str (aFilePathFull),
     3282                                    Utf8Str ((*it)->filePathFull())) == 0);
    32933283            if (found && aImage)
    32943284                *aImage = *it;
     
    33733363        if (!aHardDisk)
    33743364        {
    3375             rc = findVirtualDiskImage (aId, aFilePathFull, false /* aSetError */);
     3365            rc = findHardDisk (aId, aFilePathFull, false /* aSetError */);
    33763366            found = SUCCEEDED (rc);
    33773367            if (found)
     
    33933383    if (found)
    33943384    {
    3395         if (aId)
     3385        if (aId && !aFilePathFull)
    33963386            rc = setError (E_INVALIDARG,
    33973387                tr ("A disk image with UUID {%Vuuid} is already registered"),
    33983388                aId->raw());
    3399         else if (aFilePathFull)
     3389        else if (aFilePathFull && !aId)
    34003390            rc = setError (E_INVALIDARG,
    34013391                tr ("A disk image with file path '%ls' is already registered"),
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