Diffstat (limited to 'libopie2/opiesecurity/multiauthcommon.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiesecurity/multiauthcommon.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libopie2/opiesecurity/multiauthcommon.cpp b/libopie2/opiesecurity/multiauthcommon.cpp index e563193..2760760 100644 --- a/libopie2/opiesecurity/multiauthcommon.cpp +++ b/libopie2/opiesecurity/multiauthcommon.cpp @@ -5,4 +5,6 @@ #include <opie2/odebug.h> #include <opie2/oapplication.h> +#include <opie2/ocontactaccessbackend_vcard.h> +#include <opie2/ocontactaccess.h> /* Qt */ @@ -20,5 +22,5 @@ namespace Opie { namespace Security { -SecOwnerDlg::SecOwnerDlg( QWidget *parent, const char * name, Contact c, +SecOwnerDlg::SecOwnerDlg( QWidget *parent, const char * name, const QString& c, bool modal, bool fullscreen = FALSE ) : QDialog( parent, name, modal, @@ -32,5 +34,5 @@ SecOwnerDlg::SecOwnerDlg( QWidget *parent, const char * name, Contact c, // set up contents. QString text("<H3>" + tr("Please contact the owner (directions follow), or try again clicking of this screen (and waiting for the penalty time) if you are the legitimate owner") + "</H3>"); - text += c.toRichText(); + text += c; tv = new QTextView(this); tv->setText(text); @@ -64,9 +66,10 @@ int runPlugins() { QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf"); - if (QFile::exists(vfilename)) { - Contact c; - c = Contact::readVCard( vfilename )[0]; - - oi = new SecOwnerDlg(0, 0, c, TRUE, TRUE); + Opie::OPimContactAccess acc( "multiauth", vfilename, + new Opie::OPimContactAccessBackend_VCard( "multiauth", vfilename ) ); + if ( acc.load() ) { + Opie::OPimContact contact = acc.allRecords()[0]; + if ( !contact.isEmpty() ) + oi = new SecOwnerDlg(0, 0, contact.toRichText(), TRUE, TRUE); } @@ -187,5 +190,5 @@ int runPlugins() { } // end if plugin recognized } //end for - if(oi) delete oi; + delete oi; return 1; } |