Fwd: Re: Re: HAVE_X11 usage in KIO/core
-- David Faure, fa...@kde.org, http://www.davidfaure.fr Working on KDE, in particular KDE Frameworks 5 ---BeginMessage--- Well that was done for compatibility with what Firefox/Chromium. The latest stable version (version 27) sends the following user agent string: Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 And the latest Chromium (version 32) seems to send the following string by default: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36 So removing the platform name from the user-agent string might have consequences for those that check for it? Regards, Dawit A. On Sat, Feb 8, 2014 at 4:29 AM, David Faure fa...@kde.org wrote: Any opinion? -- Forwarded Message -- Subject: Re: HAVE_X11 usage in KIO/core Date: Saturday 08 February 2014, 00:55:22 From: Albert Astals Cid aa...@kde.org To: kde-frameworks-devel@kde.org El Divendres, 7 de febrer de 2014, a les 15:25:42, Kevin Krammer va escriure: On Friday, 2014-02-07, 09:51:27, Martin Gräßlin wrote: On Friday 07 February 2014 09:38:41 Kevin Krammer wrote: On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. See the comment I pasted, it's explicitly saying it's the windowing system and not the OS... Ah, didn't see that. Does it actually make sense? If yes than this obviously has be to be done at runtime, at least for platforms with multiple UI systems: #if defined(Q_OS_MAC) return QL1S(Macintosh) #elfi defined(Q_OS_WINDOWS) return QL1S(Windows) #else const QVariant platformName = qApp ? qApp-property(platformName) : QVariant(); if (platformName.isValid()) { const QString name = platformName.toString(); if (!name.isEmpty()) return name; } #endif return QL1S(Unknown); Sincerely, just drop it. We will change from sending Mozilla/5.0 (compatible; Konqueror/4.0; Linux; X11; i686; en_US) KHTML/4.0.1 (like Gecko) to Mozilla/5.0 (compatible; Konqueror/4.0; Linux; i686; en_US) KHTML/4.0.1 (like Gecko) will anyone ever care? Cheers, Albert Cheers, Kevin ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel - -- David Faure, fa...@kde.org, http://www.davidfaure.fr Working on KDE, in particular KDE Frameworks 5 ---End Message--- ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: HAVE_X11 usage in KIO/core
On Saturday 08 February 2014 00:55:22 Albert Astals Cid wrote: [about the X11 string in user agent] Sincerely, just drop it. We will change from sending Mozilla/5.0 (compatible; Konqueror/4.0; Linux; X11; i686; en_US) KHTML/4.0.1 (like Gecko) to Mozilla/5.0 (compatible; Konqueror/4.0; Linux; i686; en_US) KHTML/4.0.1 (like Gecko) will anyone ever care? Had to check if there is a standard that mandates the order or presence of fields, but there is not. +1 for omitting the window system name in the default UA string. Christoph Feck (kdepepo) ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: HAVE_X11 usage in KIO/core
On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: Hi, I found some HAVE_X11 not defined warnings in KIO and had a look at them. One of them is in core/kprotocolmanager.cpp in the following snippet. // This is not the OS, but the windowing system, e.g. X11 on Unix/Linux. static QString platform() { #if HAVE_X11 return QL1S(X11); #elif defined(Q_OS_MAC) return QL1S(Macintosh); #elif defined(Q_OS_WIN) return QL1S(Windows); #else return QL1S(Unknown); #endif } I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. Hinted also by the use of Q_OS_ instead of Q_WS_ IMHO the correct change is something like this #if defined(Q_OS_UNIX) #if defined(Q_OS_MAC) return QL1S(Macintosh) #elif defined(Q_OS_LINUX) return QL1S(Linux) #else return QL1S(Unix) #endif #elfi defined(Q_OS_WINDOWS) return QL1S(Windows) #else return QL1S(Unknown) #endif Cheers, Kevin -- Kevin Krammer, KDE developer, xdg-utils developer KDE user support, developer mentoring signature.asc Description: This is a digitally signed message part. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: Re: HAVE_X11 usage in KIO/core
On Friday 07 February 2014 09:38:41 Kevin Krammer wrote: On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: Hi, I found some HAVE_X11 not defined warnings in KIO and had a look at them. One of them is in core/kprotocolmanager.cpp in the following snippet. // This is not the OS, but the windowing system, e.g. X11 on Unix/Linux. static QString platform() { #if HAVE_X11 return QL1S(X11); #elif defined(Q_OS_MAC) return QL1S(Macintosh); #elif defined(Q_OS_WIN) return QL1S(Windows); #else return QL1S(Unknown); #endif } I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. See the comment I pasted, it's explicitly saying it's the windowing system and not the OS... Cheers Martin signature.asc Description: This is a digitally signed message part. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: Re: HAVE_X11 usage in KIO/core
On Fri, Feb 7, 2014 at 9:51 AM, Martin Gräßlin mgraess...@kde.org wrote: On Friday 07 February 2014 09:38:41 Kevin Krammer wrote: On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: Hi, I found some HAVE_X11 not defined warnings in KIO and had a look at them. One of them is in core/kprotocolmanager.cpp in the following snippet. // This is not the OS, but the windowing system, e.g. X11 on Unix/Linux. static QString platform() { #if HAVE_X11 return QL1S(X11); #elif defined(Q_OS_MAC) return QL1S(Macintosh); #elif defined(Q_OS_WIN) return QL1S(Windows); #else return QL1S(Unknown); #endif } I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. See the comment I pasted, it's explicitly saying it's the windowing system and not the OS... Cheers Martin ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel Sounds to me like we want to use QGuiApplication::platformName() there, the only problem is that the strings differ. Maybe we should just deprecate this function and advise users to use ::platformName(). Aleix ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: Re: Re: HAVE_X11 usage in KIO/core
On Friday 07 February 2014 12:45:47 Aleix Pol wrote: On Fri, Feb 7, 2014 at 9:51 AM, Martin Gräßlin mgraess...@kde.org wrote: On Friday 07 February 2014 09:38:41 Kevin Krammer wrote: On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: Hi, I found some HAVE_X11 not defined warnings in KIO and had a look at them. One of them is in core/kprotocolmanager.cpp in the following snippet. // This is not the OS, but the windowing system, e.g. X11 on Unix/Linux. static QString platform() { #if HAVE_X11 return QL1S(X11); #elif defined(Q_OS_MAC) return QL1S(Macintosh); #elif defined(Q_OS_WIN) return QL1S(Windows); #else return QL1S(Unknown); #endif } I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. See the comment I pasted, it's explicitly saying it's the windowing system and not the OS... Cheers Martin ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel Sounds to me like we want to use QGuiApplication::platformName() there, the only problem is that the strings differ. It doesn't link GUI and I don't think it should. Cheers Martin signature.asc Description: This is a digitally signed message part. ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel
Re: HAVE_X11 usage in KIO/core
El Divendres, 7 de febrer de 2014, a les 15:25:42, Kevin Krammer va escriure: On Friday, 2014-02-07, 09:51:27, Martin Gräßlin wrote: On Friday 07 February 2014 09:38:41 Kevin Krammer wrote: On Friday, 2014-02-07, 08:53:54, Martin Gräßlin wrote: I'm wondering what to do about it. The best would be to use QGuiApplication::platformName, but it's a core app. Also finding X11 in CMakeLists to get the HAVE_X11 defined looks very wrong to me and not future safe (Wayland). My guess is that platform() in this context means operating system, not windowing/display system. See the comment I pasted, it's explicitly saying it's the windowing system and not the OS... Ah, didn't see that. Does it actually make sense? If yes than this obviously has be to be done at runtime, at least for platforms with multiple UI systems: #if defined(Q_OS_MAC) return QL1S(Macintosh) #elfi defined(Q_OS_WINDOWS) return QL1S(Windows) #else const QVariant platformName = qApp ? qApp-property(platformName) : QVariant(); if (platformName.isValid()) { const QString name = platformName.toString(); if (!name.isEmpty()) return name; } #endif return QL1S(Unknown); Sincerely, just drop it. We will change from sending Mozilla/5.0 (compatible; Konqueror/4.0; Linux; X11; i686; en_US) KHTML/4.0.1 (like Gecko) to Mozilla/5.0 (compatible; Konqueror/4.0; Linux; i686; en_US) KHTML/4.0.1 (like Gecko) will anyone ever care? Cheers, Albert Cheers, Kevin ___ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel