Commit fd038bcc authored by Mark Nauwelaerts's avatar Mark Nauwelaerts
Browse files

quickopen: use common base dir as project base to ensure successful strip of base

parent f3673010
...@@ -79,16 +79,17 @@ void KateQuickOpenModel::refresh(KateMainWindow *mainWindow) ...@@ -79,16 +79,17 @@ void KateQuickOpenModel::refresh(KateMainWindow *mainWindow)
const QStringList projectDocs = projectView const QStringList projectDocs = projectView
? (m_listMode == CurrentProject ? projectView->property("projectFiles") : projectView->property("allProjectsFiles")).toStringList() ? (m_listMode == CurrentProject ? projectView->property("projectFiles") : projectView->property("allProjectsFiles")).toStringList()
: QStringList(); : QStringList();
const QString projectBase = [this, projectView]() -> QString { const QString projectBase = [projectView]() -> QString {
if (!projectView) { if (!projectView) {
return QString(); return QString();
} }
QString ret; QString ret;
if (m_listMode == CurrentProject) { // open files are always included in the listing, even if list mode == CurrentProject
ret = projectView->property("projectBaseDir").toString(); // those open files may belong to another project than the current one
} else { // so we should always consistently strip the common base
ret = projectView->property("allProjectsCommonBaseDir").toString(); // otherwise it will be confusing and the opened files of anther project
} // end up with an unstripped complete file path
ret = projectView->property("allProjectsCommonBaseDir").toString();
if (!ret.endsWith(QLatin1Char('/'))) { if (!ret.endsWith(QLatin1Char('/'))) {
ret.append(QLatin1Char('/')); ret.append(QLatin1Char('/'));
} }
......
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