Fixed a mysterious login error that occured on some machines
authorPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 12 May 2010 07:15:54 +0000 (10:15 +0300)
committerPekka Nissinen <pekka.nissinen@ixonos.com>
Wed, 12 May 2010 07:15:54 +0000 (10:15 +0300)
images.qrc
src/engine/engine.cpp
src/facebookservice/facebookauthentication.cpp
src/src.pro
src/ui/mainwindow.cpp
src/ui/mapviewscreen.h

index 2d3b0d4..858cf39 100644 (file)
@@ -13,6 +13,8 @@
         <file>res/images/refresh_s.png</file>
         <file>res/images/send_position.png</file>
         <file>res/images/send_position_s.png</file>
+        <file>res/images/show_position.png</file>
+        <file>res/images/show_position_s.png</file>
         <file>res/images/side_bar_left.png</file>
         <file>res/images/side_bar_right.png</file>
         <file>res/images/sliding_bar_left.png</file>
@@ -24,8 +26,6 @@
         <file>res/images/list_item_bottom.png</file>
         <file>res/images/list_item_middle.png</file>
         <file>res/images/list_item_top.png</file>
-        <file>res/images/show_position.png</file>
-        <file>res/images/show_position_s.png</file>
                <file>res/dummy/nmealog.txt</file>
     </qresource>
 </RCC>
index 1a6d116..0ebc402 100644 (file)
@@ -74,9 +74,12 @@ SituareEngine::SituareEngine(QMainWindow *parent)
     connect(m_ui, SIGNAL(refreshUserData()),
             this, SLOT(refreshUserData()));
 
-    connect(m_gps, SIGNAL(timeout()), m_ui, SLOT(gpsTimeout()));
-    connect(m_gps, SIGNAL(error(QString)), m_ui, SLOT(gpsError(QString)));
-    connect(m_ui, SIGNAL(enableGPS(bool)), this, SLOT(enableGPS(bool)));
+    connect(m_gps, SIGNAL(timeout()),
+            m_ui, SLOT(gpsTimeout()));
+    connect(m_gps, SIGNAL(error(QString)),
+            m_ui, SLOT(gpsError(QString)));
+    connect(m_ui, SIGNAL(enableGPS(bool)),
+            this, SLOT(enableGPS(bool)));
     connect(m_gps, SIGNAL(position(QPointF)),
             m_ui, SIGNAL(positionReceived(QPointF)));
 
index 8ca5ea5..8dbaf02 100644 (file)
@@ -38,7 +38,8 @@ FacebookAuthentication::FacebookAuthentication(QWidget *parent)
     m_email(),
     m_loginAttempts(0),
     m_password(),
-    m_refresh(0)
+    m_refresh(0),
+    m_webView(0)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -54,6 +55,9 @@ FacebookAuthentication::~FacebookAuthentication()
 {
     qDebug() << __PRETTY_FUNCTION__;
 
+    if(m_webView)
+        delete m_webView;
+
     delete m_mainlayout;
 }
 
@@ -67,10 +71,11 @@ void FacebookAuthentication::loginDialogDone(const QString &email, const QString
 
 void FacebookAuthentication::start()
 {
-    qDebug() << __PRETTY_FUNCTION__;    
-    if (!verifyCredentials(m_loginCredentials)){
+    qDebug() << __PRETTY_FUNCTION__;
+
+    if (!verifyCredentials(m_loginCredentials)) {
 
-        m_webView = new QWebView(this);
+        m_webView = new QWebView;
         m_loginDialog = new LoginDialog(this);
 
         connect(m_webView, SIGNAL(urlChanged(const QUrl &)),
@@ -82,7 +87,7 @@ void FacebookAuthentication::start()
                 this, SLOT(loginDialogDone(QString,QString)));
 
         if(m_loginDialog->exec() != QDialog::Accepted) {
-            // if login dialog was canceled we need to stop processing webview            
+            // if login dialog was canceled we need to stop processing webview
             // stop and disconnect m_webView;
             m_webView->stop();
             disconnect(m_webView, SIGNAL(loadFinished(bool)),
@@ -105,8 +110,8 @@ void FacebookAuthentication::start()
         toggleProgressIndicator(true);
         m_refresh = true;
         setCentralWidget(m_webView);
-        this->show();
         m_webView->hide();
+        this->show();
     }
     else
         emit credentialsReady(m_loginCredentials);
index 91ba69d..926725e 100644 (file)
@@ -81,7 +81,6 @@ HEADERS += ui/mainwindow.h \
     gps/gpspositioninterface.h
 QT += network \
     webkit
-
 DEFINES += QT_NO_DEBUG_OUTPUT
 
 !maemo5 {
@@ -90,7 +89,6 @@ DEFINES += QT_NO_DEBUG_OUTPUT
     message(QJson built in)
     message(Make sure you have QJson development headers installed)
     message(install headers with: sudo apt-get install libqjson-dev)
-
 }
 maemo5 {
     SOURCES += gps/gpsposition.cpp
index a6274ea..92ec8b4 100644 (file)
@@ -77,6 +77,7 @@ void MainWindow::toggleProgressIndicator(bool value)
 void MainWindow::createMenus()
 {
     qDebug() << __PRETTY_FUNCTION__;
+
     m_toSettingsAct = new QAction(tr("Settings"), this);
     m_toSettingsAct->setObjectName(tr("Settings"));
     connect(m_toSettingsAct, SIGNAL(triggered()), this, SLOT(openSettingsDialog()));
index 9034622..f62cc54 100644 (file)
@@ -49,7 +49,6 @@ public:
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
-
 private slots:
 
     /**
@@ -97,7 +96,6 @@ signals:
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
-
 private:
     bool m_autoCenteringEnabled;        ///< Enable
     FriendListPanel *friendsListPanel; ///< Instance of friends list panel