Changeset 85466 in vbox for trunk/src/VBox
- Timestamp:
- Jul 27, 2020 9:42:02 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139518
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/wizards/newvd/UIWizardNewVDPageExpert.cpp
r85452 r85466 44 44 #include "CSystemProperties.h" 45 45 46 /* Other VBox includes: */47 #include <iprt/path.h>48 46 49 47 UIWizardNewVDPageExpert::UIWizardNewVDPageExpert(const QString &strDefaultName, const QString &strDefaultPath, qulonglong uDefaultSize) … … 213 211 { 214 212 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()); 228 217 } 229 218 }
Note:
See TracChangeset
for help on using the changeset viewer.