Commit 4c8546dc authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Ark KPart: restore mismatch of componentname and plugin id

By history Ark stores the xmlgui ui.rc file for the part in the same
subdir as the program, ark/. And set the comppnent name as needed to "ark"
via the KAboutData instance for the KPart.
At the same time the plugin id has been "arkpart", as derived from the
library name due to the absence of an explicit X-KDE-PluginInfo-Name entry
in the desktop file.

With the change to the KPluginMetaData API of KParts/KPluginLoader and
the new entries added to the desltop file based on the KAboutData values,
that mismatch was resolved by accident. With "ark" now also the plugin id,
the look up the kpart by the program though now fails, due to the condition
    metaData.pluginId() == QLatin1String("arkpart")

BUG: 429616
parent 97334d5d
......@@ -153,7 +153,7 @@ X-KDE-Library=arkpart
Type=Service
MimeType=@SUPPORTED_ARK_MIMETYPES@
X-KDE-PluginInfo-Name=ark
X-KDE-PluginInfo-Name=arkpart
X-KDE-PluginInfo-Version=@ARK_VERSION@
X-KDE-PluginInfo-License=GPL v2+
X-KDE-PluginInfo-Website=https://utils.kde.org/projects/ark
......@@ -239,6 +239,16 @@ Part::~Part()
m_extractAction->menu()->deleteLater();
}
QString Part::componentName() const
{
// also the part ui.rc file is in the program folder
// TODO: change the component name to "arkpart" by removing this method and
// adapting the folder where the file is placed.
// Needs a way to also move any potential custom user ui.rc files
// from ark/ark_part.rc to arkpart/ark_part.rc
return QStringLiteral("ark");
}
void Part::slotCommentChanged()
{
if (!m_model->archive() || m_commentView->toPlainText().isEmpty()) {
......
......@@ -78,6 +78,11 @@ public:
QList<Kerfuffle::SettingsPage*> settingsPages(QWidget *parent) const override;
bool eventFilter(QObject *target, QEvent *event) override;
/**
* Return custom compnentName for KXMLGUIClient, as by history not the plugin id is used
*/
QString componentName() const override;
/**
* Validate the localFilePath() associated to this part.
* If the file is not valid, an error message is displayed to the user.
......
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