Log In
New Account
  
Home My Page Project Cloud Code Snippets Project Openings Jenirok
Summary Tracker SCM Files
authoreshe <jessehakanen@gmail.com>
Wed, 11 Aug 2010 09:42:40 +0000 (10:42 +0100)
committereshe <jessehakanen@gmail.com>
Wed, 11 Aug 2010 09:42:40 +0000 (10:42 +0100)
src/common/contactmanager.cpp
src/common/contactmanager.h
src/gui/detailwindow.cpp
src/gui/detailwindow.h

index 67cd7ca..cf459b4 100644 (file)
@@ -85,7 +85,7 @@ bool ContactManager::addContact(Contact const& contact)
     {
         addr = g_new0 (EContactAddress, 1);
         addr->address_format = g_strdup("");
-        addr->po = g_strdup(contact.streetNumber.toUtf8().data());
+        addr->po = g_strdup("");
         addr->ext = g_strdup("");
         addr->region = g_strdup("");
         addr->code = g_strdup(contact.zipCode.toUtf8().data());
index 0c42e6b..9a27b88 100644 (file)
@@ -33,7 +33,6 @@ public:
         QString name;
         QString number;
         QString street;
-        QString streetNumber;
         QString zipCode;
         QString city;
         QString country;
index 12d5ef7..39cc7bf 100644 (file)
@@ -154,8 +154,10 @@ void DetailWindow::addToContacts()
 
     ContactManager cm;
     ContactManager::Contact contact;
-    getDetails(contact.street, contact.streetNumber,
-               contact.zipCode, contact.city);
+    QString number;
+    QString street;
+    getDetails(street, number,
+               contact.zipCode, contact.city, contact.street);
     contact.name = addContactInput_->text();
     contact.number = numberButton_->valueText();
     contact.country = country_;
@@ -222,8 +224,9 @@ void DetailWindow::openMaps()
     OviMaps maps;
 
     OviMaps::Address addr;
+    QString streetAndNumber;
     getDetails(addr.street, addr.number,
-               addr.zipCode, addr.city);
+               addr.zipCode, addr.city, streetAndNumber);
     addr.country = country_;
 
     //qDebug() << addr.street << addr.number << addr.zipCode << addr.city << addr.country;
@@ -237,11 +240,14 @@ void DetailWindow::openMaps()
 }
 
 void DetailWindow::getDetails(QString& street, QString& streetNumber,
-                              QString& zip, QString& city)
+                              QString& zip, QString& city, QString& streetAndNumber)
 {
     int pos = 0;
 
     QString streetVal = streetButton_->valueText();
+    streetVal = streetVal.replace("Str.", QString::fromUtf8("Straße"));
+    streetVal = streetVal.replace("str.", QString::fromUtf8("straße"));
+    streetAndNumber = streetVal;
     QString cityVal = cityButton_->valueText();
     city = cityVal;
 
@@ -285,8 +291,6 @@ void DetailWindow::getDetails(QString& street, QString& streetNumber,
     }
 
     streetNumber = streetNumber.trimmed();
-    street = street.replace("Str.", QString::fromUtf8("Straße"));
-    street = street.replace("str.", QString::fromUtf8("straße"));
     street = street.trimmed();
 
     if((pos = cityVal.indexOf(" ")) > 0)
index a2831c4..e2c545c 100644 (file)
@@ -49,7 +49,7 @@ private slots:
 
 private:
     void getDetails(QString& street, QString& streetNumber,
-                    QString& zip, QString& city);
+                    QString& zip, QString& city, QString& streetAndNumber);
     QWidget* area_;
     QVBoxLayout* layout_;
     QMaemo5ValueButton* nameButton_;

Terms of Use    Privacy Policy    Contribution Guidelines    Feedback

Powered By GForge Collaborative Development Environment