Commit 4267c29e authored by David Faure's avatar David Faure
Browse files

Port KAddressbook from ReadOnlyPart to Part.

This also fixes "RMB / Preview In" in konqueror, embedding KAddressbook
but not at all showing the .vcf file the user clicked on in the first
place.
parent 5db71adc
......@@ -69,6 +69,5 @@ Name[zh_CN]=KAddressBook
Name[zh_TW]=KAddressBook 通訊錄
Icon=kaddressbook
X-DocPath=kaddressbook/index.html
MimeType=text/directory;text/x-ldif;
X-KDE-ServiceTypes=KParts/ReadOnlyPart,Browser/View
X-KDE-ServiceTypes=KParts/Part
X-KDE-Library=kaddressbookpart
......@@ -25,7 +25,6 @@
#include "kaddressbook_debug.h"
#include <KLocalizedString>
#include <KPluginFactory>
#include <KParts/StatusBarExtension>
#include <QAction>
#include <KActionCollection>
#include <QIcon>
......@@ -36,7 +35,7 @@ K_PLUGIN_FACTORY(KAddressBookFactory, registerPlugin<KAddressBookPart>();
)
KAddressBookPart::KAddressBookPart(QWidget *parentWidget, QObject *parent, const QVariantList &)
: KParts::ReadOnlyPart(parent)
: KParts::Part(parent)
{
setComponentName(QStringLiteral("kaddressbook"), i18n("KAddressBook"));
KAddressBookMigrateApplication migrate;
......@@ -82,14 +81,9 @@ KAddressBookPart::~KAddressBookPart()
{
}
bool KAddressBookPart::openFile()
{
return false;
}
void KAddressBookPart::guiActivateEvent(KParts::GUIActivateEvent *e)
{
KParts::ReadOnlyPart::guiActivateEvent(e);
KParts::Part::guiActivateEvent(e);
mMainWidget->initializePluginActions();
}
......
......@@ -27,7 +27,7 @@
class MainWidget;
class KAddressBookPart : public KParts::ReadOnlyPart
class KAddressBookPart : public KParts::Part
{
Q_OBJECT
......@@ -41,7 +41,6 @@ public Q_SLOTS:
void updateQuickSearchText();
protected:
bool openFile() override;
void guiActivateEvent(KParts::GUIActivateEvent *) override;
void initAction();
private:
......
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