VirtualBox

Changeset 875 in vbox for trunk/src


Ignore:
Timestamp:
Feb 13, 2007 2:48:34 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Improved: .VDI eteinsion was not added to a name of the VDI file if it contained a dot; now the .VDI extension is always added unless it is already there. In response to http://www.virtualbox.org/ticket/24.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxNewHDWzd.ui.h

    r382 r875  
    273273{
    274274    QString name = QDir::convertSeparators (leName->text());
    275     if (QFileInfo (name).extension().isEmpty())
     275   
     276    /* remove all trailing dots to avoid multiple dots before .vdi */
     277    int len;
     278    while (len = name.length(), len > 0 && name [len - 1] == '.')
     279        name.truncate (len - 1);
     280   
     281    QString ext = QFileInfo (name).extension();
     282    /* compare against the proper case */
     283#if defined (Q_OS_LINUX)
     284#elif defined (Q_OS_WIN) || defined (Q_OS_OS2)
     285    ext = ext.lower();
     286#else
     287    #error Port me!
     288#endif
     289
     290    if (ext != "vdi")
    276291        name += ".vdi";
     292
    277293    return name;
    278294}
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