File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -537,11 +537,15 @@ void MainWidget::onWavPathChanged(const QString &wavPath) const {
537537 }
538538}
539539
540+ static QString replaceFileExtension (const QString &filePath, const QString &newExt) {
541+ const QFileInfo info (filePath);
542+ return info.absolutePath () + QDir::separator () + info.completeBaseName () + " ." + newExt;
543+ }
544+
540545void MainWidget::generateMidiOutputPath (const QString &wavPath) const {
541546 const QFileInfo fileInfo (wavPath);
542- const QString baseName = fileInfo.baseName ();
543547 const QString dir = fileInfo.absolutePath ();
544- const QString midiPath = dir + " / " + baseName + " . mid" ;
548+ const QString midiPath = replaceFileExtension (wavPath, " mid" ) ;
545549 m_outputMidiLineEdit->setText (midiPath);
546550 m_settings->setValue (" MainWidget/outMidiPath" , midiPath);
547551}
You can’t perform that action at this time.
0 commit comments