Index: kdevplatform/shell/openprojectdialog.cpp =================================================================== --- kdevplatform/shell/openprojectdialog.cpp +++ kdevplatform/shell/openprojectdialog.cpp @@ -87,7 +87,13 @@ delete helpButton; } - const bool useKdeFileDialog = qEnvironmentVariableIsSet("KDE_FULL_SESSION"); +#ifndef KDEV_USE_NATIVE_DIALOGS + // user selected KDE file dialogs via the CMake option + const bool useKdeFileDialog = true; +#else + // user selected native file dialogs via the CMake option + const bool useKdeFileDialog = false; +#endif QStringList filters, allEntry; QString filterFormat = useKdeFileDialog ? QStringLiteral("%1|%2 (%1)") @@ -304,7 +310,18 @@ void OpenProjectDialog::validateProjectName( const QString& name ) { - m_projectName = name; + if (name != m_projectName) { + m_projectName = name; + QUrl url(m_url.adjusted(QUrl::StripTrailingSlash | QUrl::RemoveFilename)); + qWarning() << Q_FUNC_INFO << m_url << "->" << url; + // construct a version of the project name that's safe for use as a filename: + // TODO: do an additional replace of QDir::separator() with "@"? + QString safeName = m_projectName.replace(QRegExp("[\\\\/]"), QStringLiteral("@")); + url.setPath(url.path() + '/' + safeName + '.' + ShellExtension::getInstance()->projectFileExtension()); + qWarning() << "\t" << url; +// m_urlIsDirectory = false; +// m_url.setPath(url.path()); + } validateProjectInfo(); }