Skip to contentSkip to conversation

pinentry: pinentry-qt4 - make the accessibility part optional

PATCH New Vicente Olivert Riera 3 participants 6 messages Dec 12, 2014 – Dec 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 pinentry: pinentry-qt4 - make the accessibility part optional

Backporting an upstream patch to check if the Qt libraries have support for Qt Accessibility before using it. Otherwise it will raise errors like these one:

main.cpp: In function 'int qt_cmd_handler(pinentry_t)':
main.cpp:220:51: error: 'class QAbstractButton' has no member named 'setAccessibleDescription'

Backported upstream patch:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=484465338ea6f5f12eb1341ca0ef84aa79224ed4

Fixes:
http://autobuild.buildroot.net/results/62c/62ca977a7a44d1ad2bbf9e5bc2df716d469484de/

---
 ...-qt4-make-the-accessibility-part-optional.patch |  112 ++++++++++++++++++++
 1 files changed, 112 insertions(+), 0 deletions(-)
 create mode 100644 package/pinentry/0001-pinentry-qt4-make-the-accessibility-part-optional.patch
package/pinentry/0001-pinentry-qt4-make-the-accessibility-part-optional.patch new file +112 -0
new file mode 100644
index 0000000..1b49edd
@@ -0,0 +1,112 @@
+pinentry-qt4: make the accessibility part optional
+
+Backported upstream patch:
+  http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=484465338ea6f5f12eb1341ca0ef84aa79224ed4
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+
+From 484465338ea6f5f12eb1341ca0ef84aa79224ed4 Mon Sep 17 00:00:00 2001
+From: Vicente Olivert Riera <[email protected]>
+Date: Mon, 8 Dec 2014 16:42:42 +0000
+Subject: [PATCH] pinentry-qt4: make the accessibility part optional
+
+Check if the Qt libraries have support for QT Accessibility before using
+it. Otherwise it will raise error like these one:
+
+main.cpp: In function 'int qt_cmd_handler(pinentry_t)':
+main.cpp:220:51: error: 'class QAbstractButton' has no member named
+'setAccessibleDescription'
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+---
+ qt4/main.cpp            |    3 ++-
+ qt4/pinentryconfirm.cpp |    2 ++
+ qt4/pinentrydialog.cpp  |   10 ++++++++++
+ 3 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/qt4/main.cpp b/qt4/main.cpp
+index 106999e..b2a69f2 100644
+--- a/qt4/main.cpp
++++ b/qt4/main.cpp
+@@ -217,8 +217,9 @@ qt_cmd_handler (pinentry_t pe)
+       for ( size_t i = 0 ; i < sizeof buttonLabels / sizeof *buttonLabels ; ++i )
+         if ( (buttons & buttonLabels[i].button) && !buttonLabels[i].label.isEmpty() ) {
+             box.button( buttonLabels[i].button )->setText( buttonLabels[i].label );
++#ifndef QT_NO_ACCESSIBILITY
+             box.button( buttonLabels[i].button )->setAccessibleDescription ( buttonLabels[i].label );
+-
++#endif
+         }
+ 
+       box.setIconPixmap( icon() );
+diff --git a/qt4/pinentryconfirm.cpp b/qt4/pinentryconfirm.cpp
+index dfbd19f..6b3d545 100644
+--- a/qt4/pinentryconfirm.cpp
++++ b/qt4/pinentryconfirm.cpp
+@@ -30,8 +30,10 @@ PinentryConfirm::PinentryConfirm(Icon icon, int timeout, const QString &title,
+ 	connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
+ 	_timer->start(timeout*1000);
+     }
++#ifndef QT_NO_ACCESSIBILITY
+     setAccessibleDescription (desc);
+     setAccessibleName (title);
++#endif
+     raiseWindow (this);
+ }
+ 
+diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp
+index 3a6dacc..456f022 100644
+--- a/qt4/pinentrydialog.cpp
++++ b/qt4/pinentrydialog.cpp
+@@ -217,7 +217,9 @@ void PinEntryDialog::setDescription( const QString& txt )
+ {
+   _desc->setVisible( !txt.isEmpty() );
+   _desc->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _desc->setAccessibleDescription ( txt );
++#endif
+   _icon->setPixmap( icon() );
+   setError( QString::null );
+ }
+@@ -231,7 +233,9 @@ void PinEntryDialog::setError( const QString& txt )
+ {
+   if( !txt.isNull() )_icon->setPixmap( icon( QStyle::SP_MessageBoxCritical ) );
+   _error->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _error->setAccessibleDescription ( txt );
++#endif
+   _error->setVisible( !txt.isEmpty() );
+ }
+ 
+@@ -264,14 +268,18 @@ QString PinEntryDialog::prompt() const
+ void PinEntryDialog::setOkText( const QString& txt )
+ {
+   _ok->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _ok->setAccessibleDescription ( txt );
++#endif
+   _ok->setVisible( !txt.isEmpty() );
+ }
+ 
+ void PinEntryDialog::setCancelText( const QString& txt )
+ {
+   _cancel->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _cancel->setAccessibleDescription ( txt );
++#endif
+   _cancel->setVisible( !txt.isEmpty() );
+ }
+ 
+@@ -279,7 +287,9 @@ void PinEntryDialog::setQualityBar( const QString& txt )
+ {
+   if (_have_quality_bar) {
+     _quality_bar_label->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+     _quality_bar_label->setAccessibleDescription ( txt );
++#endif
+   }
+ }
+ 
+-- 
+1.7.1
+
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/3 pinentry: pinentry-qt4 - fix .moc include paths

The include paths present in the .moc files make reference to the qt version used by the person who generated the tarball. We need to fix those paths in order to avoid build errors like these ones:

In file included from pinentryconfirm.cpp:52:0:
pinentryconfirm.moc:9:53: fatal error:
../../../s/pinentry/qt4/pinentryconfirm.h: No such file or directory
#include "../../../s/pinentry/qt4/pinentryconfirm.h"

In file included from qsecurelineedit.cpp:3602:0:
qsecurelineedit.moc:9:53: fatal error:
../../../s/pinentry/qt4/qsecurelineedit.h: No such file or directory
#include "../../../s/pinentry/qt4/qsecurelineedit.h"

In file included from pinentrydialog.cpp:347:0:
pinentrydialog.moc:9:52: fatal error:
../../../s/pinentry/qt4/pinentrydialog.h: No such file or directory
#include "../../../s/pinentry/qt4/pinentrydialog.h"

This issue has been reported upstream:
https://bugs.g10code.com/gnupg/issue1784

Fixes:
http://autobuild.buildroot.net/results/62c/62ca977a7a44d1ad2bbf9e5bc2df716d469484de/

---
 package/pinentry/0002-fix-moc-include-paths.patch |   62 +++++++++++++++++++++
 1 files changed, 62 insertions(+), 0 deletions(-)
 create mode 100644 package/pinentry/0002-fix-moc-include-paths.patch
package/pinentry/0002-fix-moc-include-paths.patch new file +62 -0
new file mode 100644
index 0000000..ab20ef1
@@ -0,0 +1,62 @@
+Fix .moc include paths
+
+The include paths present in the .moc files make reference to the Qt 
+version used by the person who generated the tarball. We need to fix 
+those paths in order to avoid build errors like these ones:
+
+In file included from pinentryconfirm.cpp:52:0:
+pinentryconfirm.moc:9:53: fatal error:
+../../../s/pinentry/qt4/pinentryconfirm.h: No such file or directory
+ #include "../../../s/pinentry/qt4/pinentryconfirm.h"
+
+In file included from qsecurelineedit.cpp:3602:0:
+qsecurelineedit.moc:9:53: fatal error:
+../../../s/pinentry/qt4/qsecurelineedit.h: No such file or directory
+ #include "../../../s/pinentry/qt4/qsecurelineedit.h"
+
+In file included from pinentrydialog.cpp:347:0:
+pinentrydialog.moc:9:52: fatal error:
+../../../s/pinentry/qt4/pinentrydialog.h: No such file or directory
+ #include "../../../s/pinentry/qt4/pinentrydialog.h"
+
+This issue has been reported upstream:
+  https://bugs.g10code.com/gnupg/issue1784
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+
+diff -rup a/qt4/pinentryconfirm.moc b/qt4/pinentryconfirm.moc
+--- a/qt4/pinentryconfirm.moc	2014-09-18 09:35:48.000000000 +0100
++++ b/qt4/pinentryconfirm.moc	2014-12-12 14:41:10.574581901 +0000
+@@ -6,7 +6,7 @@
+ ** WARNING! All changes made in this file will be lost!
+ *****************************************************************************/
+ 
+-#include "../../../s/pinentry/qt4/pinentryconfirm.h"
++#include "pinentryconfirm.h"
+ #if !defined(Q_MOC_OUTPUT_REVISION)
+ #error "The header file 'pinentryconfirm.h' doesn't include <QObject>."
+ #elif Q_MOC_OUTPUT_REVISION != 63
+diff -rup a/qt4/pinentrydialog.moc b/qt4/pinentrydialog.moc
+--- a/qt4/pinentrydialog.moc	2014-09-18 09:35:48.000000000 +0100
++++ b/qt4/pinentrydialog.moc	2014-12-12 14:41:21.438771625 +0000
+@@ -6,7 +6,7 @@
+ ** WARNING! All changes made in this file will be lost!
+ *****************************************************************************/
+ 
+-#include "../../../s/pinentry/qt4/pinentrydialog.h"
++#include "pinentrydialog.h"
+ #if !defined(Q_MOC_OUTPUT_REVISION)
+ #error "The header file 'pinentrydialog.h' doesn't include <QObject>."
+ #elif Q_MOC_OUTPUT_REVISION != 63
+diff -rup a/qt4/qsecurelineedit.moc b/qt4/qsecurelineedit.moc
+--- a/qt4/qsecurelineedit.moc	2014-09-18 09:35:48.000000000 +0100
++++ b/qt4/qsecurelineedit.moc	2014-12-12 14:41:35.279013320 +0000
+@@ -6,7 +6,7 @@
+ ** WARNING! All changes made in this file will be lost!
+ *****************************************************************************/
+ 
+-#include "../../../s/pinentry/qt4/qsecurelineedit.h"
++#include "qsecurelineedit.h"
+ #if !defined(Q_MOC_OUTPUT_REVISION)
+ #error "The header file 'qsecurelineedit.h' doesn't include <QObject>."
+ #elif Q_MOC_OUTPUT_REVISION != 63
Signature · 1 line
1.7.1
#2 lore raw

PATCH 3/3 pinentry: remove non-existent configure options for Qt3 and GTK+1

In reply to Vicente Olivert Riera

Qt3 and GTK+1 support were removed by this commit:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=f2ed42297528f2a126d189c6181d3105ceecca22

---
 package/pinentry/pinentry.mk |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
package/pinentry/pinentry.mk +0 -2
index 56e8e71..f34cc0e 100644
@@ -10,8 +10,6 @@ PINENTRY_SITE = ftp://ftp.gnupg.org/gcrypt/pinentry
 PINENTRY_LICENSE = GPLv2+
 PINENTRY_LICENSE_FILES = COPYING
 PINENTRY_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
-PINENTRY_CONF_OPTS = --disable-pinentry-gtk # gtk1
-PINENTRY_CONF_OPTS += --disable-pinentry-qt  # qt3
 PINENTRY_CONF_OPTS += --without-libcap       # requires PAM
 
 # build with X if available
Signature · 1 line
1.7.1
#3 lore raw

PATCH 3/3 pinentry: remove non-existent configure options for Qt3 and GTK+1

Vicente, All,

On 2014-12-12 15:59 +0000, Vicente Olivert Riera spake thusly:

Quoted 4 lines

Qt3 and GTK+1 support were removed by this commit:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=f2ed42297528f2a126d189c6181d3105ceecca22

Indeed, ./configure complains they do not exist.

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 package/pinentry/pinentry.mk |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
package/pinentry/pinentry.mk +0 -2
index 56e8e71..f34cc0e 100644
@@ -10,8 +10,6 @@ PINENTRY_SITE = ftp://ftp.gnupg.org/gcrypt/pinentry
 PINENTRY_LICENSE = GPLv2+
 PINENTRY_LICENSE_FILES = COPYING
 PINENTRY_DEPENDENCIES = $(if $(BR2_PACKAGE_LIBICONV),libiconv)
-PINENTRY_CONF_OPTS = --disable-pinentry-gtk # gtk1
-PINENTRY_CONF_OPTS += --disable-pinentry-qt  # qt3
 PINENTRY_CONF_OPTS += --without-libcap       # requires PAM
 
 # build with X if available
Signature · 6 lines
1.7.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 3/3 pinentry: remove non-existent configure options for Qt3 and GTK+1

In reply to Vicente Olivert Riera

Dear Vicente Olivert Riera,

Quoted 4 lines · Vicente Olivert Riera

Qt3 and GTK+1 support were removed by this commit:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=f2ed42297528f2a126d189c6181d3105ceecca22

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/3 pinentry: pinentry-qt4 - make the accessibility part optional

In reply to Vicente Olivert Riera

Vicente, All,

On 2014-12-12 15:59 +0000, Vicente Olivert Riera spake thusly:

Quoted 8 lines

Backporting an upstream patch to check if the Qt libraries have support for Qt Accessibility before using it. Otherwise it will raise errors like these one:

main.cpp: In function 'int qt_cmd_handler(pinentry_t)':
main.cpp:220:51: error: 'class QAbstractButton' has no member named 'setAccessibleDescription'

Quoted 7 lines

Backported upstream patch:
http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=484465338ea6f5f12eb1341ca0ef84aa79224ed4

Fixes:
http://autobuild.buildroot.net/results/62c/62ca977a7a44d1ad2bbf9e5bc2df716d469484de/

I independently came to submit this same patch, as well as the next one, and they have been applied by Thomas:

    http://git.buildroot.org/buildroot/commit/package/pinentry?id=0ec5167d0cccd8628537ac98222cfc528b08022b
    http://git.buildroot.org/buildroot/commit/package/pinentry?id=4d58a27da458c438d375250c74fbc4444c9b5d3d

Sorry for the mishap, I did not see your patches before submitting.

I've marked them Superseded in Patchwork.

Regards,
Yann E. MORIN.

Quoted 130 lines
---
 ...-qt4-make-the-accessibility-part-optional.patch |  112 ++++++++++++++++++++
 1 files changed, 112 insertions(+), 0 deletions(-)
 create mode 100644 package/pinentry/0001-pinentry-qt4-make-the-accessibility-part-optional.patch
package/pinentry/0001-pinentry-qt4-make-the-accessibility-part-optional.patch new file +112 -0
new file mode 100644
index 0000000..1b49edd
@@ -0,0 +1,112 @@
+pinentry-qt4: make the accessibility part optional
+
+Backported upstream patch:
+  http://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=484465338ea6f5f12eb1341ca0ef84aa79224ed4
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+
+From 484465338ea6f5f12eb1341ca0ef84aa79224ed4 Mon Sep 17 00:00:00 2001
+From: Vicente Olivert Riera <[email protected]>
+Date: Mon, 8 Dec 2014 16:42:42 +0000
+Subject: [PATCH] pinentry-qt4: make the accessibility part optional
+
+Check if the Qt libraries have support for QT Accessibility before using
+it. Otherwise it will raise error like these one:
+
+main.cpp: In function 'int qt_cmd_handler(pinentry_t)':
+main.cpp:220:51: error: 'class QAbstractButton' has no member named
+'setAccessibleDescription'
+
+Signed-off-by: Vicente Olivert Riera <[email protected]>
+---
+ qt4/main.cpp            |    3 ++-
+ qt4/pinentryconfirm.cpp |    2 ++
+ qt4/pinentrydialog.cpp  |   10 ++++++++++
+ 3 files changed, 14 insertions(+), 1 deletions(-)
+
+diff --git a/qt4/main.cpp b/qt4/main.cpp
+index 106999e..b2a69f2 100644
+--- a/qt4/main.cpp
++++ b/qt4/main.cpp
+@@ -217,8 +217,9 @@ qt_cmd_handler (pinentry_t pe)
+       for ( size_t i = 0 ; i < sizeof buttonLabels / sizeof *buttonLabels ; ++i )
+         if ( (buttons & buttonLabels[i].button) && !buttonLabels[i].label.isEmpty() ) {
+             box.button( buttonLabels[i].button )->setText( buttonLabels[i].label );
++#ifndef QT_NO_ACCESSIBILITY
+             box.button( buttonLabels[i].button )->setAccessibleDescription ( buttonLabels[i].label );
+-
++#endif
+         }
+ 
+       box.setIconPixmap( icon() );
+diff --git a/qt4/pinentryconfirm.cpp b/qt4/pinentryconfirm.cpp
+index dfbd19f..6b3d545 100644
+--- a/qt4/pinentryconfirm.cpp
++++ b/qt4/pinentryconfirm.cpp
+@@ -30,8 +30,10 @@ PinentryConfirm::PinentryConfirm(Icon icon, int timeout, const QString &title,
+ 	connect(_timer, SIGNAL(timeout()), this, SLOT(slotTimeout()));
+ 	_timer->start(timeout*1000);
+     }
++#ifndef QT_NO_ACCESSIBILITY
+     setAccessibleDescription (desc);
+     setAccessibleName (title);
++#endif
+     raiseWindow (this);
+ }
+ 
+diff --git a/qt4/pinentrydialog.cpp b/qt4/pinentrydialog.cpp
+index 3a6dacc..456f022 100644
+--- a/qt4/pinentrydialog.cpp
++++ b/qt4/pinentrydialog.cpp
+@@ -217,7 +217,9 @@ void PinEntryDialog::setDescription( const QString& txt )
+ {
+   _desc->setVisible( !txt.isEmpty() );
+   _desc->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _desc->setAccessibleDescription ( txt );
++#endif
+   _icon->setPixmap( icon() );
+   setError( QString::null );
+ }
+@@ -231,7 +233,9 @@ void PinEntryDialog::setError( const QString& txt )
+ {
+   if( !txt.isNull() )_icon->setPixmap( icon( QStyle::SP_MessageBoxCritical ) );
+   _error->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _error->setAccessibleDescription ( txt );
++#endif
+   _error->setVisible( !txt.isEmpty() );
+ }
+ 
+@@ -264,14 +268,18 @@ QString PinEntryDialog::prompt() const
+ void PinEntryDialog::setOkText( const QString& txt )
+ {
+   _ok->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _ok->setAccessibleDescription ( txt );
++#endif
+   _ok->setVisible( !txt.isEmpty() );
+ }
+ 
+ void PinEntryDialog::setCancelText( const QString& txt )
+ {
+   _cancel->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+   _cancel->setAccessibleDescription ( txt );
++#endif
+   _cancel->setVisible( !txt.isEmpty() );
+ }
+ 
+@@ -279,7 +287,9 @@ void PinEntryDialog::setQualityBar( const QString& txt )
+ {
+   if (_have_quality_bar) {
+     _quality_bar_label->setText( txt );
++#ifndef QT_NO_ACCESSIBILITY
+     _quality_bar_label->setAccessibleDescription ( txt );
++#endif
+   }
+ }
+ 
+-- 
+1.7.1
+
Signature · 6 lines
1.7.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'