summaryrefslogtreecommitdiffstats
path: root/ksirc/puke/pobjfinder.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /ksirc/puke/pobjfinder.cpp
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksirc/puke/pobjfinder.cpp')
-rw-r--r--ksirc/puke/pobjfinder.cpp86
1 files changed, 86 insertions, 0 deletions
diff --git a/ksirc/puke/pobjfinder.cpp b/ksirc/puke/pobjfinder.cpp
new file mode 100644
index 00000000..0f510ea4
--- /dev/null
+++ b/ksirc/puke/pobjfinder.cpp
@@ -0,0 +1,86 @@
+#include "pobjfinder.h"
+#include "pobjfinder-cmd.h"
+
+
+PObject *
+PObjFinder::createWidget(CreateArgs &ca)
+{
+ PObjFinder *pw = new PObjFinder(ca.parent);
+ pw->setWidget(0x0);
+ pw->setWidgetId(ca.pwI);
+ pw->setPukeController(ca.pc);
+ return pw;
+}
+
+
+PObjFinder::PObjFinder(PObject *parent)
+ : PObject(parent)
+{
+ // We don't actually encase a widget since all the ObjFinder interface
+ // is static
+ setWidget(0x0);
+ connect(controller(), SIGNAL(inserted(QObject *)),
+ this, SLOT(newObject(QObject *)));
+}
+
+PObjFinder::~PObjFinder()
+{
+}
+
+void PObjFinder::messageHandler(int fd, PukeMessage *pm)
+{
+ PukeMessage pmRet;
+ switch(pm->iCommand){
+ case PUKE_OBJFINDER_ALLOBJECTS:
+ {
+ QString qscArg;
+ QStrList allObj = controller()->allObjects();
+ for(uint i = 0; i <= allObj.count(); i++){
+ qscArg += allObj.at(i);
+ qscArg += "\n";
+ }
+
+ pmRet.iCommand = - pm->iCommand;
+ pmRet.iWinId = pm->iWinId;
+ pmRet.iArg = 0;
+ pmRet.cArg = qstrdup(qscArg);
+ pmRet.iTextSize = qscArg.length();
+ emit outputMessage(fd, &pmRet);
+ delete pmRet.cArg;
+ break;
+ }
+ default:
+ PObject::messageHandler(fd, pm);
+ }
+}
+
+void PObjFinder::setWidget(QObject *_obj)
+{
+ PObject::setWidget(_obj);
+}
+
+
+objFinder *PObjFinder::widget()
+{
+ return 0x0;
+}
+
+
+void PObjFinder::newObject(QObject *name){
+ QString info;
+
+ info = name->className();
+ info += "::";
+ info += name->name("unnamed");
+
+ PukeMessage pmRet;
+ pmRet.iCommand = - PUKE_OBJFINDER_NEWOBJECT_ACK;
+ pmRet.iWinId = widgetIden().iWinId;
+ pmRet.iArg = 0;
+ pmRet.cArg = qstrdup(info);
+ pmRet.iTextSize = info.length();
+ emit outputMessage(widgetIden().fd, &pmRet);
+ delete pmRet.cArg;
+}
+
+#include "pobjfinder.moc"