Commit 4cae287c authored by Christoph Cullmann's avatar Christoph Cullmann 🐮
Browse files

do nothing if use canceled project open

BUG: 447194
parent 4eb9f8c7
Pipeline #111898 passed with stage
in 3 minutes and 15 seconds
......@@ -721,10 +721,14 @@ void KateProjectPluginView::slotUpdateStatus(bool visible)
void KateProjectPluginView::openDirectoryOrProject()
{
const QString dir = QFileDialog::getExistingDirectory(nullptr, i18n("Choose a directory"), QDir::currentPath());
auto project = m_plugin->projectForDir(dir, true);
// switch to this project
if (project) {
// get dir or do nothing
const QString dir = QFileDialog::getExistingDirectory(m_mainWindow->window(), i18n("Choose a directory"), QDir::currentPath());
if (dir.isEmpty()) {
return;
}
// switch to this project if there
if (auto project = m_plugin->projectForDir(dir, true)) {
int index = m_projectsCombo->findData(project->fileName());
if (index >= 0) {
m_projectsCombo->setCurrentIndex(index);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment