Summary: | weird behaviour of identity setup | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Caspar Maessen <cmaessen> |
Component: | Setup-Templates | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 | |
Sentry Crash Report: |
Description
Caspar Maessen
2006-09-29 14:03:03 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 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. B.K.O is KDE bugzilla. About others characters, you have right. I will fix it. Gilles Caulier 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(); |