summaryrefslogtreecommitdiff
authortreke <treke>2002-12-22 00:58:46 (UTC)
committer treke <treke>2002-12-22 00:58:46 (UTC)
commit17d7f11b16b650f6ee2b5c440506167ea41fbfe5 (patch) (side-by-side diff)
treecd5924c9e374a82c1cac6433dce098f3f45f4286
parent6853d02989fc01e5a65048aca9749c20e0f5d095 (diff)
downloadopie-17d7f11b16b650f6ee2b5c440506167ea41fbfe5.zip
opie-17d7f11b16b650f6ee2b5c440506167ea41fbfe5.tar.gz
opie-17d7f11b16b650f6ee2b5c440506167ea41fbfe5.tar.bz2
1) Fixed a bug where double clicking a blank spot on the bookmark list
caused a segfault. 2) Removed support for copying from the server. Trying to setText in the clipboard would segfault everytime from within the KRFBDecoder. Doesnt seem to like being called from within a slot.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/comm/keypebble/krfbcanvas.cpp4
-rw-r--r--noncore/comm/keypebble/krfbdecoder.cpp5
-rw-r--r--noncore/comm/keypebble/kvnc.cpp3
3 files changed, 6 insertions, 6 deletions
diff --git a/noncore/comm/keypebble/krfbcanvas.cpp b/noncore/comm/keypebble/krfbcanvas.cpp
index 049bbd4..bc71c90 100644
--- a/noncore/comm/keypebble/krfbcanvas.cpp
+++ b/noncore/comm/keypebble/krfbcanvas.cpp
@@ -122,62 +122,58 @@ void KRFBCanvas::viewportPaintEvent( QPaintEvent *e )
}
void KRFBCanvas::viewportUpdate( int x, int y, int w, int h )
{
updateContents( x, y, w, h );
}
void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e )
{
if (nextDoubleClick) {
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),LeftButton,LeftButton));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),LeftButton,0));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0));
} if (nextRightClick) {
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),RightButton,RightButton));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),RightButton,0));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton));
connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0));
} else if ( loggedIn_ )
connection_->buffer()->mouseEvent( e );
- qDebug("Press");
- qDebug(QString::number(e->type()==QEvent::MouseButtonPress));
}
void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e )
{
if ( loggedIn_ && !nextRightClick && !nextDoubleClick) {
connection_->buffer()->mouseEvent( e );
}
nextRightClick=0;
nextDoubleClick=0;
- qDebug("Release");
- qDebug(QString::number(e->button()));
}
void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e )
{
if ( loggedIn_ )
connection_->buffer()->mouseEvent( e );
}
void KRFBCanvas::keyPressEvent( QKeyEvent *e )
{
if ( loggedIn_ )
connection_->buffer()->keyPressEvent( e );
}
void KRFBCanvas::keyReleaseEvent( QKeyEvent *e )
{
if ( loggedIn_ )
connection_->buffer()->keyReleaseEvent( e );
}
void KRFBCanvas::refresh()
{
if ( loggedIn_ )
connection_->refresh();
diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp
index 94e3b79..33418ae 100644
--- a/noncore/comm/keypebble/krfbdecoder.cpp
+++ b/noncore/comm/keypebble/krfbdecoder.cpp
@@ -686,69 +686,72 @@ void KRFBDecoder::gotServerCut()
void KRFBDecoder::gotServerCutLength()
{
assert( currentState = AwaitingServerCutLength );
disconnect( con, SIGNAL( gotEnoughData() ),
this, SLOT( gotServerCutLength() ) );
CARD8 padding[3];
con->read( padding, 3 );
con->read( &serverCutTextLen, 4 );
serverCutTextLen = Swap32IfLE( serverCutTextLen );
currentState = AwaitingServerCutText;
connect( con, SIGNAL( gotEnoughData() ), SLOT( gotServerCutText() ) );
con->waitForData( serverCutTextLen );
}
void KRFBDecoder::gotServerCutText()
{
assert( currentState = AwaitingServerCutText );
disconnect( con, SIGNAL( gotEnoughData() ),
this, SLOT( gotServerCutText() ) );
+
//
// Warning: There is a bug in the RFB protocol because there is no way to find
// out the codepage in use on the remote machine. This could be fixed by requiring
// the remote server to use utf8 etc. but for now we have to assume they're the
// same. I've reported this problem to the ORL guys, but they apparantly have no
// immediate plans to fix the issue. :-( (rich)
//
char *cutbuf = new char[ serverCutTextLen + 1 ];
CHECK_PTR( cutbuf );
con->read( cutbuf, serverCutTextLen );
cutbuf[ serverCutTextLen ] = '\0';
+ /* For some reason QApplication::clipboard()->setText() segfaults when called
+ * from within keypebble's mass of signals and slots
qWarning( "Server cut: %s", cutbuf );
QString cutText( cutbuf ); // DANGER!!
qApp->clipboard()->setText( cutText );
+ */
delete cutbuf;
-
// Now wait for the update (again)
if ( oldState == AwaitingUpdate ) {
currentState = AwaitingUpdate;
connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) );
con->waitForData( UpdateHeaderLength );
}
else if ( oldState == Idle ) {
currentState = Idle;
}
else {
qWarning( "Async handled in weird state" );
currentState = oldState;
};
}
void KRFBDecoder::gotBell()
{
qWarning( "Got server bell" );
buf->soundBell();
// Now wait for the update (again)
if ( oldState == AwaitingUpdate ) {
currentState = AwaitingUpdate;
connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) );
diff --git a/noncore/comm/keypebble/kvnc.cpp b/noncore/comm/keypebble/kvnc.cpp
index 5b1dc9f..48a442c 100644
--- a/noncore/comm/keypebble/kvnc.cpp
+++ b/noncore/comm/keypebble/kvnc.cpp
@@ -138,49 +138,50 @@ void KVNC::newConnection()
void KVNC::openConnection( QString name)
{
curServer=bookmarkSelector->getServer(name);
if (curServer) {
KVNCConnDlg dlg( curServer,this);
dlg.showMaximized();
if ( dlg.exec() ) {
canvas->openConnection(*curServer);
bookmarkSelector->writeBookmarks();
} else
curServer=0;
}
}
void KVNC::openConnection( void )
{
openConnection( bookmarkSelector->selectedBookmark());
}
void KVNC::openConnection( QListBoxItem * item)
{
- openConnection(item->text());
+ if (item)
+ openConnection(item->text());
}
void KVNC::setupActions()
{
cornerMenu = new QPopupMenu( this );
fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 );
connect( fullScreenAction, SIGNAL(activated()),
this, SLOT( toggleFullScreen() ) );
fullScreenAction->addTo( cornerMenu );
fullScreenAction->setEnabled( false );
ctlAltDelAction = new QAction( tr("Send Contrl-Alt-Delete"), QString::null, 0, 0 );
connect( ctlAltDelAction, SIGNAL(activated()),
canvas, SLOT( sendCtlAltDel() ) );
ctlAltDelAction->addTo( cornerMenu );
ctlAltDelAction->setEnabled( false );
disconnectAction = new QAction( tr("Disconnect"), QString::null, 0, 0 );
connect( disconnectAction, SIGNAL(activated()),
this, SLOT( closeConnection() ) );
disconnectAction->addTo( cornerMenu );
disconnectAction->setEnabled( false );