From: Christian Pulvermacher Date: Tue, 19 Oct 2010 18:17:43 +0000 (+0200) Subject: don't miss early connection errors X-Git-Tag: 0.6~2 X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=24413e1691e8636521ecb6f21f2e72f9e7ce76d4;p=presencevnc don't miss early connection errors --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 64eba53..77be3b4 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -324,8 +324,8 @@ void MainWindow::showPreferences() void MainWindow::reloadSettings() { - QSettings settings; #ifdef Q_WS_MAEMO_5 + QSettings settings; int rotation = settings.value("screen_rotation", 0).toInt(); setAttribute(Qt::WA_Maemo5AutoOrientation, rotation == 0); setAttribute(Qt::WA_Maemo5LandscapeOrientation, rotation == 1); diff --git a/src/vncclientthread.cpp b/src/vncclientthread.cpp index 7a61e29..e82b617 100644 --- a/src/vncclientthread.cpp +++ b/src/vncclientthread.cpp @@ -167,7 +167,6 @@ VncClientThread::VncClientThread(QObject *parent) : QThread(parent) , frameBuffer(0) { - outputErrorMessageString.clear(); //don't deliver error messages of old instances... QMutexLocker locker(&mutex); m_stopped = false; @@ -270,6 +269,7 @@ void VncClientThread::run() int passwd_failures = 0; while (!m_stopped) { // try to connect as long as the server allows m_passwordError = false; + outputErrorMessageString.clear(); //don't deliver error messages of old instances... rfbClientLog = outputHandler; rfbClientErr = outputHandler; diff --git a/src/vncview.cpp b/src/vncview.cpp index 79b5973..6b1ad69 100644 --- a/src/vncview.cpp +++ b/src/vncview.cpp @@ -86,6 +86,9 @@ VncView::VncView(QWidget *parent, const KUrl &url, RemoteView::Quality quality, connect(&vncThread, SIGNAL(passwordRequest()), this, SLOT(requestPassword()), Qt::BlockingQueuedConnection); connect(&vncThread, SIGNAL(outputErrorMessage(QString)), this, SLOT(outputErrorMessage(QString))); + //don't miss early connection failures + connect(&vncThread, SIGNAL(finished()), this, SLOT(startQuitting())); + m_clipboard = QApplication::clipboard(); connect(m_clipboard, SIGNAL(selectionChanged()), this, SLOT(clipboardSelectionChanged())); connect(m_clipboard, SIGNAL(dataChanged()), this, SLOT(clipboardDataChanged())); @@ -141,6 +144,9 @@ QSize VncView::minimumSizeHint() const void VncView::startQuitting() { + if(isQuitting()) + return; + kDebug(5011) << "about to quit"; //const bool connected = status() == RemoteView::Connected; diff --git a/src/vncview.h b/src/vncview.h index fe043f2..3b1c12e 100644 --- a/src/vncview.h +++ b/src/vncview.h @@ -47,7 +47,6 @@ public: QSize framebufferSize(); QSize sizeHint() const; QSize minimumSizeHint() const; - void startQuitting(); bool isQuitting(); void reloadSettings(); bool start(); @@ -62,6 +61,7 @@ public slots: void setZoomLevel(int level = -1); //'level' doesn't correspond to actual magnification, though mapping is done here void sendKey(Qt::Key key); void sendKeySequence(QKeySequence keys); + void startQuitting(); void forceFullRepaint(); protected: