author | treke <treke> | 2002-12-22 00:58:46 (UTC) |
---|---|---|
committer | treke <treke> | 2002-12-22 00:58:46 (UTC) |
commit | 17d7f11b16b650f6ee2b5c440506167ea41fbfe5 (patch) (unidiff) | |
tree | cd5924c9e374a82c1cac6433dce098f3f45f4286 | |
parent | 6853d02989fc01e5a65048aca9749c20e0f5d095 (diff) | |
download | opie-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.
-rw-r--r-- | noncore/comm/keypebble/krfbcanvas.cpp | 4 | ||||
-rw-r--r-- | noncore/comm/keypebble/krfbdecoder.cpp | 5 | ||||
-rw-r--r-- | noncore/comm/keypebble/kvnc.cpp | 3 |
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 | |||
@@ -138,30 +138,26 @@ void KRFBCanvas::contentsMousePressEvent( QMouseEvent *e ) | |||
138 | } if (nextRightClick) { | 138 | } if (nextRightClick) { |
139 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),RightButton,RightButton)); | 139 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),RightButton,RightButton)); |
140 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),RightButton,0)); | 140 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),RightButton,0)); |
141 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); | 141 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonPress, e->pos(),NoButton,NoButton)); |
142 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); | 142 | connection_->buffer()->mouseEvent( &QMouseEvent(QEvent::MouseButtonRelease, e->pos(),NoButton,0)); |
143 | } else if ( loggedIn_ ) | 143 | } else if ( loggedIn_ ) |
144 | connection_->buffer()->mouseEvent( e ); | 144 | connection_->buffer()->mouseEvent( e ); |
145 | 145 | ||
146 | qDebug("Press"); | ||
147 | qDebug(QString::number(e->type()==QEvent::MouseButtonPress)); | ||
148 | } | 146 | } |
149 | 147 | ||
150 | void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) | 148 | void KRFBCanvas::contentsMouseReleaseEvent( QMouseEvent *e ) |
151 | { | 149 | { |
152 | if ( loggedIn_ && !nextRightClick && !nextDoubleClick) { | 150 | if ( loggedIn_ && !nextRightClick && !nextDoubleClick) { |
153 | connection_->buffer()->mouseEvent( e ); | 151 | connection_->buffer()->mouseEvent( e ); |
154 | } | 152 | } |
155 | 153 | ||
156 | nextRightClick=0; | 154 | nextRightClick=0; |
157 | nextDoubleClick=0; | 155 | nextDoubleClick=0; |
158 | qDebug("Release"); | ||
159 | qDebug(QString::number(e->button())); | ||
160 | } | 156 | } |
161 | 157 | ||
162 | void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) | 158 | void KRFBCanvas::contentsMouseMoveEvent( QMouseEvent *e ) |
163 | { | 159 | { |
164 | if ( loggedIn_ ) | 160 | if ( loggedIn_ ) |
165 | connection_->buffer()->mouseEvent( e ); | 161 | connection_->buffer()->mouseEvent( e ); |
166 | } | 162 | } |
167 | 163 | ||
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 | |||
@@ -702,37 +702,40 @@ void KRFBDecoder::gotServerCutLength() | |||
702 | 702 | ||
703 | void KRFBDecoder::gotServerCutText() | 703 | void KRFBDecoder::gotServerCutText() |
704 | { | 704 | { |
705 | assert( currentState = AwaitingServerCutText ); | 705 | assert( currentState = AwaitingServerCutText ); |
706 | 706 | ||
707 | disconnect( con, SIGNAL( gotEnoughData() ), | 707 | disconnect( con, SIGNAL( gotEnoughData() ), |
708 | this, SLOT( gotServerCutText() ) ); | 708 | this, SLOT( gotServerCutText() ) ); |
709 | 709 | ||
710 | |||
710 | // | 711 | // |
711 | // Warning: There is a bug in the RFB protocol because there is no way to find | 712 | // Warning: There is a bug in the RFB protocol because there is no way to find |
712 | // out the codepage in use on the remote machine. This could be fixed by requiring | 713 | // out the codepage in use on the remote machine. This could be fixed by requiring |
713 | // the remote server to use utf8 etc. but for now we have to assume they're the | 714 | // the remote server to use utf8 etc. but for now we have to assume they're the |
714 | // same. I've reported this problem to the ORL guys, but they apparantly have no | 715 | // same. I've reported this problem to the ORL guys, but they apparantly have no |
715 | // immediate plans to fix the issue. :-( (rich) | 716 | // immediate plans to fix the issue. :-( (rich) |
716 | // | 717 | // |
717 | 718 | ||
718 | char *cutbuf = new char[ serverCutTextLen + 1 ]; | 719 | char *cutbuf = new char[ serverCutTextLen + 1 ]; |
719 | CHECK_PTR( cutbuf ); | 720 | CHECK_PTR( cutbuf ); |
720 | 721 | ||
721 | con->read( cutbuf, serverCutTextLen ); | 722 | con->read( cutbuf, serverCutTextLen ); |
722 | cutbuf[ serverCutTextLen ] = '\0'; | 723 | cutbuf[ serverCutTextLen ] = '\0'; |
723 | 724 | ||
725 | /* For some reason QApplication::clipboard()->setText() segfaults when called | ||
726 | * from within keypebble's mass of signals and slots | ||
724 | qWarning( "Server cut: %s", cutbuf ); | 727 | qWarning( "Server cut: %s", cutbuf ); |
725 | 728 | ||
726 | QString cutText( cutbuf ); // DANGER!! | 729 | QString cutText( cutbuf ); // DANGER!! |
727 | qApp->clipboard()->setText( cutText ); | 730 | qApp->clipboard()->setText( cutText ); |
731 | */ | ||
728 | 732 | ||
729 | delete cutbuf; | 733 | delete cutbuf; |
730 | |||
731 | // Now wait for the update (again) | 734 | // Now wait for the update (again) |
732 | if ( oldState == AwaitingUpdate ) { | 735 | if ( oldState == AwaitingUpdate ) { |
733 | currentState = AwaitingUpdate; | 736 | currentState = AwaitingUpdate; |
734 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) ); | 737 | connect( con, SIGNAL( gotEnoughData() ), SLOT( gotUpdateHeader() ) ); |
735 | con->waitForData( UpdateHeaderLength ); | 738 | con->waitForData( UpdateHeaderLength ); |
736 | } | 739 | } |
737 | else if ( oldState == Idle ) { | 740 | else if ( oldState == Idle ) { |
738 | currentState = Idle; | 741 | currentState = Idle; |
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 | |||
@@ -154,17 +154,18 @@ void KVNC::openConnection( QString name) | |||
154 | 154 | ||
155 | void KVNC::openConnection( void ) | 155 | void KVNC::openConnection( void ) |
156 | { | 156 | { |
157 | openConnection( bookmarkSelector->selectedBookmark()); | 157 | openConnection( bookmarkSelector->selectedBookmark()); |
158 | } | 158 | } |
159 | 159 | ||
160 | void KVNC::openConnection( QListBoxItem * item) | 160 | void KVNC::openConnection( QListBoxItem * item) |
161 | { | 161 | { |
162 | openConnection(item->text()); | 162 | if (item) |
163 | openConnection(item->text()); | ||
163 | } | 164 | } |
164 | 165 | ||
165 | void KVNC::setupActions() | 166 | void KVNC::setupActions() |
166 | { | 167 | { |
167 | cornerMenu = new QPopupMenu( this ); | 168 | cornerMenu = new QPopupMenu( this ); |
168 | 169 | ||
169 | fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 ); | 170 | fullScreenAction = new QAction( tr("Full Screen"), QString::null, 0, 0 ); |
170 | connect( fullScreenAction, SIGNAL(activated()), | 171 | connect( fullScreenAction, SIGNAL(activated()), |