[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: Looking for a maintainer for "Konq-Rellinks"
From:       Olivier Goffart <ogoffart () tiscalinet ! be>
Date:       2004-12-18 18:51:45
Message-ID: 200412181951.48691.ogoffart () tiscalinet ! be
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Le Dimanche 12 Décembre 2004 12:31, Shift a écrit :
> So we are looking for a new maintainer for this add-on. What you need to
> know is KDE development and W3C standards. So if somebody is interested,
> please contact-us.

Hi.
I discovered today that the plugin has been disabled from default compilation.

Rellinks plugin is a must have on some site that make the keyboard naviguation 
easier.

I don't think i'll have the time to maintain it completely. But at least i can 
help with some patches.

My first patch is attached. 
What i did is to remove the "feature" which bug everithing.

I removed the "configure" menu, and let KXMLGUI handle itself the toolbar.
That will fixes probably all bug open to this plugin.
+ make it possible to configure the toolbar.

Yes, it's not anymore possible to show that toolbar only when there are 
relations on the current document. But i don't think it's really important 
because that's even against ui guidelines to have toolbar that changes.

May i commit ?
May i enable again this plugin ?

["rellinks.diff" (text/x-diff)]

? rellinks.kdevses
Index: plugin_rellinks.cpp
===================================================================
RCS file: /home/kde/kdeaddons/konq-plugins/rellinks/plugin_rellinks.cpp,v
retrieving revision 1.36
diff -u -p -b -B -r1.36 plugin_rellinks.cpp
--- plugin_rellinks.cpp	5 Dec 2004 23:56:49 -0000	1.36
+++ plugin_rellinks.cpp	18 Dec 2004 18:37:47 -0000
@@ -41,15 +43,10 @@
 #include <kshortcut.h>
 #include <ktoolbar.h>
 #include <kurl.h>
-#include <ksimpleconfig.h>
 
 // local includes
 #include "plugin_rellinks.h"
 
-// -------- Constants -------------
-const char RelLinksPlugin::CONF_ALWAYS[] = "always";
-const char RelLinksPlugin::CONF_WHEN_NECESSARY[] = "when necessary";
-const char RelLinksPlugin::CONF_NEVER[] = "never";
 
 /** Rellinks factory */
 typedef KGenericFactory<RelLinksPlugin> RelLinksFactory;
@@ -66,34 +63,11 @@ K_EXPORT_COMPONENT_FACTORY( librellinksp
 RelLinksPlugin::RelLinksPlugin(QObject *parent, const char *name, const QStringList \
&)  : KParts::Plugin( parent, name ),
       m_part(0),
-      m_toolBar(0),
       m_viewVisible(false)
 {
 
     setInstance(RelLinksFactory::instance());
 
-    // -------- Configuration -------------
-    kconfig = new KSimpleConfig("rellinksrc");
-    listitem_conf.append(CONF_ALWAYS);
-    listitem_conf.append(CONF_WHEN_NECESSARY);
-    listitem_conf.append(CONF_NEVER);
-    kconfig->setGroup("General");
-    QString mode = kconfig->readEntry("mode", CONF_NEVER);
-    int mode_index = listitem_conf.findIndex(mode);
-
-    m_conf = new KSelectAction( i18n("Configure"), "configure",
-                                KShortcut(), actionCollection(), "rellinks_config" \
                );
-    QStringList listitem;
-    listitem.append(i18n("Always"));
-    listitem.append(i18n("When Necessary"));
-    listitem.append(i18n("Never"));
-    m_conf->setItems(listitem);
-
-    connect(m_conf->popupMenu(), SIGNAL( activated( int ) ), this,
-            SLOT( changeConf( int ) ) );
-
-    m_conf->setCurrentItem(mode_index);
-
     // ------------- Navigation links --------------
     kaction_map["home"] =  new KAction( i18n("&Top"), "2uparrow", \
                KShortcut("Ctrl+Alt+T"), this, SLOT(goHome()), actionCollection(), \
                "rellinks_top" );
     kaction_map["home"]->setWhatsThis( i18n("<p>This link references a home page or \
the top of some hierarchy.</p>") ); @@ -217,10 +191,6 @@ \
RelLinksPlugin::RelLinksPlugin(QObject *  
 /** Destructor */
 RelLinksPlugin::~RelLinksPlugin() {
-    if (m_toolBar && dynamic_cast<QMainWindow*>(m_toolBar->parent()))
-        m_toolBar->saveSettings(kconfig, "Position");
-    delete kconfig;
-    delete m_conf;
 }
 
 bool RelLinksPlugin::eventFilter(QObject *watched, QEvent* event) {
@@ -263,37 +233,6 @@ void RelLinksPlugin::delayedSetup()
     m_view = m_part->view();
     m_view->installEventFilter(this);
     m_viewVisible = m_view->isVisible();
-
-    // create toolbar
-    QMainWindow* mainWindow = \
                dynamic_cast<QMainWindow*>(m_part->widget()->topLevelWidget());
-    if (mainWindow == 0)
-    {
-        m_toolBar = new KToolBar(m_part->widget()->topLevelWidget(), \
                "rellinksToolbar");
-    }
-    else
-    {
-        m_toolBar = new KToolBar(mainWindow, Qt::DockLeft, false, "rellinksToolbar", \
                true);
-        m_toolBar->applySettings(kconfig, "Position");
-    }
-    m_toolBar->setText(i18n("Document Relations"));
-    QObject::connect(m_toolBar, SIGNAL(moved(BarPosition)), this, \
                SLOT(toolbarMoved()));
-
-    // be sure to know when m_toolBar is no longer usable in case it is destroyed by \
                its parent
-    QObject::connect(m_toolBar, SIGNAL(destroyed()), this, \
                SLOT(toolbarDestroyed()));
-
-    kaction_map["home"]->plug(m_toolBar);
-    kaction_map["up"]->plug(m_toolBar);
-    kaction_map["begin"]->plug(m_toolBar);
-    kaction_map["prev"]->plug(m_toolBar);
-    kaction_map["next"]->plug(m_toolBar);
-    kaction_map["last"]->plug(m_toolBar);
-    kaction_map["search"]->plug(m_toolBar);
-    m_toolBar->insertSeparator();
-    m_document->plug(m_toolBar);
-    m_toolBar->insertSeparator();
-    m_more->plug(m_toolBar);
-    m_toolBar->insertSeparator();
-    m_links->plug(m_toolBar);
 }
 
 void RelLinksPlugin::newDocument() {
@@ -417,40 +356,8 @@ void RelLinksPlugin::updateToolbar() {
 
         showBar = true;
     }
-
-    // Get the conf
-    kconfig->reparseConfiguration();
-    kconfig->setGroup("General");
-    QString mode = kconfig->readEntry("mode", CONF_NEVER);
-    int mode_index = listitem_conf.findIndex(mode);
-    m_conf->setCurrentItem(mode_index);
-
-    if (m_toolBar) {
-        switch (mode_index) {
-            case 0: /*CONF_ALWAYS*/
-                if (m_viewVisible) m_toolBar->show();
-                else m_toolBar->hide();
-                break;
-            case 1: /*CONF_WHEN_NECESSARY*/
-                if (showBar && m_viewVisible) m_toolBar->show();
-                else m_toolBar->hide();
-                break;
-            default: /*CONF_NEVER*/
-                m_toolBar->hide();
-                break;
-        }
-    }
 }
 
-void RelLinksPlugin::toolbarMoved()
-{
-    m_toolBar->saveSettings(kconfig, "Position");
-}
-
-void RelLinksPlugin::toolbarDestroyed()
-{
-    m_toolBar = 0;
-}
 
 
 /** Menu links */
@@ -592,15 +499,6 @@ void RelLinksPlugin::disableAll() {
 
 }
 
-void RelLinksPlugin::changeConf(int id) {
-    // Get the conf
-    kconfig->setGroup("General");
-    kconfig->writeEntry("mode", listitem_conf[id]);
-    kconfig->sync();
-    kconfig->reparseConfiguration();
-
-    updateToolbar();
-}
 
 QString RelLinksPlugin::getLinkType(const QString &lrel) {
     // Relations to ignore...
Index: plugin_rellinks.h
===================================================================
RCS file: /home/kde/kdeaddons/konq-plugins/rellinks/plugin_rellinks.h,v
retrieving revision 1.18
diff -u -p -b -B -r1.18 plugin_rellinks.h
--- plugin_rellinks.h	20 Nov 2004 11:09:56 -0000	1.18
+++ plugin_rellinks.h	18 Dec 2004 18:37:47 -0000
@@ -84,8 +84,6 @@ private slots:
      */
     void updateToolbar();
 
-    void toolbarMoved();
-    void toolbarDestroyed();
 
     void goHome();
     void goUp();
@@ -109,12 +107,6 @@ private slots:
     void goAlternate(int id);
     void goAllElements(int id);
 
-    /**
-     * Function used to change the configuration regarding the selection
-     * of the user in the conf menu.
-     * @param i Item selected
-     */
-    void changeConf(int i);
 private:
 
     /**
@@ -150,20 +142,8 @@ private:
 private:
     KHTMLPart* m_part;
     KHTMLView* m_view;
-    QGuardedPtr<KToolBar> m_toolBar;
-
     bool m_viewVisible;
 
-    KSimpleConfig *kconfig;
-    /** Constant use to store the parameter of the setting "always visible" */
-    static const char CONF_ALWAYS[];
-    /** Constant use to store the parameter of the setting "never visible" */
-    static const char CONF_NEVER[];
-    /** Constant use to store the parameter of the setting "visible when necessary" \
                */
-    static const char CONF_WHEN_NECESSARY[];
-    QStringList listitem_conf;
-
-    KSelectAction *m_conf;
     KActionMenu *m_document;
     KActionMenu *m_more;
     KActionMenu *m_links;
Index: plugin_rellinks.rc
===================================================================
RCS file: /home/kde/kdeaddons/konq-plugins/rellinks/plugin_rellinks.rc,v
retrieving revision 1.3
diff -u -p -b -B -r1.3 plugin_rellinks.rc
--- plugin_rellinks.rc	22 Jun 2004 21:15:17 -0000	1.3
+++ plugin_rellinks.rc	18 Dec 2004 18:37:47 -0000
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
-<kpartplugin name="rellinks" library="librellinksplugin" version="1">
+<kpartplugin name="rellinks" library="librellinksplugin" version="2">
 <MenuBar>
  <Menu name="tools"><Text>&amp;Tools</Text>
   <Menu name="rellinksMenu"><Text>Document Relations</Text>
@@ -13,9 +13,26 @@
     <Action name="rellinks_document"/>
     <Action name="rellinks_more"/>
     <Action name="rellinks_links"/>
-    <Separator/>
-    <Action name="rellinks_config"/>
   </Menu>
  </Menu>
 </MenuBar>
+
+
+<ToolBar name="rellinksToolBar"><Text>Document Relations</Text>
+	<Action name="rellinks_top"/>
+	<Action name="rellinks_up"/>
+	<Action name="rellinks_first"/>
+	<Action name="rellinks_previous"/>
+	<Action name="rellinks_next"/>
+	<Action name="rellinks_last"/>
+	<Action name="rellinks_search"/>
+	<Separator  />
+	<Action name="rellinks_document"/>
+	<Separator  />
+	<Action name="rellinks_more"/>
+	<Separator  />
+    <Action name="rellinks_links"/>	
+</ToolBar>
+
+
 </kpartplugin>


[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic