From 9d32cef472591155d4823116320cdc45b37dbba6 Mon Sep 17 00:00:00 2001 From: christian Date: Tue, 3 Aug 2010 22:26:34 +0200 Subject: [PATCH] dismissing pw dialog now closes program --- debian/changelog | 6 ++++++ debian/copyright | 4 ++++ debian/rules | 4 ++-- libvnc/config.log | 4 ++-- presencevnc.desktop | 2 +- src/main.cpp | 41 ++++++++++++++++++----------------------- src/mainwindow.cpp | 32 +++++++++++++++++++++++++------- src/mainwindow.h | 18 ++++++++++++++++++ src/preferences.cpp | 7 ++----- src/vncclientthread.cpp | 8 +++++--- src/vncview.cpp | 18 ++++++++---------- src/vncview.h | 1 - vnc.pro | 2 +- 13 files changed, 92 insertions(+), 55 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4a35165..fd0fd49 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +presencevnc (0.3) unstable; urgency=low + + * Compatibility fix for RealVNC Personal/Enterprise + + -- Christian Pulvermacher Tue, 03 Aug 2010 18:35:57 +0200 + presencevnc (0.2) unstable; urgency=low * Add dependency on libjpeg diff --git a/debian/copyright b/debian/copyright index e73b00d..9b5b88b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -5,6 +5,10 @@ Author: Christian Pulvermacher Copyright (c) 2010 Christian Pulvermacher +Based on +KRDC, Copyright (c) 2007-2008 Urs Wolfer +LibVNCServer, Copyright (c) 2001-2003 Johannes E. Schindelin + Icon derived from Crystal Project Icons, Copyright (c) 2006-2007 Everaldo Coelho, LGPL diff --git a/debian/rules b/debian/rules index 0af3df8..0d0166c 100755 --- a/debian/rules +++ b/debian/rules @@ -5,7 +5,7 @@ export DH_VERBOSE=1 #currently builds a maemo-only package #comment this line for quick builds -buildlibs=foo +#buildlibs=foo SOURCEDIR=./ BUILDDIR=debian/build/ @@ -42,7 +42,7 @@ binary-arch: build install dh_testroot dh_installdocs dh_installchangelogs - dh_strip + #dh_strip dh_compress dh_fixperms dh_installdeb diff --git a/libvnc/config.log b/libvnc/config.log index af6361a..007f7dc 100644 --- a/libvnc/config.log +++ b/libvnc/config.log @@ -1383,9 +1383,9 @@ configure:26983: $? = 0 configure:26995: result: yes configure:27002: checking for _doprnt configure:27059: gcc -o conftest -g -O2 conftest.c -lpthread -lz -ljpeg >&5 -/tmp/ccYsUjHg.o: In function `main': +/tmp/cc6wOTSk.o: In function `main': /home/christian/presencevnc/libvnc/conftest.c:91: undefined reference to `_doprnt' -/tmp/ccYsUjHg.o:(.data+0x0): undefined reference to `_doprnt' +/tmp/cc6wOTSk.o:(.data+0x0): undefined reference to `_doprnt' collect2: ld returned 1 exit status configure:27065: $? = 1 configure: failed program was: diff --git a/presencevnc.desktop b/presencevnc.desktop index 40f5f50..5289328 100644 --- a/presencevnc.desktop +++ b/presencevnc.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Name=Presence VNC -Comment=A touch-screen friendly VNC client +Comment=A touchscreen friendly VNC client Exec=presencevnc Icon=presencevnc Type=Application diff --git a/src/main.cpp b/src/main.cpp index 6e73cd6..ccb7dc2 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,26 +1,21 @@ -/**************************************************************************** -** -** Copyright (C) 2008 Urs Wolfer -** -** This file is part of KDE. -** -** This program is free software; you can redistribute it and/or modify -** it under the terms of the GNU General Public License as published by -** the Free Software Foundation; either version 2 of the License, or -** (at your option) any later version. -** -** This program is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** GNU General Public License for more details. -** -** You should have received a copy of the GNU General Public License -** along with this program; see the file COPYING. If not, write to -** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -** Boston, MA 02110-1301, USA. -** -****************************************************************************/ +/* + Presence VNC + Copyright (C) 2010 Christian Pulvermacher + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include #include #include @@ -33,7 +28,7 @@ int main(int argc, char *argv[]) QCoreApplication::setApplicationName("Presence VNC"); QApplication app(argc, argv); - app.setAutoSipEnabled(true); + //app.setAutoSipEnabled(true); QString url; int quality = 2; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ef629d6..a9e4828 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,3 +1,21 @@ +/* + Presence VNC + Copyright (C) 2010 Christian Pulvermacher + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #include "mainwindow.h" #include "preferences.h" #include "vncview.h" @@ -123,8 +141,9 @@ void MainWindow::about() { QMessageBox::about(this, tr("About Presence VNC"), tr("

Presence VNC 0.3

\ A touchscreen friendly VNC client\ -

©2010 Christian Pulvermacher <pulvermacher@gmx.de>

\ -

Based on KRDC, © 2007-2008 Urs Wolfer

\ +

©2010 Christian Pulvermacher <pulvermacher@gmx.de>

\ +

Based on KRDC, © 2007-2008 Urs Wolfer

\ +

and LibVNCServer, © 2001-2003 Johannes E. Schindelin

\

This program is free software; License: GNU GPL 2 or later.

")); } @@ -158,13 +177,12 @@ void MainWindow::disconnectFromHost() if(!vnc_view) return; -//TODO: crashes when deleting vnc_view - no idea why - vnc_view->startQuitting(); +// vnc_view->startQuitting(); scroll_area->setWidget(0); - vnc_view->disconnect(); //remove all connections - //delete vnc_view; - //vnc_view = 0; + vnc_view->disconnect(); //remove all signal-slot connections + delete vnc_view; + vnc_view = 0; disconnect_action->setEnabled(false); toolbar->setEnabled(false); } diff --git a/src/mainwindow.h b/src/mainwindow.h index f3451be..2801af4 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -1,3 +1,21 @@ +/* + Presence VNC + Copyright (C) 2010 Christian Pulvermacher + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ #ifndef MAINWINDOW_H #define MAINWINDOW_H diff --git a/src/preferences.cpp b/src/preferences.cpp index 9dc64ae..6c97a4f 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -66,6 +66,7 @@ Preferences::Preferences(QWidget *parent): layout2->addWidget(rightzoom); QPushButton *ok = new QPushButton("OK"); + ok->setMaximumWidth(100); layout1->addLayout(layout2); layout1->addWidget(ok); @@ -78,11 +79,7 @@ Preferences::Preferences(QWidget *parent): this, SLOT(save())); } -Preferences::~Preferences() -{ - -} - +Preferences::~Preferences() { } void Preferences::save() { diff --git a/src/vncclientthread.cpp b/src/vncclientthread.cpp index 49616fd..2d1fc9f 100644 --- a/src/vncclientthread.cpp +++ b/src/vncclientthread.cpp @@ -173,10 +173,10 @@ VncClientThread::~VncClientThread() const bool quitSuccess = wait(500); - kDebug(5011) << "Quit VNC thread success:" << quitSuccess; + kDebug(5011) << "~VncClientThread(): Quit VNC thread success:" << quitSuccess; delete [] frameBuffer; - delete cl; + //cl is free()d when event loop exits. } void VncClientThread::checkOutputErrorMessage() @@ -241,7 +241,7 @@ void VncClientThread::emitGotCut(const QString &text) void VncClientThread::stop() { - QMutexLocker locker(&mutex); +//TODO: not locking the mutex leads to a crash, but at least it stops. m_stopped = true; } @@ -250,6 +250,7 @@ void VncClientThread::run() QMutexLocker locker(&mutex); while (!m_stopped) { // try to connect as long as the server allows + kDebug(5011) << "enter loop"; m_passwordError = false; rfbClientLog = outputHandler; @@ -286,6 +287,7 @@ void VncClientThread::run() // Main VNC event loop while (!m_stopped) { + kDebug(5011) << "entering main event loop"; const int i = WaitForMessage(cl, 500); if (i < 0) break; diff --git a/src/vncview.cpp b/src/vncview.cpp index d21a4cd..51fbfa4 100644 --- a/src/vncview.cpp +++ b/src/vncview.cpp @@ -54,7 +54,6 @@ VncView::VncView(QWidget *parent, const KUrl &url, RemoteView::Quality quality) m_repaint(false), m_quitFlag(false), m_firstPasswordTry(true), - m_authenticaionCanceled(false), m_dontSendClipboard(false), m_horizontalFactor(1.0), m_verticalFactor(1.0), @@ -83,10 +82,13 @@ VncView::~VncView() unpressModifiers(); // Disconnect all signals so that we don't get any more callbacks from the client thread + vncThread.disconnect(); + /* disconnect(&vncThread, SIGNAL(imageUpdated(int, int, int, int)), this, SLOT(updateImage(int, int, int, int))); disconnect(&vncThread, SIGNAL(gotCut(const QString&)), this, SLOT(setCut(const QString&))); disconnect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword())); disconnect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString))); + */ startQuitting(); } @@ -177,7 +179,7 @@ void VncView::startQuitting() const bool quitSuccess = vncThread.wait(500); - kDebug(5011) << "Quit VNC thread success:" << quitSuccess; + kDebug(5011) << "startQuitting(): Quit VNC thread success:" << quitSuccess; setStatus(Disconnected); } @@ -219,11 +221,6 @@ void VncView::requestPassword() { kDebug(5011) << "request password"; - if (m_authenticaionCanceled) { - startQuitting(); - return; - } - setStatus(Authenticating); if (!m_url.password().isNull()) { @@ -237,10 +234,11 @@ void VncView::requestPassword() tr("Please enter the password for the remote desktop:"), QLineEdit::Password, QString(), &ok); m_firstPasswordTry = false; - if (ok) + if (ok) { vncThread.setPassword(password); - else - m_authenticaionCanceled = true; + } else { + startQuitting(); + } } void VncView::outputErrorMessage(const QString &message) diff --git a/src/vncview.h b/src/vncview.h index af5cc32..1f76385 100644 --- a/src/vncview.h +++ b/src/vncview.h @@ -82,7 +82,6 @@ private: bool m_repaint; bool m_quitFlag; bool m_firstPasswordTry; - bool m_authenticaionCanceled; bool m_dontSendClipboard; qreal m_horizontalFactor; qreal m_verticalFactor; diff --git a/vnc.pro b/vnc.pro index e4ef7b2..3edce47 100644 --- a/vnc.pro +++ b/vnc.pro @@ -3,7 +3,7 @@ TARGET = presencevnc-bin LIBS += -Llibvnc/libvncclient/.libs -lvncclient DEFINES += QTONLY QT += maemo5 -CONFIG += silent release +CONFIG += silent debug OBJECTS_DIR = $${PWD}/tmp MOC_DIR = $${PWD}/tmp -- 1.7.9.5