Commit 0fc1ed81 authored by Milian Wolff's avatar Milian Wolff
Browse files

fix regression: properly search for restructured katepart UI

while we are at it, look for share/$appname/katepartui.rc and dont
hardcode kdevelop in kdevplatform code

this should make it possible for Gluon, Quanta, etc to have custom
restructured katepart UIs

BUG: 277267
BUG: 277470
parent c1ba4210
......@@ -308,13 +308,12 @@ QWidget *TextDocument::createViewWidget(QWidget *parent)
connect(view, SIGNAL(contextMenuAboutToShow(KTextEditor::View*,QMenu*)), this, SLOT(populateContextMenu(KTextEditor::View*,QMenu*)));
//in KDE >= 4.4 we can use KXMLGuiClient::replaceXMLFile to provide
//katepart with out own restructured UI configuration
///FIXME: put katepartui replacement into kdevplatform
///FIXME: look in share/$appname/, i.e. support Quanta, Gluon, ...
QStringList katePartUIs = KGlobal::mainComponent().dirs()->findAllResources("data", "kdevplatform/katepartui.rc");
//katepart with our own restructured UI configuration
const QString uiFile = KGlobal::mainComponent().componentName() + "/katepartui.rc";
QStringList katePartUIs = KGlobal::mainComponent().dirs()->findAllResources("data", uiFile);
if (!katePartUIs.isEmpty()) {
const QString katePartUI = katePartUIs.last();
const QString katePartLocalUI = KStandardDirs::locateLocal("data", "kdevplatform/katepartui.rc");
const QString katePartLocalUI = KStandardDirs::locateLocal("data", uiFile);
if (!QFile::exists(katePartLocalUI)) {
// prevent warning:
// kdevelop/kdeui (kdelibs): No such XML file ".../.kde/share/apps/kdevelop/katepartui.rc"
Supports Markdown
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