Merge branch 'master' into error_procedur
authorlampehe-local <henri.lampela@ixonos.com>
Thu, 10 Jun 2010 10:43:05 +0000 (13:43 +0300)
committerlampehe-local <henri.lampela@ixonos.com>
Thu, 10 Jun 2010 10:43:05 +0000 (13:43 +0300)
Conflicts:
src/engine/engine.cpp
src/gps/gpsposition.h
src/situareservice/situareservice.cpp

1  2 
src/engine/engine.cpp

@@@ -201,47 -200,13 +201,47 @@@ void SituareEngine::enableAutomaticLoca
      }
  }
  
 -void SituareEngine::error(const QString &error)
 +void SituareEngine::error(const int error)
  {
-     qDebug() << __PRETTY_FUNCTION__;
+     qDebug() << __PRETTY_FUNCTION__;    
  
 -    m_ui->buildInformationBox(error, true);
 +    switch(error)
 +    {
 +    case QNetworkReply::ConnectionRefusedError:
 +        m_ui->buildInformationBox(tr("Connection refused by the server"), true);
 +        break;
 +    case QNetworkReply::RemoteHostClosedError:
 +        m_ui->buildInformationBox(tr("Connection closed by the server"), true);
 +        break;
 +    case QNetworkReply::HostNotFoundError:
 +        m_ui->buildInformationBox(tr("Remote server not found"), true);
 +        break;
 +    case QNetworkReply::TimeoutError:
 +        m_ui->buildInformationBox(tr("Connection timed out"), true);
 +        break;
 +    case SituareError::SESSION_EXPIRED:
 +        m_ui->buildInformationBox(tr("Session expired. Please login again"), true);
 +        break;
 +    case SituareError::LOGIN_FAILED:
 +        m_ui->buildInformationBox(tr("Invalid E-mail address or password"), true);
 +        break;
 +    case SituareError::UPDATE_FAILED:
 +        m_ui->buildInformationBox(tr("Update failed, please try again"), true);
 +        break;
 +    case SituareError::DATA_RETRIEVAL_FAILED:
 +        m_ui->buildInformationBox(tr("Data retrieval failed, please try again"), true);
 +        break;
 +    case SituareError::ADDRESS_RETRIEVAL_FAILED:
 +        m_ui->buildInformationBox(tr("Address retrieval failed, please try again"), true);
 +        break;
 +    case SituareError::DOWNLOAD_FAILED:
 +        m_ui->buildInformationBox(tr("Image download failed"), true);
 +        break;
 +    default:
 +        break;
 +    }
  
 -    if(error.compare(SESSION_EXPIRED) == 0) {
 +    if(error == SituareError::SESSION_EXPIRED) {
          m_facebookAuthenticator->clearAccountInformation(true); // keep username = true
          m_ui->loggedIn(false);
          m_ui->loginFailed();