-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

the attached patch makes current licq CVS compile with Qt 3.x (even with 
QT_NO_COMPAT defined). Hope it helps.

- - Frerich

P.S.: I'm not subscribed to licq-devel, it'd be kind if you'd CC me in case 
there are any issues.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9ED0yKrbzRexv2VkRAnP/AJsEQp4OCd+y14W6V7hIiSAnDbvhhgCeKDVx
YzxQ6kBgrkx3Inq44z3NuKI=
=Z/tZ
-----END PGP SIGNATURE-----
? qt-gui-3.0.diff
Index: chatdlg.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/chatdlg.cpp,v
retrieving revision 1.67
diff -u -3 -p -r1.67 chatdlg.cpp
--- chatdlg.cpp	15 Dec 2001 12:53:18 -0000	1.67
+++ chatdlg.cpp	23 May 2002 16:13:18 -0000
@@ -129,7 +129,11 @@ ChatDlg::ChatDlg(unsigned long _nUin, CI
 
   setOpaqueMoving(true);
   setToolBarsMovable(true);
+#if QT_VERSION < 300
   setDockEnabled(Bottom, true);
+#else
+  setDockEnabled(DockBottom, true);
+#endif
   setUsesBigPixmaps(false);
 
   // Pane mode setup
Index: ewidgets.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/ewidgets.cpp,v
retrieving revision 1.57
diff -u -3 -p -r1.57 ewidgets.cpp
--- ewidgets.cpp	17 May 2002 14:55:16 -0000	1.57
+++ ewidgets.cpp	23 May 2002 16:13:19 -0000
@@ -161,7 +161,11 @@ void CELabel::setNamedBgColor(char *theC
    QPalette pal(palette());
 // Since Qt sucks we have to use this cheap hack instead of the documented
 // and correct way to set the color
+#if QT_VERSION < 300
    QColorGroup normal(pal.normal());
+#else
+   QColorGroup normal(pal.active()); 
+#endif
    QColorGroup newNormal(normal.foreground(), c, normal.light(), normal.dark(),
                          normal.mid(), normal.text(), normal.base());
    pal = QPalette(newNormal, newNormal, newNormal);
@@ -317,7 +321,11 @@ void CEButton::setNamedFgColor(char *the
    if (theColor == NULL) return;
 
    QPalette pal(palette());
+#if QT_VERSION < 300
    QColorGroup normal(pal.normal());
+#else
+   QColorGroup normal(pal.active());
+#endif
    QColorGroup newNormal(normal.foreground(), normal.background(), normal.light(), normal.dark(),
                          normal.mid(), QColor(theColor), normal.base());
    setPalette(QPalette(newNormal, pal.disabled(), newNormal));
@@ -328,7 +336,11 @@ void CEButton::setNamedBgColor(char *the
    if (theColor == NULL) return;
 
    QPalette pal(palette());
+#if QT_VERSION < 300
    QColorGroup normal(pal.normal());
+#else
+   QColorGroup normal(pal.active());
+#endif
    QColorGroup newNormal(normal.foreground(), QColor(theColor), normal.light(), normal.dark(),
                          normal.mid(), normal.text(), normal.base());
    setPalette(QPalette(newNormal, pal.disabled(), newNormal));
@@ -343,7 +355,11 @@ CEComboBox::CEComboBox(bool _bAppearEnab
    if (m_bAppearEnabledAlways)
    {
       QPalette pal(palette());
+#if QT_VERSION < 300
       setPalette(QPalette(pal.normal(), pal.normal(), pal.normal()));
+#else
+      setPalette(QPalette(pal.active(), pal.active(), pal.active()));
+#endif
    }
 }
 
@@ -353,7 +369,11 @@ void CEComboBox::setNamedFgColor(char *t
    if (theColor == NULL) return;
 
    QPalette pal(palette());
+#if QT_VERSION < 300
    QColorGroup normal(pal.normal());
+#else
+   QColorGroup normal(pal.active());
+#endif
    QColorGroup newNormal(normal.foreground(), normal.background(), normal.light(), normal.dark(),
                          normal.mid(), QColor(theColor), normal.base());
    setPalette(QPalette(newNormal, pal.disabled(), newNormal));
@@ -365,7 +385,11 @@ void CEComboBox::setNamedBgColor(char *t
    if (theColor == NULL) return;
 
    QPalette pal(palette());
+#if QT_VERSION < 300
    QColorGroup normal(pal.normal());
+#else
+   QColorGroup normal(pal.active());
+#endif
    QColorGroup newNormal(normal.foreground(), normal.background(), normal.light(), normal.dark(),
                          normal.mid(), normal.text(), QColor(theColor));
    setPalette(QPalette(newNormal, pal.disabled(), newNormal));
@@ -377,7 +401,11 @@ CInfoField::CInfoField(QWidget *parent, 
   : QLineEdit(parent)
 {
   baseRO = palette().disabled().base();
+#if QT_VERSION < 300
   baseRW = palette().normal().base();
+#else
+  baseRW = palette().active().base();
+#endif
 
   // Set colors
   SetReadOnly(readonly);
@@ -385,6 +413,7 @@ CInfoField::CInfoField(QWidget *parent, 
 
 void CInfoField::SetReadOnly(bool b)
 {
+#if QT_VERSION < 300
   QColorGroup cg(palette().normal().foreground(),
                  palette().normal().background(),
                  palette().normal().light(),
@@ -392,6 +421,15 @@ void CInfoField::SetReadOnly(bool b)
                  palette().normal().mid(),
                  palette().normal().text(),
                  b ? baseRO : baseRW);
+#else
+  QColorGroup cg(palette().active().foreground(),
+                 palette().active().background(),
+                 palette().active().light(),
+                 palette().active().dark(),
+                 palette().active().mid(),
+                 palette().active().text(),
+                 b ? baseRO : baseRW);
+#endif
 
   setPalette(QPalette(cg, palette().disabled(), cg));
   setReadOnly(b);
Index: mainwin.cpp
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.cpp,v
retrieving revision 1.229
diff -u -3 -p -r1.229 mainwin.cpp
--- mainwin.cpp	15 May 2002 09:29:37 -0000	1.229
+++ mainwin.cpp	23 May 2002 16:13:20 -0000
@@ -1223,7 +1223,11 @@ void CMainWindow::slot_updatedList(CICQS
       updateEvents();
       // If their box is open, kill it
       {
+#if QT_VERSION < 300
         QListIterator<UserViewEvent> it(licqUserView);
+#else
+        QPtrListIterator<UserViewEvent> it(licqUserView);
+#endif
         for (; it.current() != NULL; ++it)
         {
           if ((*it)->Uin() == sig->Uin())
@@ -1236,7 +1240,11 @@ void CMainWindow::slot_updatedList(CICQS
       }
       {
         // if their info box is open, kill it
+#if QT_VERSION < 300
         QListIterator<UserInfoDlg> it(licqUserInfo);
+#else
+        QPtrListIterator<UserInfoDlg> it(licqUserInfo);
+#endif
         for(; it.current() != NULL; ++it)
         {
           if((*it)->Uin() == sig->Uin())
@@ -1249,7 +1257,11 @@ void CMainWindow::slot_updatedList(CICQS
       }
       {
         // if their send box is open, kill it
+#if QT_VERSION < 300
         QListIterator<UserSendCommon> it(licqUserSend);
+#else
+        QPtrListIterator<UserSendCommon> it(licqUserSend);
+#endif
         for(; it.current() != NULL; ++it)
         {
           if((*it)->Uin() == sig->Uin())
@@ -1780,7 +1792,11 @@ void CMainWindow::callInfoTab(int fcn, u
   if(nUin == 0) return;
 
   UserInfoDlg *f = NULL;
+#if QT_VERSION < 300
   QListIterator<UserInfoDlg> it(licqUserInfo);
+#else
+  QPtrListIterator<UserInfoDlg> it(licqUserInfo);
+#endif
 
   for(; it.current(); ++it)
   {
@@ -1865,7 +1881,11 @@ UserEventCommon *CMainWindow::callFuncti
   {
     case mnuUserView:
     {
+#if QT_VERSION < 300
       QListIterator<UserViewEvent> it(licqUserView);
+#else
+      QPtrListIterator<UserViewEvent> it(licqUserView);
+#endif
 
       for (; it.current(); ++it)
         if ((*it)->Uin() == nUin) {
@@ -1889,7 +1909,11 @@ UserEventCommon *CMainWindow::callFuncti
     case mnuUserSendContact:
     case mnuUserSendSms:
     {
+#if QT_VERSION < 300
         QListIterator<UserSendCommon> it(licqUserSend );
+#else
+        QPtrListIterator<UserSendCommon> it(licqUserSend);
+#endif
 
         if ( !m_bMsgChatView ) break;
 
@@ -1916,7 +1940,11 @@ UserEventCommon *CMainWindow::callFuncti
   {
     case mnuUserView:
     {
+#if QT_VERSION < 300
       QListIterator<UserViewEvent> it(licqUserView);
+#else
+      QPtrListIterator<UserViewEvent> it(licqUserView);
+#endif
 
       for (; it.current(); ++it)
       {
@@ -1996,7 +2024,11 @@ UserEventCommon *CMainWindow::callFuncti
 
 void CMainWindow::UserInfoDlg_finished(unsigned long nUin)
 {
+#if QT_VERSION < 300
   QListIterator<UserInfoDlg> it(licqUserInfo);
+#else
+  QPtrListIterator<UserInfoDlg> it(licqUserInfo);
+#endif
 
   for( ; it.current(); ++it){
     if((*it)->Uin() == nUin) {
@@ -2014,7 +2046,11 @@ void CMainWindow::UserInfoDlg_finished(u
 
 void CMainWindow::slot_userfinished(unsigned long nUin)
 {
+#if QT_VERSION < 300
   QListIterator<UserViewEvent> it(licqUserView);
+#else
+  QPtrListIterator<UserViewEvent> it(licqUserView);
+#endif
 
   for ( ; it.current(); ++it)
   {
@@ -2030,7 +2066,11 @@ void CMainWindow::slot_userfinished(unsi
 
 void CMainWindow::slot_sendfinished(unsigned long nUin)
 {
+#if QT_VERSION < 300
   QListIterator<UserSendCommon> it(licqUserSend);
+#else
+  QPtrListIterator<UserSendCommon> it(licqUserSend);
+#endif
 
   // go through the whole list, there might be more than
   // one hit
Index: mainwin.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/mainwin.h,v
retrieving revision 1.83
diff -u -3 -p -r1.83 mainwin.h
--- mainwin.h	15 May 2002 09:30:44 -0000	1.83
+++ mainwin.h	23 May 2002 16:13:20 -0000
@@ -11,7 +11,11 @@
 #include <qmenubar.h>
 #endif
 
-#include <qlist.h>
+#if QT_VERSION < 300
+  #include <qlist.h>
+#else
+  #include <qptrlist.h>
+#endif
 #include <qwidget.h>
 #include <qtimer.h>
 #include <qbitmap.h>
@@ -47,9 +51,15 @@ class IconManager;
 class CICQSignal;
 class UserInfoDlg;
 
-typedef QList<UserViewEvent> UserViewEventList;
-typedef QList<UserInfoDlg> UserInfoList;
-typedef QList<UserSendCommon> UserSendEventList;
+#if QT_VERSION < 300
+  typedef QList<UserViewEvent> UserViewEventList;
+  typedef QList<UserInfoDlg> UserInfoList;
+  typedef QList<UserSendCommon> UserSendEventList;
+#else
+  typedef QPtrList<UserViewEvent> UserViewEventList;
+  typedef QPtrList<UserInfoDlg> UserInfoList;
+  typedef QPtrList<UserSendCommon> UserSendEventList;
+#endif
 
 //=====CMainWindow==============================================================
 class CMainWindow : public QWidget
Index: userbox.h
===================================================================
RCS file: /cvsroot/licq/qt-gui/src/userbox.h,v
retrieving revision 1.46
diff -u -3 -p -r1.46 userbox.h
--- userbox.h	6 Jan 2002 14:40:44 -0000	1.46
+++ userbox.h	23 May 2002 16:13:20 -0000
@@ -5,7 +5,11 @@
 
 #include <qlistview.h>
 #include <qtooltip.h>
-#include <qvector.h>
+#if QT_VERSION < 300
+  #include <qvector.h>
+#else
+  #include <qptrvector.h>
+#endif
 
 class ICQUser;
 class CUserView;
@@ -95,7 +99,11 @@ protected:
 };
 
 class CUserView;
-typedef QVector<CUserView> UserFloatyList;
+#if QT_VERSION < 300
+  typedef QVector<CUserView> UserFloatyList;
+#else
+  typedef QPtrVector<CUserView> UserFloatyList;
+#endif
 
 
 //=====UserView===============================================================

Reply via email to