don't miss early connection errors
authorChristian Pulvermacher <christian@hazel.(none)>
Tue, 19 Oct 2010 18:17:43 +0000 (20:17 +0200)
committerChristian Pulvermacher <christian@hazel.(none)>
Tue, 19 Oct 2010 18:17:43 +0000 (20:17 +0200)
src/mainwindow.cpp
src/vncclientthread.cpp
src/vncview.cpp
src/vncview.h

index 64eba53..77be3b4 100644 (file)
@@ -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);
index 7a61e29..e82b617 100644 (file)
@@ -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;
index 79b5973..6b1ad69 100644 (file)
@@ -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;
index fe043f2..3b1c12e 100644 (file)
@@ -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: