Hello community,

here is the log from the commit of package pinentry for openSUSE:Factory
checked in at Mon Sep 19 18:01:26 CEST 2011.



--------
--- pinentry/pinentry.changes   2011-03-25 09:54:35.000000000 +0100
+++ pinentry/pinentry.changes   2011-09-16 15:28:11.000000000 +0200
@@ -1,0 +2,10 @@
+Wed Sep 14 15:43:02 UTC 2011 - vci...@suse.com
+
+- enable paste for pinentry-gtk2 (bnc#690514)
+
+-------------------------------------------------------------------
+Tue Sep 13 15:41:23 UTC 2011 - vci...@suse.com
+
+- enable paste for pinentry-qt4 (bnc#690514)
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


New:
----
  pinentry-0.8.1-allow_paste_gtk2.patch
  pinentry-0.8.1-allow_paste_qt4.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pinentry.spec ++++++
--- /var/tmp/diff_new_pack.hVVc3b/_old  2011-09-19 18:01:23.000000000 +0200
+++ /var/tmp/diff_new_pack.hVVc3b/_new  2011-09-19 18:01:23.000000000 +0200
@@ -30,6 +30,10 @@
 Patch1:         pinentry-0.7.2-gtk+-2.4.diff
 Patch2:         pinentry-0.7.2-bnc179996_disable_inputmethod_for_passords.patch
 Patch3:         pinentry-0.7.2-curses-utf-8.diff
+# PATCH-FIX-UPSTREAM allow paste for pinentry-qt4 (bnc#690514)
+Patch4:         pinentry-0.8.1-allow_paste_qt4.patch
+# PATCH-FIX-UPSTREAM allow paste for pinentry-gtk-2 (bnc#690514)
+Patch5:         pinentry-0.8.1-allow_paste_gtk2.patch
 BuildRequires:  cmake
 BuildRequires:  libcap-devel
 BuildRequires:  libdrm-devel
@@ -99,6 +103,8 @@
 %patch1 -p 1
 %patch2 -p 1
 %patch3
+%patch4 -p1
+%patch5 -p1
 
 %build
 cp /usr/share/gettext/config.rpath .

++++++ pinentry-0.8.1-allow_paste_gtk2.patch ++++++
Index: pinentry-0.8.1/gtk+-2/gtksecentry.c
===================================================================
--- pinentry-0.8.1.orig/gtk+-2/gtksecentry.c    2010-04-19 13:25:38.000000000 
+0200
+++ pinentry-0.8.1/gtk+-2/gtksecentry.c 2011-09-16 15:07:38.317559117 +0200
@@ -56,6 +56,7 @@
     ACTIVATE,
     MOVE_CURSOR,
     INSERT_AT_CURSOR,
+    PASTE_CLIPBOARD,
     DELETE_FROM_CURSOR,
     LAST_SIGNAL
 };
@@ -166,6 +167,7 @@
                                         gboolean extend_selection);
 static void gtk_secure_entry_insert_at_cursor(GtkSecureEntry * entry,
                                              const gchar * str);
+static void gtk_secure_entry_paste_clipboard(GtkSecureEntry * entry);
 static void gtk_secure_entry_delete_from_cursor(GtkSecureEntry * entry,
                                                GtkDeleteType type,
                                                gint count);
@@ -422,6 +424,7 @@
 
     class->move_cursor = gtk_secure_entry_move_cursor;
     class->insert_at_cursor = gtk_secure_entry_insert_at_cursor;
+    class->paste_clipboard = gtk_secure_entry_paste_clipboard;
     class->delete_from_cursor = gtk_secure_entry_delete_from_cursor;
     class->activate = gtk_secure_entry_real_activate;
 
@@ -530,6 +533,14 @@
                     _gtk_marshal_VOID__STRING, G_TYPE_NONE, 1,
                     G_TYPE_STRING);
 
+    signals[PASTE_CLIPBOARD] =
+       g_signal_new("paste_clipboard",
+                    G_OBJECT_CLASS_TYPE(gobject_class),
+                    G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+                    G_STRUCT_OFFSET(GtkSecureEntryClass, paste_clipboard),
+                    NULL, NULL,
+                    _gtk_marshal_VOID__VOID, G_TYPE_NONE, 0);
+
     signals[DELETE_FROM_CURSOR] =
        g_signal_new("delete_from_cursor",
                     G_OBJECT_CLASS_TYPE(gobject_class),
@@ -650,6 +661,13 @@
                                 GDK_CONTROL_MASK, "delete_from_cursor", 2,
                                 G_TYPE_ENUM, GTK_DELETE_WORD_ENDS,
                                 G_TYPE_INT, -1);
+
+    /* activate clipboard */
+    /* TODO: mouse middle button */
+    gtk_binding_entry_add_signal (binding_set, GDK_v, GDK_CONTROL_MASK,
+                                 "paste_clipboard", 0);
+    gtk_binding_entry_add_signal (binding_set, GDK_Insert, GDK_SHIFT_MASK,
+                                 "paste_clipboard", 0);
 }
 
 static void
@@ -1253,6 +1271,7 @@
 gtk_secure_entry_key_press(GtkWidget * widget, GdkEventKey * event)
 {
     GtkSecureEntry *entry = GTK_SECURE_ENTRY(widget);
+    GtkEditable *editable = GTK_EDITABLE (widget);
 
     gtk_secure_entry_pend_cursor_blink(entry);
 
@@ -1804,6 +1823,36 @@
 }
 
 static void
+paste_from_clipboard (GtkClipboard *clipboard,
+                      const gchar *text, gpointer data)
+{
+    GtkSecureEntry *entry = GTK_SECURE_ENTRY(data);
+    GtkEditable *editable = GTK_EDITABLE(entry);
+    gint length;
+
+    if (!text) return;
+
+    length = strlen(text);
+    gint pos = entry->current_pos + length;
+
+    gtk_secure_entry_insert_text(entry, text, length, &pos);
+    gtk_editable_set_position(editable, pos);
+}
+
+/* TODO: gtk_secure_entry_copy_clipboard (editable); */
+/* TODO: gtk_secure_entry_cut_clipboard (editable); */
+static void
+gtk_secure_entry_paste_clipboard(GtkSecureEntry * entry)
+{
+    GtkEditable *editable = GTK_EDITABLE(entry);
+    gtk_secure_entry_reset_im_context(entry);
+
+    /* TODO: different clipboards */
+    gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (entry), 
GDK_SELECTION_CLIPBOARD),
+                               paste_from_clipboard, entry);
+}
+
+static void
 gtk_secure_entry_delete_from_cursor(GtkSecureEntry * entry,
                                    GtkDeleteType type, gint count)
 {
Index: pinentry-0.8.1/gtk+-2/gtksecentry.h
===================================================================
--- pinentry-0.8.1.orig/gtk+-2/gtksecentry.h    2010-05-12 17:33:52.000000000 
+0200
+++ pinentry-0.8.1/gtk+-2/gtksecentry.h 2011-09-15 09:50:39.717727093 +0200
@@ -121,6 +121,7 @@
                         GtkMovementStep step,
                         gint count, gboolean extend_selection);
     void (*insert_at_cursor) (GtkSecureEntry * entry, const gchar * str);
+    void (*paste_clipboard) (GtkSecureEntry * entry);
     void (*delete_from_cursor) (GtkSecureEntry * entry,
                                GtkDeleteType type, gint count);
 
++++++ pinentry-0.8.1-allow_paste_qt4.patch ++++++
Index: pinentry-0.8.1/qt4/qsecurelineedit.h
===================================================================
--- pinentry-0.8.1.orig/qt4/qsecurelineedit.h   2009-04-15 10:05:17.000000000 
+0200
+++ pinentry-0.8.1/qt4/qsecurelineedit.h        2011-09-14 11:33:50.310136644 
+0200
@@ -61,15 +61,6 @@
 #ifndef QT_NO_COMPLETER
 # define QT_NO_COMPLETER
 #endif
-#ifndef QT_NO_CLIPBOARD
-# define QT_NO_CLIPBOARD
-#endif
-#ifndef QT_NO_CONTEXTMENU
-# define QT_NO_CONTEXTMENU
-#endif
-#ifndef QT_NO_DRAGANDDROP
-# define QT_NO_DRAGANDDROP
-#endif
 #ifndef QT_NO_STYLE_STYLESHEET
 # define QT_NO_STYLE_STYLESHEET
 #endif
Index: pinentry-0.8.1/qt4/secstring.cpp
===================================================================
--- pinentry-0.8.1.orig/qt4/secstring.cpp       2009-03-19 09:25:23.000000000 
+0100
+++ pinentry-0.8.1/qt4/secstring.cpp    2011-09-14 11:32:02.609182285 +0200
@@ -102,3 +102,15 @@
     return ba;
 }
 
+QString sec_to_q(const secqstring& str)
+{
+    QString result (str.data());
+    return result;
+}
+
+secqstring q_to_sec (const QString& str)
+{
+    const QChar* p = str.constData();
+    secqstring result = p;
+    return result;
+}
Index: pinentry-0.8.1/qt4/secstring.h
===================================================================
--- pinentry-0.8.1.orig/qt4/secstring.h 2009-03-19 09:25:43.000000000 +0100
+++ pinentry-0.8.1/qt4/secstring.h      2011-09-14 11:30:35.561985760 +0200
@@ -34,6 +34,9 @@
 
 secstring toUtf8( const secqstring & str );
 
+QString sec_to_q(const secqstring& str);
+secqstring q_to_sec (const QString& str);
+
 Q_DECLARE_METATYPE( secqstring )
 Q_DECLARE_METATYPE( secstring )
 
Index: pinentry-0.8.1/qt4/qsecurelineedit.cpp
===================================================================
--- pinentry-0.8.1.orig/qt4/qsecurelineedit.cpp 2009-04-15 10:05:17.000000000 
+0200
+++ pinentry-0.8.1/qt4/qsecurelineedit.cpp      2011-09-14 12:01:27.974059276 
+0200
@@ -1473,13 +1473,14 @@
         clear();
         d->resumePassword = true;
     }
-    insert(QApplication::clipboard()->text(QClipboard::Clipboard));
+    secqstring strForIns  = 
q_to_sec(QApplication::clipboard()->text(QClipboard::Clipboard));
+    insert(strForIns);
 }
 
 void QSecureLineEditPrivate::copy(bool clipboard) const
 {
     Q_Q(const QSecureLineEdit);
-    QString t = q->selectedText();
+    QString t = sec_to_q(q->selectedText());
     if (!t.isEmpty() && echoMode == QSecureLineEdit::Normal) {
         q->disconnect(QApplication::clipboard(), SIGNAL(selectionChanged()), 
q, 0);
         QApplication::clipboard()->setText(t, clipboard ? 
QClipboard::Clipboard : QClipboard::Selection);
@@ -1699,7 +1700,7 @@
             d->copy(false);
         } else if (!d->readOnly && e->button() == Qt::MidButton) {
             d->deselect();
-            insert(QApplication::clipboard()->text(QClipboard::Selection));
+            
insert(q_to_sec(QApplication::clipboard()->text(QClipboard::Selection)));
         }
     }
 #endif
@@ -2503,7 +2504,7 @@
         int oldSelEnd = d->selend;
         d->cursorVisible = false;
         e->acceptProposedAction();
-        insert(str);
+        insert(q_to_sec(str));
         if (e->source() == this) {
             if (e->dropAction() == Qt::MoveAction) {
                 if (selStart > oldSelStart && selStart <= oldSelEnd)
@@ -2527,7 +2528,7 @@
     Q_Q(QSecureLineEdit);
     dndTimer.stop();
     QMimeData *data = new QMimeData;
-    data->setText(q->selectedText());
+    data->setText(sec_to_q(q->selectedText()));
     QDrag *drag = new QDrag(q);
     drag->setMimeData(data);
     Qt::DropAction action = drag->start();
@@ -2611,8 +2612,8 @@
     d->actions[QSecureLineEditPrivate::CopyAct]->setEnabled(false);
     d->actions[QSecureLineEditPrivate::PasteAct]->setEnabled(false);
 #endif
-    d->actions[QSecureLineEditPrivate::ClearAct]->setEnabled(!d->readOnly && 
!d->text.isEmpty() && d->hasSelectedText());
-    
d->actions[QSecureLineEditPrivate::SelectAllAct]->setEnabled(!d->text.isEmpty() 
&& !d->allSelected());
+    d->actions[QSecureLineEditPrivate::ClearAct]->setEnabled(!d->readOnly && 
!d->text.empty() && d->hasSelectedText());
+    
d->actions[QSecureLineEditPrivate::SelectAllAct]->setEnabled(!d->text.empty() 
&& !d->allSelected());
 
     QMenu *popup = new QMenu(this);
     popup->setObjectName(QLatin1String("qt_edit_menu"));
@@ -2639,9 +2640,6 @@
 #else
     if (!d->readOnly) {
 #endif
-        popup->addSeparator();
-        QUnicodeControlCharacterMenu *ctrlCharacterMenu = new 
QUnicodeControlCharacterMenu(this, popup);
-        popup->addMenu(ctrlCharacterMenu);
     }
     return popup;
 }

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to