Fix sorting of ThreadListItem 50/124850/2
authorDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 12 Apr 2017 15:43:24 +0000 (18:43 +0300)
committerDenis Dolzhenko <d.dolzhenko@samsung.com>
Wed, 12 Apr 2017 15:52:25 +0000 (18:52 +0300)
Change-Id: I21b6f71e0202a4be90189352a9c5153a0ff648e1
Signed-off-by: Denis Dolzhenko <d.dolzhenko@samsung.com>
src/Common/MsgEngine/src/MsgUtils.cpp
src/Common/View/inc/NoContentLayout.h
src/MsgThread/Controller/src/ThreadList.cpp

index 719ae002a241bb592d4ec04fc65c9679a5eae8fa..ce259b4cd4bebdf5f90299246161b0e63b8420bf 100644 (file)
@@ -134,7 +134,7 @@ bool isMms(Message::Type type)
     }
 }
 
-bool MsgUtils::isSms(Message::Type type)
+bool isSms(Message::Type type)
 {
     return type == Message::MT_SMS;
 }
index 2eb0bafe5719abf671917b1ec5da71f4ee92940e..c0c4072034c518a99da8b4f66130fcd113dae8a7 100644 (file)
@@ -27,8 +27,7 @@ namespace Msg
     * @brief A Layout that shows a message text when ThreadList is empty
     */
     class NoContentLayout
-        : public View
-    {
+        : public View {
         public:
             NoContentLayout(Evas_Object *parent);
             virtual ~NoContentLayout();
index 28ec73bf9b1bbd32416e8069a496b3dc449c0cd0..8a8c93f4de3f1dae0426e1caba18d25861e996f3 100644 (file)
@@ -117,12 +117,12 @@ void ThreadList::checkHandler(ThreadListItem &item)
 int ThreadList::cmpFunc(const ListItem &item1, const ListItem &item2)
 {
     bool isTh1 = isThreadItem(item1);
-    bool isTh2 = isThreadItem(item2);
+    bool isTh2 = isThreadItem(item2); // New inserted item
 
     if (!isTh1 && !isTh2)
         return 0;
 
-    if (isTh2) {
+    if (isTh2 && !isTh1) {
         auto *self = static_cast<ThreadList*>(item1.getOwner());
         return self->m_pBottomPadItem->isSame(item1) ? 1 : -1;
     }