Changeset 6031

Show
Ignore:
Timestamp:
01/13/08 02:17:31 (10 months ago)
Author:
eugene
Message:

Switched to stable sorting of messages vector and simplified the source a bit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/qt-gui_qt4/src/userevents/usersendcommon.cpp

    r5937 r6031  
    8181using std::pair; 
    8282using std::make_pair; 
    83 using std::binary_function; 
    8483using namespace LicqQtGui; 
    8584/* TRANSLATOR LicqQtGui::UserSendCommon */ 
     
    8988typedef pair<CUserEvent*, char*> messagePair; 
    9089 
    91 struct orderMessagePairs 
    92   : public binary_function<const messagePair&, const messagePair&, bool> 
    93 { 
    94   bool operator()(const messagePair& mp1, const messagePair& mp2) 
    95   { 
    96     return (mp1.first->Time() <= mp2.first->Time()); 
    97   } 
    98 }; 
     90bool orderMessagePairs(const messagePair& mp1, const messagePair& mp2) 
     91{ 
     92  return (mp1.first->Time() < mp2.first->Time()); 
     93} 
    9994 
    10095UserSendCommon::UserSendCommon(int type, QString id, unsigned long ppid, QWidget* parent, const char* name) 
     
    365360 
    366361      // Sort the messages by time 
    367       sort(messages.begin(), messages.end(), orderMessagePairs()); 
     362      stable_sort(messages.begin(), messages.end(), orderMessagePairs); 
    368363 
    369364      // Now, finally add them