Bug 134841 - weird behaviour of identity setup
Summary: weird behaviour of identity setup
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-Templates (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-09-29 14:03 UTC by Caspar Maessen
Modified: 2017-08-10 08:33 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.9.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Caspar Maessen 2006-09-29 14:03:03 UTC
Version:           0.9.0-beta2 SVN-version (using KDE KDE 3.5.4)
Installed from:    SuSE RPMs
OS:                Linux

The entry-fields for identity in setup behave weird. Normal editing functions don't work and not only alfabethical characters are accepted.
Comment 1 caulier.gilles 2006-09-29 14:06:44 UTC
This B.K.O file invalid because all IPTC strings support only ASCII characters ! Look the whats this entries for more details.

Gilles Caulier
Comment 2 Caspar Maessen 2006-09-29 14:27:08 UTC
What is B.K.O. file?
What I meant to say was that de editing-fields of the identity setup aren't behaving the same as all the other editing-fields of setup.
Also only the characterS a to z and A to Z are accepted. Others like <,>.?/:;"'{[}]|\~`!@#$%*()-_+= are not.
Comment 3 caulier.gilles 2006-10-02 11:45:27 UTC
B.K.O is KDE bugzilla.

About others characters, you have right. I will fix it.

Gilles Caulier
Comment 4 caulier.gilles 2006-10-02 11:47:00 UTC
SVN commit 591296 by cgilles:

digikam from trunk : Use a QValidator to limit string characters to all printable ASCII char.
BUG: 134841

 M  +18 -9     setupidentity.cpp  


--- trunk/extragear/graphics/digikam/utilities/setup/setupidentity.cpp #591295:591296
@@ -25,6 +25,7 @@
 #include <qgroupbox.h>
 #include <qlabel.h>
 #include <qwhatsthis.h>
+#include <qvalidator.h>
 
 // KDE includes.
 
@@ -68,15 +69,17 @@
     QVBoxLayout *layout = new QVBoxLayout( parent, 0, KDialog::spacingHint() );
     
     // --------------------------------------------------------
-    QString asciiMask("nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn"
-                      "nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn");
 
+    // IPTC only accept printable Ascii char.
+    QRegExp asciiRx("[\x20-\x7F]+$");
+    QValidator *asciiValidator = new QRegExpValidator(asciiRx, this);
+
     QGroupBox *photographerIdGroup = new QGroupBox(0, Qt::Horizontal, i18n("Photographer Informations"), parent);
     QGridLayout* grid = new QGridLayout( photographerIdGroup->layout(), 1, 1, KDialog::spacingHint());
 
     QLabel *label1 = new QLabel(i18n("Author:"), photographerIdGroup);
     d->authorEdit  = new KLineEdit(photographerIdGroup);
-    d->authorEdit->setInputMask(asciiMask);
+    d->authorEdit->setValidator(asciiValidator);
     d->authorEdit->setMaxLength(32);
     label1->setBuddy(d->authorEdit);
     grid->addMultiCellWidget(label1, 0, 0, 0, 0);
@@ -86,7 +89,7 @@
 
     QLabel *label2 = new QLabel(i18n("Author Title:"), photographerIdGroup);
     d->authorTitleEdit = new KLineEdit(photographerIdGroup);
-    d->authorTitleEdit->setInputMask(asciiMask);
+    d->authorEdit->setValidator(asciiValidator);
     d->authorTitleEdit->setMaxLength(32);
     label2->setBuddy(d->authorTitleEdit);
     grid->addMultiCellWidget(label2, 1, 1, 0, 0);
@@ -101,7 +104,7 @@
 
     QLabel *label3 = new QLabel(i18n("Credit:"), creditsGroup);
     d->creditEdit = new KLineEdit(creditsGroup);
-    d->creditEdit->setInputMask(asciiMask);
+    d->authorEdit->setValidator(asciiValidator);
     d->creditEdit->setMaxLength(32);
     label3->setBuddy(d->creditEdit);
     grid2->addMultiCellWidget(label3, 0, 0, 0, 0);
@@ -112,7 +115,7 @@
 
     QLabel *label4 = new QLabel(i18n("Source:"), creditsGroup);
     d->sourceEdit = new KLineEdit(creditsGroup);
-    d->sourceEdit->setInputMask(asciiMask);
+    d->authorEdit->setValidator(asciiValidator);
     d->sourceEdit->setMaxLength(32);
     label4->setBuddy(d->sourceEdit);
     grid2->addMultiCellWidget(label4, 1, 1, 0, 0);
@@ -124,18 +127,24 @@
 
     QLabel *label5 = new QLabel(i18n("Copyright:"), creditsGroup);
     d->copyrightEdit = new KLineEdit(creditsGroup);
-    d->copyrightEdit->setInputMask(asciiMask);
+    d->authorEdit->setValidator(asciiValidator);
     d->copyrightEdit->setMaxLength(128);
     label5->setBuddy(d->copyrightEdit);
     grid2->addMultiCellWidget(label5, 2, 2, 0, 0);
     grid2->addMultiCellWidget(d->copyrightEdit, 2, 2, 1, 1);
-    QWhatsThis::add( d->copyrightEdit, i18n("<p>Set here the default copyright notice of the pictures. This field is limited "
-                                            "to 128 ASCII characters."));
+    QWhatsThis::add( d->copyrightEdit, i18n("<p>Set here the default copyright notice of the pictures. "
+                                            "This field is limited to 128 ASCII characters."));
+
+    // --------------------------------------------------------
+
+    QLabel *iptcNote = new QLabel(i18n("<b>Note: IPTC text tags only support printable "
+                                       "ASCII characters set.</b>"), parent);
                                          
     // --------------------------------------------------------
     
     layout->addWidget(photographerIdGroup);
     layout->addWidget(creditsGroup);
+    layout->addWidget(iptcNote);
     layout->addStretch();
     
     readSettings();