From ea3de72adb5279b56f542589617a4fddfd0a1ca4 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Fri, 30 May 2008 14:37:08 +0800 Subject: [PATCH] Quick hakcish port of the QtBrowserPlugin from QApplication -> KApplication --- qtbrowserplugin/qtbrowserplugin.cpp | 3 ++- qtbrowserplugin/qtbrowserplugin_x11.cpp | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/qtbrowserplugin/qtbrowserplugin.cpp b/qtbrowserplugin/qtbrowserplugin.cpp index ee07d6d..404dd7f 100644 --- a/qtbrowserplugin/qtbrowserplugin.cpp +++ b/qtbrowserplugin/qtbrowserplugin.cpp @@ -21,6 +21,7 @@ ** ****************************************************************************/ #include +#include #include "qtnpapi.h" @@ -1044,7 +1045,7 @@ NPP_SetWindow(NPP instance, NPWindow* window) qtns_embed(This); QEvent e(QEvent::EmbeddingControl); - QApplication::sendEvent(This->qt.widget, &e); + KApplication::sendEvent(This->qt.widget, &e); if (!This->qt.widget->testAttribute(Qt::WA_PaintOnScreen)) This->qt.widget->setAutoFillBackground(true); diff --git a/qtbrowserplugin/qtbrowserplugin_x11.cpp b/qtbrowserplugin/qtbrowserplugin_x11.cpp index 059e217..e166117 100644 --- a/qtbrowserplugin/qtbrowserplugin_x11.cpp +++ b/qtbrowserplugin/qtbrowserplugin_x11.cpp @@ -23,6 +23,10 @@ #include #include +#include +#include +#include + #include "qtbrowserplugin.h" #include "qtbrowserplugin_p.h" @@ -42,15 +46,25 @@ extern "C" void qtns_initialize(QtNPInstance* This) { if (!qApp) { ownsqapp = true; - static int argc = 0; - static char **argv = {0}; + static int argc = 1; + static char **argv = new char*; + argv[0] = "b"; // Workaround to avoid re-initilaziation of glib char* envvar = qstrdup("QT_NO_THREADED_GLIB=1"); // Unavoidable memory leak; the variable must survive plugin unloading ::putenv(envvar); - - (void)new QApplication(argc, argv); + //BEGIN: PLASMAPLUGIN ALTERED CODE +KAboutData aboutData( "plasmoidviewer", 0, ki18n( "Plasma Applet Viewer" ), + "1.0", ki18n( "blaaaaaa" ), KAboutData::License_BSD, + ki18n( "(C) 2007, The KDE Team" ) ); + aboutData.setProgramIconName( "plasma" ); + aboutData.addAuthor( ki18n( "Frerich Raabe" ), + ki18n( "Original author" ), + "raabe@kde.org" ); + KCmdLineArgs::init( argc, argv, &aboutData ); + (void)new KApplication; + //END: PLASMAPLUGIN ALTERED CODE } if (!clients.contains(This)) { QX11EmbedWidget* client = new QX11EmbedWidget; -- 2.11.4.GIT