Changeset 5438
- Timestamp:
- 09/26/07 06:09:00 (14 months ago)
- Files:
-
- 1 modified
-
trunk/qt-gui/src/userbox.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt-gui/src/userbox.cpp
r5328 r5438 1706 1706 QRect r(itemRect(item)); 1707 1707 ICQUser *u = gUserManager.FetchUser(item->m_szId, item->m_nPPID, LOCK_R); 1708 QTextCodec * codec = UserCodec::codecForICQUser(u); 1708 1709 1709 QString strFileName = ""; 1710 1710 if (u && u->GetPicturePresent() && gMainWindow->m_bPopPicture) 1711 1711 { 1712 const QString file = QString("%1/%2/%3.pic").arg(BASE_DIR).arg(USER_DIR).arg(u->IdString()); 1712 const QString file = 1713 QString("%1/%2/%3.pic").arg(BASE_DIR).arg(USER_DIR).arg(u->IdString()); 1713 1714 const QImage picture = QImage(file); 1714 1715 if (!picture.isNull()) … … 1719 1720 } 1720 1721 1721 QString s = strFileName + QString("<nobr>") + QString(ICQUser::StatusToStatusStr(item->m_nStatus, item->m_bStatusInvisible)) 1722 + QString("</nobr>"); 1723 1724 if (*u->GetAlias() && gMainWindow->m_bPopAlias) 1722 QString s = strFileName + QString("<nobr>") + 1723 QString(ICQUser::StatusToStatusStr(item->m_nStatus, 1724 item->m_bStatusInvisible)) + 1725 QString("</nobr>"); 1726 1727 QTextCodec* codec = UserCodec::defaultEncoding(); 1728 if (u != NULL) 1729 codec = UserCodec::codecForICQUser(u); 1730 1731 if (u && *u->GetAlias() && gMainWindow->m_bPopAlias) 1725 1732 s += tr("<br><nobr>") + QString::fromUtf8(u->GetAlias()) + tr("</nobr>"); 1726 1733 1727 if ( (*u->GetFirstName() || *u->GetLastName()) && gMainWindow->m_bPopName)1734 if (u && (*u->GetFirstName() || *u->GetLastName()) && gMainWindow->m_bPopName) 1728 1735 { 1729 1736 s += tr("<br><nobr>"); … … 1764 1771 s += tr("<br>Custom Auto Response"); 1765 1772 1766 if (u != NULL) 1767 { 1768 if (!u->StatusOffline() && u->ClientInfo() && *u->ClientInfo()) 1773 if (u && !u->StatusOffline() && u->ClientInfo() && *u->ClientInfo()) 1769 1774 s += tr("<br><nobr>") + codec->toUnicode(u->ClientInfo()) + tr("</nobr>"); 1770 1775 1771 if (u->AutoResponse() && *u->AutoResponse() && 1772 item->m_nStatus != ICQ_STATUS_OFFLINE && 1773 item->m_nStatus != ICQ_STATUS_ONLINE) 1774 s += tr("<br><u>Auto Response:</u>") + codec->toUnicode(u->AutoResponse()); 1775 gUserManager.DropUser(u); 1776 } 1777 1778 if (*u->GetEmailPrimary() && gMainWindow->m_bPopEmail) 1779 s += tr("<br><nobr>E: ") + codec->toUnicode(u->GetEmailPrimary()) + tr("</nobr>"); 1780 1781 if (item->m_bPhone && gMainWindow->m_bPopPhone) 1782 s += tr("<br><nobr>P: ") + codec->toUnicode(u->GetPhoneNumber()) + tr("</nobr>"); 1783 1784 if (item->m_bCellular && gMainWindow->m_bPopCellular) 1785 s += tr("<br><nobr>C: ") + codec->toUnicode(u->GetCellularNumber()) + tr("</nobr>"); 1786 1787 if ((u->GetFaxNumber()[0]!='\0') && gMainWindow->m_bPopEmail) 1788 s += tr("<br><nobr>F: ") + codec->toUnicode(u->GetFaxNumber()) + tr("</nobr>"); 1789 1790 if ((u->Ip() || u->IntIp()) && gMainWindow->m_bPopIP) { 1776 if (u && u->AutoResponse() && *u->AutoResponse() && 1777 item->m_nStatus != ICQ_STATUS_OFFLINE && 1778 item->m_nStatus != ICQ_STATUS_ONLINE) 1779 s += tr("<br><u>Auto Response:</u>") + codec->toUnicode(u->AutoResponse()); 1780 1781 if (u && *u->GetEmailPrimary() && gMainWindow->m_bPopEmail) 1782 s += tr("<br><nobr>E: ") + codec->toUnicode(u->GetEmailPrimary()) + 1783 tr("</nobr>"); 1784 1785 if (u && item->m_bPhone && gMainWindow->m_bPopPhone) 1786 s += tr("<br><nobr>P: ") + codec->toUnicode(u->GetPhoneNumber()) + 1787 tr("</nobr>"); 1788 1789 if (u && item->m_bCellular && gMainWindow->m_bPopCellular) 1790 s += tr("<br><nobr>C: ") + codec->toUnicode(u->GetCellularNumber()) + 1791 tr("</nobr>"); 1792 1793 if (u && (u->GetFaxNumber()[0]!='\0') && gMainWindow->m_bPopEmail) 1794 s += tr("<br><nobr>F: ") + codec->toUnicode(u->GetFaxNumber()) + 1795 tr("</nobr>"); 1796 1797 if (u && (u->Ip() || u->IntIp()) && gMainWindow->m_bPopIP) 1798 { 1791 1799 char buf_ip[32]; 1792 1800 char buf_int_ip[32]; … … 1799 1807 } 1800 1808 1801 if ((u->LastOnline()>0) && gMainWindow->m_bPopLastOnline) { 1809 if (u && (u->LastOnline()>0) && gMainWindow->m_bPopLastOnline) 1810 { 1802 1811 QDateTime t; 1803 1812 t.setTime_t(u->LastOnline()); … … 1806 1815 } 1807 1816 1808 if ((!u->StatusOffline()) && gMainWindow->m_bPopOnlineSince) { 1817 if (u && (!u->StatusOffline()) && gMainWindow->m_bPopOnlineSince) 1818 { 1809 1819 time_t nLoggedIn = time(0) - u->OnlineSince(); 1810 1820 unsigned long nWeek, nDay, nHour, nMinute; … … 1848 1858 if (gMainWindow->m_bPopIdleTime) 1849 1859 { 1850 if (u ->IdleSince())1860 if (u && u->IdleSince()) 1851 1861 { 1852 1862 char *szTemp; … … 1858 1868 } 1859 1869 1860 if ( gMainWindow->m_bPopLocalTime)1870 if (u && gMainWindow->m_bPopLocalTime) 1861 1871 { 1862 1872 char *szTemp; … … 1867 1877 } 1868 1878 1869 if ( gMainWindow->m_bPopID)1879 if (u && gMainWindow->m_bPopID) 1870 1880 { 1871 1881 char *szTemp; … … 1876 1886 } 1877 1887 1888 gUserManager.DropUser(u); 1889 1878 1890 tip(r, s); 1879 1891 }
