[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeaddons/kate/helloworld
From: Dominik Haumann <dhdev () gmx ! de>
Date: 2006-05-19 12:17:30
Message-ID: 1148041050.343988.12388.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 542474 by dhaumann:
Port, it does not compile yet, though.
M +27 -6 plugin_katehelloworld.cpp
M +13 -4 plugin_katehelloworld.h
--- trunk/KDE/kdeaddons/kate/helloworld/plugin_katehelloworld.cpp #542473:542474
@@ -27,12 +27,10 @@
void KatePluginHelloWorld::addView(Kate::MainWindow *win)
{
- // TODO: doesn't this have to be deleted?
PluginView *view = new PluginView ();
- (void) new KAction ( i18n("Insert Hello World"), 0, this,
- SLOT( slotInsertHello() ), view->actionCollection(),
- "edit_insert_helloworld" );
+ KAction* a = new KAction ( i18n("Insert Hello World"), view->actionCollection(), \
"edit_insert_helloworld" ); + connect( a, SIGNAL( triggered(bool) ), this, SLOT( \
slotInsertHello() ) );
view->setInstance (new KInstance("kate"));
view->setXMLFile("plugins/katehelloworld/ui.rc");
@@ -44,16 +42,36 @@
void KatePluginHelloWorld::removeView(Kate::MainWindow *win)
{
- for (uint z=0; z < m_views.count(); z++)
+ for (int z=0; z < m_views.count(); z++)
if (m_views.at(z)->win == win)
{
PluginView *view = m_views.at(z);
- m_views.remove (view);
+ m_views.removeAll (view);
win->guiFactory()->removeClient (view);
delete view;
}
}
+void KatePluginHelloWorld::storeGeneralConfig(KConfig* config,const QString& \
groupPrefix) +{
+ // If you have application wide settings, save them here
+}
+
+void KatePluginHelloWorld::loadGeneralConfig(KConfig* config,const QString& \
groupPrefix) +{
+ // If you have application wide settings, load them here
+}
+
+void KatePluginHelloWorld::storeViewConfig(KConfig* config, Kate::MainWindow* \
mainwindow, const QString& groupPrefix) +{
+ // If you have session-dependant settings, save them here
+}
+
+void KatePluginHelloWorld::loadViewConfig(KConfig* config, Kate::MainWindow* \
mainwindow, const QString& groupPrefix) +{
+ // If you have session-dependant settings, lode them here
+}
+
void KatePluginHelloWorld::slotInsertHello()
{
if (!application()->activeMainWindow())
@@ -64,3 +82,6 @@
if (kv)
kv->insertText ("Hello World");
}
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
--- trunk/KDE/kdeaddons/kate/helloworld/plugin_katehelloworld.h #542473:542474
@@ -7,9 +7,9 @@
#include <kate/mainwindow.h>
#include <kate/plugin.h>
#include <ktexteditor/view.h>
-//Added by qt3to4:
-#include <Q3PtrList>
+#include <QList>
+
class KatePluginHelloWorld : public Kate::Plugin, Kate::PluginViewInterface
{
Q_OBJECT
@@ -18,14 +18,23 @@
KatePluginHelloWorld( QObject* parent = 0, const char* name = 0, const \
QStringList& = QStringList() ); virtual ~KatePluginHelloWorld();
+ void storeGeneralConfig(KConfig* config,const QString& groupPrefix);
+ void loadGeneralConfig(KConfig* config,const QString& groupPrefix);
+
void addView (Kate::MainWindow *win);
void removeView (Kate::MainWindow *win);
-
+
+ void storeViewConfig(KConfig* config, Kate::MainWindow* mainwindow, const \
QString& groupPrefix); + void loadViewConfig(KConfig* config, Kate::MainWindow* \
mainwindow, const QString& groupPrefix); +
public slots:
void slotInsertHello();
private:
- Q3PtrList<class PluginView> m_views;
+ QList<class PluginView*> m_views;
};
#endif
+
+// kate: space-indent on; indent-width 2; replace-tabs on;
+
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic