Merge branch 'master' into situare_interact
[situare] / src / ui / userinfo.cpp
index 65be65a..0dc4dc4 100644 (file)
@@ -49,8 +49,7 @@ const int LABEL_MAX_WIDTH = BACKGROUND_WIDTH - ICON_WIDTH - 5 * MARGIN;
 UserInfo::UserInfo(QWidget *parent)
     : QWidget(parent),
       m_expanded(false),
-      m_tagsDialog(0),
-      m_updateLocation(0)
+      m_tagsDialog(0)
 {
     qDebug() << __PRETTY_FUNCTION__;
 
@@ -127,39 +126,11 @@ UserInfo::UserInfo(QWidget *parent)
     m_backgroundTopSelectedImage.load(":/res/images/list_item_top_selected.png");
     m_backgroundMiddleSelectedImage.load(":/res/images/list_item_middle_selected.png");
     m_backgroundBottomSelectedImage.load(":/res/images/list_item_bottom_selected.png");
-
-    restoreUnsendMessage();
 }
 
 UserInfo::~UserInfo()
 {
     qDebug() << __PRETTY_FUNCTION__;
-
-    QSettings settings(DIRECTORY_NAME, FILE_NAME);
-
-    if (!m_backupMessage.isEmpty()) {
-        settings.setValue(USER_UNSEND_MESSAGE, m_backupMessage.toAscii());
-        settings.setValue(USER_UNSEND_MESSAGE_PUBLISH, m_backupFacebookPublishPolicity);
-    } else {
-        settings.remove(USER_UNSEND_MESSAGE);
-        settings.remove(USER_UNSEND_MESSAGE_PUBLISH);
-    }
-}
-
-void UserInfo::backupUpdateLocationDialogData(const QString &status, bool publish)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_backupMessage = status;
-    m_backupFacebookPublishPolicity = publish;
-}
-
-void UserInfo::clearUpdateLocationDialogData()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    m_backupMessage.clear();
-    m_backupFacebookPublishPolicity = false;
 }
 
 void UserInfo::collapse()
@@ -176,31 +147,6 @@ void UserInfo::findButtonClicked()
     emit findUser(m_coordinates);
 }
 
-void UserInfo::messageUpdate()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    delete m_updateLocation;
-    m_updateLocation = new UpdateLocationDialog(m_backupMessage, m_backupFacebookPublishPolicity,
-                                                this);
-
-    connect(this, SIGNAL(reverseGeoReady(QString)),
-            m_updateLocation, SLOT(setAddress(QString)));
-
-    connect(m_updateLocation, SIGNAL(statusUpdate(QString, bool)),
-            this, SIGNAL(statusUpdate(QString, bool)));
-
-    connect(m_updateLocation, SIGNAL(statusUpdate(QString, bool)),
-            this, SLOT(backupUpdateLocationDialogData(QString, bool)));
-
-    connect(m_updateLocation, SIGNAL(finished(int)),
-            this, SLOT(updateLocationDialogFinished(int)));
-
-    m_updateLocation->show();
-
-    emit requestReverseGeo();
-}
-
 void UserInfo::mousePressEvent(QMouseEvent *event)
 {
     qDebug() << __PRETTY_FUNCTION__ << " " << event->pos();
@@ -253,15 +199,6 @@ void UserInfo::paintEvent(QPaintEvent *event)
     }
 }
 
-void UserInfo::restoreUnsendMessage()
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    QSettings settings(DIRECTORY_NAME, FILE_NAME);
-    m_backupMessage = settings.value(USER_UNSEND_MESSAGE, EMPTY).toString();
-    m_backupFacebookPublishPolicity = settings.value(USER_UNSEND_MESSAGE_PUBLISH, false).toBool();
-}
-
 void UserInfo::setAddress(const QString &address)
 {
     qDebug() << __PRETTY_FUNCTION__;
@@ -387,27 +324,3 @@ void UserInfo::tagsDialogFinished(int reason)
         m_tagsDialog = 0;
     }
 }
-
-void UserInfo::updateLocationDialogFinished(int reason)
-{
-    qDebug() << __PRETTY_FUNCTION__;
-
-    Q_UNUSED(reason);
-
-    if (m_updateLocation) {
-        disconnect(this, SIGNAL(reverseGeoReady(QString)),
-                m_updateLocation, SLOT(setAddress(QString)));
-
-        disconnect(m_updateLocation, SIGNAL(statusUpdate(QString,bool)),
-                this, SIGNAL(statusUpdate(QString,bool)));
-
-        disconnect(m_updateLocation, SIGNAL(statusUpdate(QString,bool)),
-                this, SLOT(backupUpdateLocationDialogData(QString,bool)));
-
-        disconnect(m_updateLocation, SIGNAL(finished(int)),
-                this, SLOT(updateLocationDialogFinished(int)));
-
-        m_updateLocation->deleteLater();
-        m_updateLocation = 0;
-    }
-}