VirtualBox

Changeset 85466 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 27, 2020 9:42:02 AM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139518
Message:

FE/Qt: bugref:9663. r139498 was not so well done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp

    r85452 r85466  
    4444#include "CSystemProperties.h"
    4545
    46 /* Other VBox includes: */
    47 #include <iprt/path.h>
    4846
    4947UIWizardNewVDPageExpert::UIWizardNewVDPageExpert(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize)
     
    213211    {
    214212        QFileInfo fileInfo(m_pLocationEditor->text());
    215         QString strSuffix = fileInfo.suffix();
    216         if (strSuffix != m_strDefaultExtension)
    217         {
    218             /* QFileInfo::baseName() removes completeSuffix() from the fileName(), which is everthing coming after the 'first'
    219                dot. I want to allow disk names with dots in it. So I remove the string from fileName()
    220                that comes after the 'last' dot: */
    221             QByteArray strFileName = fileInfo.fileName().toUtf8();
    222             RTPathStripSuffix(strFileName.data());
    223             QString strNewFilePath = QString("%1/%2.%3")
    224                 .arg(fileInfo.absoluteDir().absolutePath())
    225                 .arg(QString(strFileName))
    226                 .arg(m_strDefaultExtension);
    227             m_pLocationEditor->setText(strNewFilePath);
     213        if (fileInfo.suffix() != m_strDefaultExtension)
     214        {
     215            QFileInfo newFileInfo(fileInfo.absolutePath(), QString("%1.%2").arg(fileInfo.completeBaseName()).arg(m_strDefaultExtension));
     216            m_pLocationEditor->setText(newFileInfo.absoluteFilePath());
    228217        }
    229218    }
Note: See TracChangeset for help on using the changeset viewer.

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