Patch for kjas
Koos Vriezen
koos.vriezen at xs4all.nl
Sat Dec 6 13:41:17 GMT 2003
Hi,
For review:
- call resize on the wrapper widget, not the applet at first if size is
known. This will also set the size on the applet (see the resizeEvent of
these, and note that at first the QLabel is visible). It fixes the
initial display of the applet/label which is now often a small rectangle
in the top/left corner
- objid are in liveconnect stored as unsigned long, but in kjas as int. I
had a NumberCastException, because of a negative objid was passed as an
int that was > Integer.MAXVALUE.
- initial hide the part widget
Koos
-------------- next part --------------
Index: kjavaappletviewer.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/java/kjavaappletviewer.cpp,v
retrieving revision 1.24
diff -u -3 -p -r1.24 kjavaappletviewer.cpp
--- kjavaappletviewer.cpp 21 Oct 2003 18:32:13 -0000 1.24
+++ kjavaappletviewer.cpp 5 Dec 2003 22:06:10 -0000
@@ -176,6 +176,7 @@ protected:
inline CoverWidget::CoverWidget (QWidget * parent) : QWidget (parent) {
m_appletwidget = new KJavaAppletWidget (this);
setFocusProxy (m_appletwidget);
+ hide ();
}
inline KJavaAppletWidget * CoverWidget::appletWidget () const {
@@ -183,7 +184,7 @@ inline KJavaAppletWidget * CoverWidget::
}
void CoverWidget::resizeEvent (QResizeEvent * e) {
- m_appletwidget->setGeometry (0, 0, e->size().width(), e->size().height());
+ m_appletwidget->resize (e->size().width(), e->size().height());
}
//-----------------------------------------------------------------------------
@@ -264,7 +265,7 @@ KJavaAppletViewer::KJavaAppletViewer (QW
codebase = khtml_codebase;
if (width > 0 && height > 0)
- applet->setSize (QSize(width, height));
+ m_view->resize (width, height);
applet->setBaseURL (baseurl);
// check codebase first
KURL newURL(baseurl, codebase);
@@ -473,7 +474,7 @@ bool KJavaAppletViewerLiveConnectExtensi
QStringList args, ret_args;
KJavaApplet * applet = m_viewer->view ()->appletWidget ()->applet ();
args.append (QString::number (applet->appletId ()));
- args.append (QString::number (objid));
+ args.append (QString::number ((int) objid));
args.append (name);
m_jssessions++;
bool ret = applet->getContext()->getMember (args, ret_args);
@@ -496,7 +497,7 @@ bool KJavaAppletViewerLiveConnectExtensi
QStringList args;
KJavaApplet * applet = m_viewer->view ()->appletWidget ()->applet ();
args.append (QString::number (applet->appletId ()));
- args.append (QString::number (objid));
+ args.append (QString::number ((int) objid));
args.append (name);
args.append (value);
m_jssessions++;
@@ -512,7 +513,7 @@ bool KJavaAppletViewerLiveConnectExtensi
KJavaApplet * applet = m_viewer->view ()->appletWidget ()->applet ();
QStringList args, ret_args;
args.append (QString::number (applet->appletId ()));
- args.append (QString::number (objid));
+ args.append (QString::number ((int) objid));
args.append (func);
for (QStringList::const_iterator it=fargs.begin(); it != fargs.end(); ++it)
args.append(*it);
@@ -542,7 +543,7 @@ void KJavaAppletViewerLiveConnectExtensi
}
QStringList args;
args.append (QString::number (applet->appletId ()));
- args.append (QString::number (objid));
+ args.append (QString::number ((int) objid));
applet->getContext()->derefObject (args);
}
More information about the kfm-devel
mailing list