poi-yelp: fix up formating in source
[apps/poi-yelp.git] / MainApp.cpp
index d5de395..cbf6d57 100644 (file)
@@ -98,7 +98,6 @@ MainApp::MainApp():QMainWindow(Q_NULLPTR, Qt::FramelessWindowHint),
     if (getenv("AGL_NAVI"))
         isAglNavi = true;
 
-    connect(this, SIGNAL(allSessionsGotSignal()), this, SLOT(allSessionsGot()));
     connect(this, SIGNAL(positionGotSignal()), this, SLOT(positionGot()));
     connect(this, SIGNAL(allRoutesGotSignal()), this, SLOT(allRoutesGot()));
     connect(this, SIGNAL(routeCreatedSignal()), this, SLOT(routeCreated()));
@@ -273,6 +272,10 @@ void MainApp::textAdded(const QString & text)
 {
     mutex.lock();
     lineEdit.setText(lineEdit.text() + text);
+
+    // be sure any text is visible on initial input
+    lineEdit.setVisible(true);
+
     mutex.unlock();
 }
 
@@ -634,36 +637,36 @@ void MainApp::networkReplySearch(QNetworkReply* reply)
     /* memorize the text which gave this result: */
     currentSearchedText = lineEdit.text();
 
-       if (reply->error() == QNetworkReply::NoError)
-       {
-           // we only handle this callback if it matches the last search request:
-           if (reply != pSearchReply)
-           {
-               TRACE_INFO("this reply is already too late (or about a different network request)");
-               mutex.unlock();
-               return;
-           }
+    if (reply->error() == QNetworkReply::NoError)
+    {
+        // we only handle this callback if it matches the last search request:
+        if (reply != pSearchReply)
+        {
+            TRACE_INFO("this reply is already too late (or about a different network request)");
+            mutex.unlock();
+            return;
+        }
 
-       buflen = reply->read(buf, BIG_BUFFER_SIZE-1);
-           buf[buflen] = '\0';
+        buflen = reply->read(buf, BIG_BUFFER_SIZE-1);
+        buf[buflen] = '\0';
 
-           if (buflen == 0)
-           {
-               mutex.unlock();
-               return;
-           }
+        if (buflen == 0)
+        {
+            mutex.unlock();
+            return;
+        }
 
 
 
-           currentIndex = 0;
-           Businesses.clear();
-           ParseJsonBusinessList(buf, Businesses);
-           DisplayResultList(true);
-           FillResultList(Businesses);
+        currentIndex = 0;
+        Businesses.clear();
+        ParseJsonBusinessList(buf, Businesses);
+        DisplayResultList(true);
+        FillResultList(Businesses);
     }
     else
     {
-       fprintf(stderr,"POI: reply error network please check to poikey and system time (adjusted?)\n");
+        fprintf(stderr,"POI: reply error network please check to poikey and system time (adjusted?)\n");
     }
 
     mutex.unlock();
@@ -865,8 +868,8 @@ int MainApp::AuthenticatePOI(const QString & CredentialsFile)
 
     /* Then, send a HTTP request to get the token and wait for answer (synchronously): */
 
-       token = AppSecret;
-       return 0;
+    token = AppSecret;
+    return 0;
 }
 
 int MainApp::StartMonitoringUserInput()
@@ -927,8 +930,6 @@ void MainApp::getAllSessions_reply(const std::map< uint32_t, std::string >& allS
     TRACE_INFO("Current session: %d", this->navicoreSession);
 
     mutex.unlock();
-
-    emit allSessionsGotSignal();
 }
 
 
@@ -985,15 +986,6 @@ void MainApp::createRoute_reply(uint32_t routeHandle)
     emit routeCreatedSignal();
 }
 
-void MainApp::allSessionsGot()
-{
-    mutex.lock();
-
-    // nothing to do
-
-    mutex.unlock();
-}
-
 void MainApp::positionGot()
 {
     mutex.lock();