diff --git a/src/filewidgets/knewfilemenu.cpp b/src/filewidgets/knewfilemenu.cpp --- a/src/filewidgets/knewfilemenu.cpp +++ b/src/filewidgets/knewfilemenu.cpp @@ -460,10 +460,12 @@ void KNewFileMenuPrivate::executeRealFileOrDir(const KNewFileMenuSingleton::Entry &entry) { // The template is not a desktop file - // Show the small dialog for getting the destination filename - QString text = entry.text; - text.remove(QStringLiteral("...")); // the ... is fine for the menu item but not for the default filename - text = text.trimmed(); // In some languages, there is a space in front of "...", see bug 268895 + // Prompt the user to set the destination filename, and initially display + // the filename from the template including the extenstion, e.g. "TextFile.txt", + // "HTMLFile.html" in the line edit + QString text = entry.templatePath; + text = text.mid(text.lastIndexOf(QLatin1Char('/')) + 1); + m_copyData.m_src = entry.templatePath; const QUrl directory = mostLocalUrl(m_popupFiles.first());