LCOV - code coverage report
Current view: top level - lang/qt/src - job.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 14 40 35.0 %
Date: 2016-09-12 13:07:23 Functions: 16 81 19.8 %

          Line data    Source code
       1             : /*
       2             :     job.cpp
       3             : 
       4             :     This file is part of qgpgme, the Qt API binding for gpgme
       5             :     Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
       6             :     Copyright (c) 2016 Intevation GmbH
       7             : 
       8             :     QGpgME is free software; you can redistribute it and/or
       9             :     modify it under the terms of the GNU General Public License as
      10             :     published by the Free Software Foundation; either version 2 of the
      11             :     License, or (at your option) any later version.
      12             : 
      13             :     QGpgME is distributed in the hope that it will be useful,
      14             :     but WITHOUT ANY WARRANTY; without even the implied warranty of
      15             :     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      16             :     General Public License for more details.
      17             : 
      18             :     You should have received a copy of the GNU General Public License
      19             :     along with this program; if not, write to the Free Software
      20             :     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
      21             : 
      22             :     In addition, as a special exception, the copyright holders give
      23             :     permission to link the code of this program with any edition of
      24             :     the Qt library by Trolltech AS, Norway (or with modified versions
      25             :     of Qt that use the same license as Qt), and distribute linked
      26             :     combinations including the two.  You must obey the GNU General
      27             :     Public License in all respects for all of the code used other than
      28             :     Qt.  If you modify this file, you may extend this exception to
      29             :     your version of the file, but you are not obligated to do so.  If
      30             :     you do not wish to do so, delete this exception statement from
      31             :     your version.
      32             : */
      33             : 
      34             : #include "job.h"
      35             : 
      36             : #include "keylistjob.h"
      37             : #include "listallkeysjob.h"
      38             : #include "encryptjob.h"
      39             : #include "decryptjob.h"
      40             : #include "decryptverifyjob.h"
      41             : #include "signjob.h"
      42             : #include "signkeyjob.h"
      43             : #include "signencryptjob.h"
      44             : #include "verifydetachedjob.h"
      45             : #include "verifyopaquejob.h"
      46             : #include "keygenerationjob.h"
      47             : #include "importjob.h"
      48             : #include "importfromkeyserverjob.h"
      49             : #include "exportjob.h"
      50             : #include "changeexpiryjob.h"
      51             : #include "changeownertrustjob.h"
      52             : #include "changepasswdjob.h"
      53             : #include "downloadjob.h"
      54             : #include "deletejob.h"
      55             : #include "refreshkeysjob.h"
      56             : #include "adduseridjob.h"
      57             : #include "specialjob.h"
      58             : #include "keyformailboxjob.h"
      59             : #include "wkspublishjob.h"
      60             : 
      61             : #include <QCoreApplication>
      62             : #include <QDebug>
      63             : 
      64             : #include <gpg-error.h>
      65             : 
      66          34 : QGpgME::Job::Job(QObject *parent)
      67          34 :     : QObject(parent)
      68             : {
      69          34 :     if (QCoreApplication *app = QCoreApplication::instance()) {
      70          34 :         connect(app, &QCoreApplication::aboutToQuit, this, &Job::slotCancel);
      71             :     }
      72          34 : }
      73             : 
      74          34 : QGpgME::Job::~Job()
      75             : {
      76             : 
      77          34 : }
      78             : 
      79           0 : QString QGpgME::Job::auditLogAsHtml() const
      80             : {
      81           0 :     qDebug() << "QGpgME::Job::auditLogAsHtml() should be reimplemented in Kleo::Job subclasses!";
      82           0 :     return QString();
      83             : }
      84             : 
      85           0 : GpgME::Error QGpgME::Job::auditLogError() const
      86             : {
      87           0 :     qDebug() << "QGpgME::Job::auditLogError() should be reimplemented in Kleo::Job subclasses!";
      88           0 :     return GpgME::Error::fromCode(GPG_ERR_NOT_IMPLEMENTED);
      89             : }
      90             : 
      91           0 : bool QGpgME::Job::isAuditLogSupported() const
      92             : {
      93           0 :     return auditLogError().code() != GPG_ERR_NOT_IMPLEMENTED;
      94             : }
      95             : 
      96             : #define make_job_subclass_ext(x,y)                \
      97             :     QGpgME::x::x( QObject * parent ) : y( parent ) {} \
      98             :     QGpgME::x::~x() {}
      99             : 
     100             : #define make_job_subclass(x) make_job_subclass_ext(x,Job)
     101             : 
     102          22 : make_job_subclass(KeyListJob)
     103           0 : make_job_subclass(ListAllKeysJob)
     104           6 : make_job_subclass(EncryptJob)
     105           4 : make_job_subclass(DecryptJob)
     106           0 : make_job_subclass(DecryptVerifyJob)
     107          12 : make_job_subclass(SignJob)
     108           0 : make_job_subclass(SignEncryptJob)
     109           0 : make_job_subclass(SignKeyJob)
     110           0 : make_job_subclass(VerifyDetachedJob)
     111          18 : make_job_subclass(VerifyOpaqueJob)
     112           0 : make_job_subclass(KeyGenerationJob)
     113           0 : make_job_subclass(AbstractImportJob)
     114           0 : make_job_subclass_ext(ImportJob, AbstractImportJob)
     115           0 : make_job_subclass_ext(ImportFromKeyserverJob, AbstractImportJob)
     116           0 : make_job_subclass(ExportJob)
     117           0 : make_job_subclass(ChangeExpiryJob)
     118           4 : make_job_subclass(ChangeOwnerTrustJob)
     119           0 : make_job_subclass(ChangePasswdJob)
     120           0 : make_job_subclass(DownloadJob)
     121           0 : make_job_subclass(DeleteJob)
     122           0 : make_job_subclass(RefreshKeysJob)
     123           0 : make_job_subclass(AddUserIDJob)
     124           0 : make_job_subclass(SpecialJob)
     125           0 : make_job_subclass(KeyForMailboxJob)
     126           2 : make_job_subclass(WKSPublishJob)
     127             : 
     128             : #undef make_job_subclass
     129             : 
     130             : #include "job.moc"
     131             : 
     132             : #include "keylistjob.moc"
     133             : #include "listallkeysjob.moc"
     134             : #include "encryptjob.moc"
     135             : #include "decryptjob.moc"
     136             : #include "decryptverifyjob.moc"
     137             : #include "signjob.moc"
     138             : #include "signencryptjob.moc"
     139             : #include "signkeyjob.moc"
     140             : #include "verifydetachedjob.moc"
     141             : #include "verifyopaquejob.moc"
     142             : #include "keygenerationjob.moc"
     143             : #include "abstractimportjob.moc"
     144             : #include "importjob.moc"
     145             : #include "importfromkeyserverjob.moc"
     146             : #include "exportjob.moc"
     147             : #include "changeexpiryjob.moc"
     148             : #include "changeownertrustjob.moc"
     149             : #include "changepasswdjob.moc"
     150             : #include "downloadjob.moc"
     151             : #include "deletejob.moc"
     152             : #include "refreshkeysjob.moc"
     153             : #include "adduseridjob.moc"
     154             : #include "specialjob.moc"
     155             : #include "keyformailboxjob.moc"
     156             : #include "wkspublishjob.moc"

Generated by: LCOV version 1.11