LCOV - code coverage report
Current view: top level - lang/qt/src - qgpgmetofupolicyjob.cpp (source / functions) Hit Total Coverage
Test: coverage.info Lines: 10 13 76.9 %
Date: 2017-03-02 17:11:10 Functions: 5 6 83.3 %

          Line data    Source code
       1             : /* qgpgmetofupolicyjob.cpp
       2             : 
       3             :     Copyright (c) 2016 Intevation GmbH
       4             : 
       5             :     QGpgME is free software; you can redistribute it and/or
       6             :     modify it under the terms of the GNU General Public License as
       7             :     published by the Free Software Foundation; either version 2 of the
       8             :     License, or (at your option) any later version.
       9             : 
      10             :     QGpgME is distributed in the hope that it will be useful,
      11             :     but WITHOUT ANY WARRANTY; without even the implied warranty of
      12             :     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13             :     General Public License for more details.
      14             : 
      15             :     You should have received a copy of the GNU General Public License along
      16             :     with this program; if not, write to the Free Software Foundation, Inc.,
      17             :     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
      18             : 
      19             :     In addition, as a special exception, the copyright holders give
      20             :     permission to link the code of this program with any edition of
      21             :     the Qt library by Trolltech AS, Norway (or with modified versions
      22             :     of Qt that use the same license as Qt), and distribute linked
      23             :     combinations including the two.  You must obey the GNU General
      24             :     Public License in all respects for all of the code used other than
      25             :     Qt.  If you modify this file, you may extend this exception to
      26             :     your version of the file, but you are not obligated to do so.  If
      27             :     you do not wish to do so, delete this exception statement from
      28             :     your version.
      29             : */
      30             : 
      31             : #ifdef HAVE_CONFIG_H
      32             :  #include "config.h"
      33             : #endif
      34             : 
      35             : #include "qgpgmetofupolicyjob.h"
      36             : 
      37             : #include "context.h"
      38             : #include "key.h"
      39             : #include "tofuinfo.h"
      40             : 
      41             : 
      42             : using namespace QGpgME;
      43             : using namespace GpgME;
      44             : 
      45           1 : QGpgMETofuPolicyJob::QGpgMETofuPolicyJob(Context *context)
      46           1 :     : mixin_type(context)
      47             : {
      48           1 :     lateInitialization();
      49           1 : }
      50             : 
      51           2 : QGpgMETofuPolicyJob::~QGpgMETofuPolicyJob() {}
      52             : 
      53           2 : static QGpgMETofuPolicyJob::result_type policy_worker(Context *ctx, const Key &key, TofuInfo::Policy policy)
      54             : {
      55           4 :     return std::make_tuple (ctx->setTofuPolicy(key, policy),
      56           6 :                             QString(), Error());
      57             : }
      58             : 
      59           0 : void QGpgMETofuPolicyJob::start(const Key &key, TofuInfo::Policy policy)
      60             : {
      61           0 :     run(std::bind(&policy_worker, std::placeholders::_1, key, policy));
      62           0 : }
      63             : 
      64           2 : Error QGpgMETofuPolicyJob::exec(const Key &key, TofuInfo::Policy policy)
      65             : {
      66           2 :     return std::get<0>(policy_worker(context(), key, policy));
      67             : }
      68             : 
      69             : #include "qgpgmetofupolicyjob.moc"

Generated by: LCOV version 1.13