Changeset 85452 in vbox
- Timestamp:
- Jul 24, 2020 9:12:40 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r82968 r85452 44 44 #include "CSystemProperties.h" 45 45 46 /* Other VBox includes: */ 47 #include <iprt/path.h> 46 48 47 49 UIWizardNewVDPageExpert::UIWizardNewVDPageExpert(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize) … … 211 213 { 212 214 QFileInfo fileInfo(m_pLocationEditor->text()); 213 if (fileInfo.completeSuffix() != m_strDefaultExtension) 214 { 215 QString strNewFilePath = QString("%1/%2.%3").arg(fileInfo.absoluteDir().absolutePath()).arg(fileInfo.fileName()).arg(m_strDefaultExtension); 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); 216 227 m_pLocationEditor->setText(strNewFilePath); 217 228 }
Note:
See TracChangeset
for help on using the changeset viewer.