Show
Ignore:
Timestamp:
03/15/08 06:23:52 (9 months ago)
Author:
flynd
Message:

Let user menu and event dialog user same enum for event type so we don't have to convert between them.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt4-gui/src/views/userviewbase.cpp

    r5892 r6097  
    5454static T* getSendEventDialog(EventType type, QString id, unsigned long ppid) 
    5555{ 
    56   int function; 
    57   if (type == ET_CONTACT) 
    58     function = mnuUserSendContact; 
    59   else if (type == ET_FILE) 
    60     function = mnuUserSendFile; 
    61   else if (type == ET_MESSAGE) 
    62     function = mnuUserSendMsg; 
    63   else if (type == ET_URL) 
    64     function = mnuUserSendUrl; 
    65   else 
    66     return NULL; 
    67  
    68   UserEventCommon* common = LicqGui::instance()->showEventDialog(function, id, ppid); 
     56  UserEventCommon* common = LicqGui::instance()->showEventDialog(type, id, ppid); 
    6957  if (!common) 
    7058    return NULL; 
     
    7866 
    7967    base->changeEventType(type); 
    80     dialog = dynamic_cast<T*>(LicqGui::instance()->showEventDialog(function, id, ppid)); 
     68    dialog = dynamic_cast<T*>(LicqGui::instance()->showEventDialog(type, id, ppid)); 
    8169    if (!dialog) 
    8270      return NULL; 
     
    8977static inline UserSendContactEvent* getSendContactEventDialog(QString id, unsigned long ppid) 
    9078{ 
    91   return getSendEventDialog<UserSendContactEvent>(ET_CONTACT, id, ppid); 
     79  return getSendEventDialog<UserSendContactEvent>(ContactEvent, id, ppid); 
    9280} 
    9381 
    9482static inline UserSendFileEvent* getSendFileEventDialog(QString id, unsigned long ppid) 
    9583{ 
    96   return getSendEventDialog<UserSendFileEvent>(ET_FILE, id, ppid); 
     84  return getSendEventDialog<UserSendFileEvent>(FileEvent, id, ppid); 
    9785} 
    9886 
    9987static inline UserSendMsgEvent* getSendMsgEventDialog(QString id, unsigned long ppid) 
    10088{ 
    101   return getSendEventDialog<UserSendMsgEvent>(ET_MESSAGE, id, ppid); 
     89  return getSendEventDialog<UserSendMsgEvent>(MessageEvent, id, ppid); 
    10290} 
    10391 
    10492static inline UserSendUrlEvent* getSendUrlEventDialog(QString id, unsigned long ppid) 
    10593{ 
    106   return getSendEventDialog<UserSendUrlEvent>(ET_URL, id, ppid); 
     94  return getSendEventDialog<UserSendUrlEvent>(UrlEvent, id, ppid); 
    10795} 
    10896