Commit b6d7b449 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Don't display QRCode in vcard in kmail. It takes too many place

parent d9c5c5d5
......@@ -33,13 +33,26 @@
using namespace Akonadi;
class StandardContactFormatter::Private
{
public:
Private()
:displayQRcode(true)
{
}
bool displayQRcode;
};
StandardContactFormatter::StandardContactFormatter()
: d( 0 )
: d( new Private() )
{
}
StandardContactFormatter::~StandardContactFormatter()
{
delete d;
}
QString StandardContactFormatter::toHtml( HtmlForm form ) const
......@@ -266,17 +279,19 @@ QString StandardContactFormatter::toHtml( HtmlForm form ) const
strAddr.append( QString::fromLatin1( "</table>" ) );
#ifdef HAVE_PRISON
KConfig config( QLatin1String( "akonadi_contactrc" ) );
KConfigGroup group( &config, QLatin1String( "View" ) );
if ( group.readEntry( "QRCodes", true ) ) {
strAddr.append( QString::fromLatin1(
"<p align=\"center\">"
"<img src=\"%1\" vspace=\"1\">"
"<img src=\"%2\" vspace=\"1\">"
"</p>"
)
.arg( QLatin1String( "datamatrix" ) )
.arg( QLatin1String( "qrcode" ) ) );
if(d->displayQRcode) {
KConfig config( QLatin1String( "akonadi_contactrc" ) );
KConfigGroup group( &config, QLatin1String( "View" ) );
if ( group.readEntry( "QRCodes", true ) ) {
strAddr.append( QString::fromLatin1(
"<p align=\"center\">"
"<img src=\"%1\" vspace=\"1\">"
"<img src=\"%2\" vspace=\"1\">"
"</p>"
)
.arg( QLatin1String( "datamatrix" ) )
.arg( QLatin1String( "qrcode" ) ) );
}
}
#endif // HAVE_PRISON
......@@ -303,3 +318,13 @@ QString StandardContactFormatter::toHtml( HtmlForm form ) const
return document;
}
void StandardContactFormatter::setDisplayQRCode( bool show )
{
d->displayQRcode = show;
}
bool StandardContactFormatter::displayQRCode() const
{
return d->displayQRcode;
}
......@@ -68,6 +68,15 @@ class AKONADI_CONTACT_EXPORT StandardContactFormatter : public AbstractContactFo
*/
virtual QString toHtml( HtmlForm form = SelfcontainedForm ) const;
/*
* @since 4.9.1
*/
void setDisplayQRCode( bool show );
/*
* @since 4.9.1
*/
bool displayQRCode() const;
private:
//@cond PRIVATE
class Private;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment