Bug 485677 - qt-4.5-rc1: qhostaddress.h qpair-related issue
qt-4.5-rc1: qhostaddress.h qpair-related issue
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: qt (Show other bugs)
rawhide
All Linux
low Severity medium
: ---
: ---
Assigned To: Ngo Than
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-02-16 02:42 EST by Eric Tanguy
Modified: 2009-02-27 14:31 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-02-27 14:31:25 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
workaround undefined QPair (545 bytes, patch)
2009-02-22 14:46 EST, Rex Dieter
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Launchpad 332470 None None None Never

  None (edit)
Description Eric Tanguy 2009-02-16 02:42:32 EST
Description of problem:
a package build fine for F-10 : http://koji.fedoraproject.org/koji/taskinfo?taskID=1128601 and the same package fail for rawhide : http://koji.fedoraproject.org/koji/taskinfo?taskID=1128665 
It could be due to the recent introduction of qt-4.5-rc1 in rawhide ?

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 leigh scott 2009-02-21 10:20:02 EST
I am also having trouble building qbittorrent since the change to qt 4.5

https://bugs.launchpad.net/qbittorrent/+bug/332470

upstream seems to think it's a qt bug
Comment 2 Kevin Kofler 2009-02-21 19:25:36 EST
That is a completely separate issue. It should be in a separate bug report.

But I don't think your issue is a bug in Qt. Something must be "#define"ing "subnet" as a macro, which is a bad thing to do.
Comment 3 Rex Dieter 2009-02-22 12:30:19 EST
It's these 2 lines in qhostaddress.h (lines 122, 124):

    bool isInSubnet(const QPair<QHostAddress, int> &subnet) const;

    static QPair<QHostAddress, int> parseSubnet(const QString &subnet);

The problem seems to be the <QHostAddress, int> contructs by the looks of things.

A quick-n-dirty hack of commenting out those lines in qhostaddress.h allows qbittorrent to compile.


On the surface, those lines look wrong to me... a (sort of) recursive template?  but I'm far from being a master of c++-fu.
Comment 4 Rex Dieter 2009-02-22 12:38:13 EST
Heh, looks like QPair is undefined, adding
#include <QPair>
to /usr/include/QtNetwork/qhostaddress.h
does the trick.
Comment 5 Rex Dieter 2009-02-22 12:39:58 EST
Leigh, looks like adding to httpserver.cpp:
#include <QPair>
would be a workaround until we can get this fixed in qt properly.
Comment 6 Kevin Kofler 2009-02-22 12:45:13 EST
This report was originally about the scidavis failure before the qbittorrent maintainer hijacked it for his completely different bug!
Comment 7 Kevin Kofler 2009-02-22 12:52:01 EST
I just cloned this bug as bug 486866 for the original issue.

But next time please:
* do not hijack bug reports for unrelated issues!
* do not answer such hijackers (other than mentioning it's off topic as I did in comment #2)!
* clone the bug if you want to track it (but the reporter should be responsible for filing their own bug report)! (And I probably should have done that when I posted my comment #2.)
and especially:
* don't change the topic of the existing bug report to match the hijack!
Comment 8 Rex Dieter 2009-02-22 13:15:23 EST
sorry, comment #1 didn't mention which app was at issue (for posterity:  reporter, please do so ; commenters (including me), please double-check, and make summary clear).
Comment 9 Rex Dieter 2009-02-22 14:46:14 EST
Created attachment 332872 [details]
workaround undefined QPair
Comment 10 leigh scott 2009-02-22 18:12:09 EST
(In reply to comment #6)
> This report was originally about the scidavis failure before the qbittorrent
> maintainer hijacked it for his completely different bug!



(In reply to comment #6)
> This report was originally about the scidavis failure before the qbittorrent
> maintainer hijacked it for his completely different bug!


Sorry if I hijacked it for a completely different bug, but I didn't know as both koji links are broken, and were when I posted.

The bug summary matched my problem so I posted it here.
Comment 11 leigh scott 2009-02-22 19:01:28 EST
(In reply to comment #9)
> Created an attachment (id=332872) [details]
> workaround undefined QPair


> Heh, looks like QPair is undefined, adding
>#include <QPair>
>to /usr/include/QtNetwork/qhostaddress.h
>does the trick


Thanks Rex, this works a treat.

>Leigh, looks like adding to httpserver.cpp:
>#include <QPair>
>would be a workaround until we can get this fixed in qt properly.

This didn't work, I still got the same error.
Comment 12 Kevin Kofler 2009-02-22 19:04:29 EST
Did you add it BEFORE the #include which drags in qhostaddress.h? The order matters.
Comment 13 leigh scott 2009-02-23 03:48:17 EST
(In reply to comment #12)
> Did you add it BEFORE the #include which drags in qhostaddress.h? The order
> matters.

Yes I think so


--- qbittorrent-1.3.1/src/httpserver.cpp.orig 
+++ qbittorrent-1.3.1/src/httpserver.cpp 
@@ -18,7 +18,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-
+#include <QPair>
 #include "httpserver.h"
 #include "httpconnection.h"
 #include "eventmanager.h"
Comment 14 leigh scott 2009-02-23 05:08:57 EST
Well I got there :) , I was patching the wrong file.


--- qbittorrent-1.3.1/src/httpserver.h.orig 
+++ qbittorrent-1.3.1/src/httpserver.h 
@@ -22,6 +22,7 @@
 #ifndef HTTPSERVER_H
 #define HTTPSERVER_H
 
+#include <QPair>
 #include <QTcpServer>
 #include <QByteArray>
Comment 15 leigh scott 2009-02-23 06:21:24 EST
Well I finally got it to build @ Koji

http://koji.fedoraproject.org/koji/buildinfo?buildID=83808

I find it strange that I had to add a new build requires (glib2-devel)
Comment 16 Rex Dieter 2009-02-27 14:31:25 EST
Should be fixed in qt-4.5.0-0.4.rc1 and newer

Note You need to log in before you can comment on or make changes to this bug.