• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kleopatra

  • sources
  • kde-4.14
  • kdepim
  • kleopatra
kleopatraapplication.cpp
Go to the documentation of this file.
1 /*
2  kleopatraapplication.cpp
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2008 Klarälvdalens Datakonsult AB
6 
7  Kleopatra is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  Kleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #include <config-kleopatra.h>
34 
35 #include "kleopatraapplication.h"
36 
37 #include "mainwindow.h"
38 #include "systrayicon.h"
39 #include <smartcard/readerstatus.h>
40 #include <conf/configuredialog.h>
41 
42 #include <utils/gnupg-helper.h>
43 #include <utils/filesystemwatcher.h>
44 #include <utils/kdpipeiodevice.h>
45 #include <utils/log.h>
46 #include <utils/getpid.h>
47 
48 #include <gpgme++/key.h>
49 #include <models/keycache.h>
50 
51 #ifdef HAVE_USABLE_ASSUAN
52 # include <uiserver/uiserver.h>
53 #endif
54 
55 #include <commands/signencryptfilescommand.h>
56 #include <commands/decryptverifyfilescommand.h>
57 #include <commands/lookupcertificatescommand.h>
58 #include <commands/detailscommand.h>
59 
60 #include <KGlobal>
61 #include <KIconLoader>
62 #include <KLocalizedString>
63 #include <KCmdLineOptions>
64 #include <KDebug>
65 #include <KUrl>
66 #include <KWindowSystem>
67 
68 #include <QFile>
69 #include <QDir>
70 #include <QPointer>
71 
72 #ifndef Q_MOC_RUN
73 #include <boost/shared_ptr.hpp>
74 #include <boost/range.hpp>
75 #include <boost/bind.hpp>
76 #include <boost/mem_fn.hpp>
77 #endif
78 
79 #include <memory>
80 
81 using namespace Kleo;
82 using namespace Kleo::Commands;
83 using namespace boost;
84 
85 static void add_resources() {
86  KGlobal::locale()->insertCatalog( QLatin1String("libkleopatra") );
87  KIconLoader::global()->addAppDir( QLatin1String("libkleopatra") );
88  KIconLoader::global()->addAppDir( QLatin1String("kwatchgnupg") );
89  KIconLoader::global()->addAppDir( QLatin1String("kdepim") );
90 }
91 
92 static const struct {
93  const char * option;
94  const char * description;
95  char short_option[4];
96 } kleo_options[] = {
97  { "daemon", I18N_NOOP("Run UI server only, hide main window"), "" },
98  { "openpgp", I18N_NOOP("Use OpenPGP for the following operation"), "p" },
99  { "cms", I18N_NOOP("Use CMS (X.509, S/MIME) for the following operation"), "c" },
100  { "import-certificate", I18N_NOOP("Import certificate file(s)"), "i" },
101  { "encrypt", I18N_NOOP("Encrypt file(s)"), "e" },
102  { "sign", I18N_NOOP("Sign file(s)"), "s" },
103  { "sign-encrypt", I18N_NOOP("Sign and/or encrypt file(s)"), "E" },
104  { "encrypt-sign", I18N_NOOP("Same as --sign-encrypt, do not use"), "" },
105  { "decrypt", I18N_NOOP("Decrypt file(s)"), "d" },
106  { "verify", I18N_NOOP("Verify file/signature"), "V" },
107  { "decrypt-verify", I18N_NOOP("Decrypt and/or verify file(s)"), "D" },
108  { "query <fingerprint>",I18N_NOOP("Search for Certificate by fingerprint"), "q" },
109  { "parent-windowid <windowId>", I18N_NOOP("Parent Window Id for dialogs"), "" },
110  //{ "show-certificate", I18N_NOOP("Show Certificate(s) by fingerprint(s)"), "" },
111 };
112 
113 
114 static KCmdLineOptions make_kleopatra_args() {
115  KCmdLineOptions options;
116 #ifdef HAVE_USABLE_ASSUAN
117  options.add("uiserver-socket <argument>", ki18n("Location of the socket the ui server is listening on" ));
118 #endif
119  for ( unsigned int i = 0 ; i < sizeof kleo_options / sizeof *kleo_options ; ++i ) {
120  if ( *kleo_options[i].short_option )
121  options.add( kleo_options[i].short_option );
122  options.add( kleo_options[i].option, ki18n( kleo_options[i].description ) );
123  }
124  options.add("+[File]", ki18n("File(s) to process"));
125  return options;
126 }
127 
128 // static
129 KCmdLineOptions KleopatraApplication::commandLineOptions() {
130  static KCmdLineOptions options = make_kleopatra_args();
131  return options;
132 }
133 
134 static QList<QByteArray> default_logging_options() {
135  QList<QByteArray> result;
136  result.push_back( "io" );
137  return result;
138 }
139 
140 class KleopatraApplication::Private {
141  friend class ::KleopatraApplication;
142  KleopatraApplication * const q;
143 public:
144  explicit Private( KleopatraApplication * qq )
145  : q( qq ),
146  ignoreNewInstance( true ),
147  firstNewInstance( true )
148  {
149  KDAB_SET_OBJECT_NAME( readerStatus );
150 #ifndef QT_NO_SYSTEMTRAYICON
151  KDAB_SET_OBJECT_NAME( sysTray );
152 
153  sysTray.setAnyCardHasNullPin( readerStatus.anyCardHasNullPin() );
154  sysTray.setAnyCardCanLearnKeys( readerStatus.anyCardCanLearnKeys() );
155 
156  connect( &readerStatus, SIGNAL(anyCardHasNullPinChanged(bool)),
157  &sysTray, SLOT(setAnyCardHasNullPin(bool)) );
158  connect( &readerStatus, SIGNAL(anyCardCanLearnKeysChanged(bool)),
159  &sysTray, SLOT(setAnyCardCanLearnKeys(bool)) );
160 #endif
161  }
162 
163 private:
164  void connectConfigureDialog() {
165  if ( configureDialog && q->mainWindow() )
166  connect( configureDialog, SIGNAL(configCommitted()), q->mainWindow(), SLOT(slotConfigCommitted()) );
167  }
168  void disconnectConfigureDialog() {
169  if ( configureDialog && q->mainWindow() )
170  disconnect( configureDialog, SIGNAL(configCommitted()), q->mainWindow(), SLOT(slotConfigCommitted()) );
171  }
172 
173 public:
174  bool ignoreNewInstance;
175  bool firstNewInstance;
176  QPointer<ConfigureDialog> configureDialog;
177  QPointer<MainWindow> mainWindow;
178  SmartCard::ReaderStatus readerStatus;
179 #ifndef QT_NO_SYSTEMTRAYICON
180  SysTrayIcon sysTray;
181 #endif
182  shared_ptr<KeyCache> keyCache;
183  shared_ptr<Log> log;
184  shared_ptr<FileSystemWatcher> watcher;
185 
186 public:
187  void setupKeyCache() {
188  keyCache = KeyCache::mutableInstance();
189  watcher.reset( new FileSystemWatcher );
190 
191  watcher->blacklistFiles( gnupgFileBlacklist() );
192  watcher->addPath( gnupgHomeDirectory() );
193  watcher->setDelay( 1000 );
194  keyCache->addFileSystemWatcher( watcher );
195  }
196 
197  void setupLogging() {
198  log = Log::mutableInstance();
199 
200  const QByteArray envOptions = qgetenv( "KLEOPATRA_LOGOPTIONS" );
201  const bool logAll = envOptions.trimmed() == "all";
202  const QList<QByteArray> options = envOptions.isEmpty() ? default_logging_options() : envOptions.split( ',' ) ;
203 
204  const QByteArray dirNative = qgetenv( "KLEOPATRA_LOGDIR" );
205  if ( dirNative.isEmpty() )
206  return;
207  const QString dir = QFile::decodeName( dirNative );
208  const QString logFileName = QDir( dir ).absoluteFilePath( QString::fromLatin1( "kleopatra.log.%1" ).arg( mygetpid() ) );
209  std::auto_ptr<QFile> logFile( new QFile( logFileName ) );
210  if ( !logFile->open( QIODevice::WriteOnly | QIODevice::Append ) ) {
211  kDebug() << "Could not open file for logging: " << logFileName << "\nLogging disabled";
212  return;
213  }
214 
215  log->setOutputDirectory( dir );
216  if ( logAll || options.contains( "io" ) )
217  log->setIOLoggingEnabled( true );
218  qInstallMsgHandler( Log::messageHandler );
219 
220 #ifdef HAVE_USABLE_ASSUAN
221  if ( logAll || options.contains( "pipeio" ) )
222  KDPipeIODevice::setDebugLevel( KDPipeIODevice::Debug );
223  UiServer::setLogStream( log->logFile() );
224 #endif
225 
226  }
227 };
228 
229 
230 KleopatraApplication::KleopatraApplication()
231  : KUniqueApplication(), d( new Private( this ) )
232 {
233  add_resources();
234  d->setupKeyCache();
235  d->setupLogging();
236 #ifndef QT_NO_SYSTEMTRAYICON
237  d->sysTray.show();
238 #endif
239  setQuitOnLastWindowClosed( false );
240  KWindowSystem::allowExternalProcessWindowActivation();
241 }
242 
243 KleopatraApplication::~KleopatraApplication() {
244  // work around kdelibs bug https://bugs.kde.org/show_bug.cgi?id=162514
245  KGlobal::config()->sync();
246 }
247 
248 static QStringList files_from_args( const shared_ptr<const KCmdLineArgs> & args ) {
249  QStringList result;
250  for ( int i = 0, end = args->count() ; i < end ; ++i ) {
251  const KUrl url = args->url(i);
252  if ( url.protocol() == QLatin1String("file") )
253  result.push_back( url.toLocalFile() );
254  }
255  return result;
256 }
257 
258 namespace {
259  typedef void (KleopatraApplication::*Func)( const QStringList &, GpgME::Protocol );
260  struct _Funcs {
261  const char * opt;
262  Func func;
263  };
264 }
265 
266 int KleopatraApplication::newInstance() {
267  kDebug() << "ignoreNewInstance =" << d->ignoreNewInstance;
268  if ( d->ignoreNewInstance )
269  return 0;
270 
271  const shared_ptr<KCmdLineArgs> args( KCmdLineArgs::parsedArgs(), mem_fn( &KCmdLineArgs::clear ) );
272 
273  const QStringList files = files_from_args( args );
274 
275  const bool openpgp = args->isSet( "openpgp" );
276  const bool cms = args->isSet( "cms" );
277 
278  kDebug( openpgp ) << "found OpenPGP";
279  kDebug( cms ) << "found CMS";
280 
281  if ( openpgp && cms ) {
282  kDebug() << "ambigious protocol: --openpgp and --cms";
283  return 1;
284  }
285 
286  // Check for --query command
287  if ( args->isSet( "query" ) ) {
288  const QString fingerPrint = args->getOption( "query" );
289  if ( fingerPrint.isEmpty() ) {
290  kDebug() << "no fingerprint specified: --query";
291  return 1;
292  }
293 
294  // Check for Parent Window id
295  WId parentId = 0;
296  if ( args->isSet( "parent-windowid" ) ) {
297 #ifdef Q_OS_WIN
298  // WId is not a portable type as it is a pointer type on Windows.
299  // casting it from an integer is ok though as the values are guranteed to
300  // be compatible in the documentation.
301  parentId = reinterpret_cast<WId>( args->getOption( "parent-windowid" ).toUInt() );
302 #else
303  parentId = args->getOption( "parent-windowid" ).toUInt();
304 #endif
305  }
306 
307  // Search for local keys
308  const GpgME::Key &key = Kleo::KeyCache::instance()->findByKeyIDOrFingerprint( fingerPrint.toLocal8Bit().data() );
309  if ( key.isNull() ) {
310  // Show external search dialog
311  LookupCertificatesCommand * const cmd = new LookupCertificatesCommand( fingerPrint, 0 );
312  if ( parentId != 0 ) {
313  cmd->setParentWId( parentId );
314  };
315  cmd->start();
316  return 0;
317  } else {
318  // show local detail
319  DetailsCommand * const cmd = new DetailsCommand( key, 0 );
320  if ( parentId != 0 ) {
321  cmd->setParentWId( parentId );
322  };
323  cmd->start();
324  return 0;
325  }
326 
327  }
328 
329  static const _Funcs funcs[] = {
330 #ifndef QT_NO_SYSTEMTRAYICON
331  { "import-certificate", &KleopatraApplication::importCertificatesFromFile },
332 #endif
333  { "encrypt", &KleopatraApplication::encryptFiles },
334  { "sign", &KleopatraApplication::signFiles },
335  { "encrypt-sign", &KleopatraApplication::signEncryptFiles },
336  { "sign-encrypt", &KleopatraApplication::signEncryptFiles },
337  { "decrypt", &KleopatraApplication::decryptFiles },
338  { "verify", &KleopatraApplication::verifyFiles },
339  { "decrypt-verify", &KleopatraApplication::decryptVerifyFiles },
340  };
341 
342  const _Funcs * const it1 = std::find_if( begin( funcs ), end( funcs ),
343  boost::bind( &KCmdLineArgs::isSet, args, boost::bind( &_Funcs::opt, _1 ) ) );
344 
345  if ( const Func func = it1 == end( funcs ) ? 0 : it1->func ) {
346  const _Funcs * it2 = std::find_if( it1+1, end( funcs ),
347  boost::bind( &KCmdLineArgs::isSet, args, boost::bind( &_Funcs::opt, _1 ) ) );
348  if ( it2 != end( funcs ) ) {
349  kDebug() << "ambiguous command" << it1->opt << "vs." << it2->opt;
350  return 1;
351  }
352  if ( files.empty() ) {
353  kDebug() << it1->opt << "without arguments";
354  return 1;
355  }
356  kDebug() << "found" << it1->opt;
357  (this->*func)( files, openpgp ? GpgME::OpenPGP : cms ? GpgME::CMS : GpgME::UnknownProtocol );
358  } else {
359  if ( files.empty() ) {
360  if ( ! ( d->firstNewInstance && isSessionRestored() ) ) {
361  kDebug() << "openOrRaiseMainWindow";
362  openOrRaiseMainWindow();
363  }
364  } else {
365  kDebug() << "files without command"; // possible?
366  return 1;
367  }
368  }
369 
370  return 0;
371 }
372 
373 #ifndef QT_NO_SYSTEMTRAYICON
374 const SysTrayIcon * KleopatraApplication::sysTrayIcon() const {
375  return &d->sysTray;
376 }
377 
378 SysTrayIcon * KleopatraApplication::sysTrayIcon() {
379  return &d->sysTray;
380 }
381 #endif
382 
383 const MainWindow * KleopatraApplication::mainWindow() const {
384  return d->mainWindow;
385 }
386 
387 MainWindow * KleopatraApplication::mainWindow() {
388  return d->mainWindow;
389 }
390 
391 void KleopatraApplication::setMainWindow( MainWindow * mainWindow ) {
392  if ( mainWindow == d->mainWindow )
393  return;
394 
395  d->disconnectConfigureDialog();
396 
397  d->mainWindow = mainWindow;
398 #ifndef QT_NO_SYSTEMTRAYICON
399  d->sysTray.setMainWindow( mainWindow );
400 #endif
401 
402  d->connectConfigureDialog();
403 }
404 
405 static void open_or_raise( QWidget * w ) {
406  if ( w->isMinimized() ) {
407  KWindowSystem::unminimizeWindow( w->winId());
408  w->raise();
409  } else if ( w->isVisible() ) {
410  w->raise();
411  } else {
412  w->show();
413  }
414 }
415 
416 void KleopatraApplication::toggleMainWindowVisibility()
417 {
418  if ( mainWindow() ) {
419  mainWindow()->setVisible( !mainWindow()->isVisible() );
420  } else {
421  openOrRaiseMainWindow();
422  }
423 }
424 
425 void KleopatraApplication::restoreMainWindow() {
426  kDebug() << "restoring main window";
427 
428  // Sanity checks
429  if ( !isSessionRestored() ) {
430  kDebug() << "Not in session restore";
431  return;
432  }
433 
434  if ( mainWindow() ) {
435  kDebug() << "Already have main window";
436  return;
437  }
438 
439 
440  MainWindow * mw = new MainWindow;
441  if ( KMainWindow::canBeRestored( 1 ) ) {
442  // restore to hidden state, Mainwindow::readProperties() will
443  // restore saved visibility.
444  mw->restore( 1, false );
445  }
446 
447  mw->setAttribute( Qt::WA_DeleteOnClose );
448  setMainWindow( mw );
449  d->connectConfigureDialog();
450 
451 }
452 
453 void KleopatraApplication::openOrRaiseMainWindow() {
454  MainWindow * mw = mainWindow();
455  if ( !mw ) {
456  mw = new MainWindow;
457  mw->setAttribute( Qt::WA_DeleteOnClose );
458  setMainWindow( mw );
459  d->connectConfigureDialog();
460  }
461  open_or_raise( mw );
462 }
463 
464 void KleopatraApplication::openOrRaiseConfigDialog() {
465  if ( !d->configureDialog ) {
466  d->configureDialog = new ConfigureDialog;
467  d->configureDialog->setAttribute( Qt::WA_DeleteOnClose );
468  d->connectConfigureDialog();
469  }
470  open_or_raise( d->configureDialog );
471 }
472 
473 #ifndef QT_NO_SYSTEMTRAYICON
474 void KleopatraApplication::startMonitoringSmartCard() {
475  d->readerStatus.startMonitoring();
476 }
477 
478 void KleopatraApplication::importCertificatesFromFile( const QStringList & files, GpgME::Protocol /*proto*/) {
479  openOrRaiseMainWindow();
480  if ( !files.empty() )
481  d->sysTray.mainWindow()->importCertificatesFromFile( files );
482 }
483 #endif // QT_NO_SYSTEMTRAYICON
484 
485 void KleopatraApplication::encryptFiles( const QStringList & files, GpgME::Protocol proto ) {
486  SignEncryptFilesCommand * const cmd = new SignEncryptFilesCommand( files, 0 );
487  cmd->setEncryptionPolicy( Force );
488  cmd->setSigningPolicy( Allow );
489  if ( proto != GpgME::UnknownProtocol )
490  cmd->setProtocol( proto );
491  cmd->start();
492 }
493 
494 void KleopatraApplication::signFiles( const QStringList & files, GpgME::Protocol proto ) {
495  SignEncryptFilesCommand * const cmd = new SignEncryptFilesCommand( files, 0 );
496  cmd->setSigningPolicy( Force );
497  cmd->setEncryptionPolicy( Deny );
498  if ( proto != GpgME::UnknownProtocol )
499  cmd->setProtocol( proto );
500  cmd->start();
501 }
502 
503 void KleopatraApplication::signEncryptFiles( const QStringList & files, GpgME::Protocol proto ) {
504  SignEncryptFilesCommand * const cmd = new SignEncryptFilesCommand( files, 0 );
505  if ( proto != GpgME::UnknownProtocol )
506  cmd->setProtocol( proto );
507  cmd->start();
508 }
509 
510 void KleopatraApplication::decryptFiles( const QStringList & files, GpgME::Protocol /*proto*/ ) {
511  DecryptVerifyFilesCommand * const cmd = new DecryptVerifyFilesCommand( files, 0 );
512  cmd->setOperation( Decrypt );
513  cmd->start();
514 }
515 
516 void KleopatraApplication::verifyFiles( const QStringList & files, GpgME::Protocol /*proto*/ ) {
517  DecryptVerifyFilesCommand * const cmd = new DecryptVerifyFilesCommand( files, 0 );
518  cmd->setOperation( Verify );
519  cmd->start();
520 }
521 
522 void KleopatraApplication::decryptVerifyFiles( const QStringList & files, GpgME::Protocol /*proto*/ ) {
523  DecryptVerifyFilesCommand * const cmd = new DecryptVerifyFilesCommand( files, 0 );
524  cmd->start();
525 }
526 
527 void KleopatraApplication::setIgnoreNewInstance( bool ignore ) {
528  d->ignoreNewInstance = ignore;
529 }
530 
531 void KleopatraApplication::setFirstNewInstance( bool on ) {
532  d->firstNewInstance = on;
533 }
534 
535 
536 bool KleopatraApplication::ignoreNewInstance() const {
537  return d->ignoreNewInstance;
538 }
539 
decryptverifyfilescommand.h
QWidget
Kleo::Force
Definition: types.h:61
KleopatraApplication::decryptVerifyFiles
void decryptVerifyFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:522
description
const char * description
Definition: kleopatraapplication.cpp:94
QByteArray::trimmed
QByteArray trimmed() const
QList::push_back
void push_back(const T &value)
QByteArray
getpid.h
Kleo::gnupgHomeDirectory
QString gnupgHomeDirectory()
Definition: gnupg-helper.cpp:56
KleopatraApplication::encryptFiles
void encryptFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:485
Kleo::Deny
Definition: types.h:62
Kleo::Commands::DecryptVerifyFilesCommand
Definition: commands/decryptverifyfilescommand.h:45
QPointer< ConfigureDialog >
Kleo::Commands::SignEncryptFilesCommand::setEncryptionPolicy
void setEncryptionPolicy(Policy force)
Definition: commands/signencryptfilescommand.cpp:173
QByteArray::isEmpty
bool isEmpty() const
QWidget::isVisible
bool isVisible() const
QWidget::setAttribute
void setAttribute(Qt::WidgetAttribute attribute, bool on)
Kleo::Command::start
void start()
Definition: commands/command.cpp:182
configuredialog.h
KDPipeIODevice::setDebugLevel
static void setDebugLevel(DebugLevel level)
Definition: kdpipeiodevice.cpp:240
KleopatraApplication::restoreMainWindow
void restoreMainWindow()
Definition: kleopatraapplication.cpp:425
readerstatus.h
option
const char * option
Definition: kleopatraapplication.cpp:93
Kleo::gnupgFileBlacklist
QStringList gnupgFileBlacklist()
Definition: gnupg-helper.cpp:90
Kleo::Allow
Definition: types.h:60
add_resources
static void add_resources()
Definition: kleopatraapplication.cpp:85
QFile
KleopatraApplication
Definition: kleopatraapplication.h:46
Kleo::Commands::LookupCertificatesCommand
Definition: lookupcertificatescommand.h:41
KleopatraApplication::openOrRaiseMainWindow
void openOrRaiseMainWindow()
Definition: kleopatraapplication.cpp:453
KleopatraApplication::setIgnoreNewInstance
void setIgnoreNewInstance(bool on)
Definition: kleopatraapplication.cpp:527
lookupcertificatescommand.h
boost::shared_ptr< KeyCache >
d
#define d
Definition: adduseridcommand.cpp:89
KleopatraApplication::ignoreNewInstance
bool ignoreNewInstance() const
Definition: kleopatraapplication.cpp:536
QList::empty
bool empty() const
Kleo::FileSystemWatcher
Definition: filesystemwatcher.h:45
KleopatraApplication::mainWindow
const MainWindow * mainWindow() const
Definition: kleopatraapplication.cpp:383
KDPipeIODevice::Debug
Definition: kdpipeiodevice.h:35
Kleo::Class::OpenPGP
Definition: classify.h:49
KleopatraApplication::sysTrayIcon
const SysTrayIcon * sysTrayIcon() const
Definition: kleopatraapplication.cpp:374
Kleo::Command::setParentWId
void setParentWId(WId wid)
Definition: commands/command.cpp:140
QWidget::raise
void raise()
QString::isEmpty
bool isEmpty() const
KleopatraApplication::decryptFiles
void decryptFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:510
KleopatraApplication::verifyFiles
void verifyFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:516
mainwindow.h
KDAB_SET_OBJECT_NAME
#define KDAB_SET_OBJECT_NAME(x)
Definition: kdtoolsglobal.h:66
Kleo::Log::messageHandler
static void messageHandler(QtMsgType type, const char *msg)
Definition: log.cpp:73
Kleo::Verify
Definition: types.h:47
Kleo::Class::CMS
Definition: classify.h:48
QWidget::winId
WId winId() const
QString
QList
Definition: commands/command.h:46
KleopatraApplication::openOrRaiseConfigDialog
void openOrRaiseConfigDialog()
Definition: kleopatraapplication.cpp:464
QStringList
systrayicon.h
detailscommand.h
gnupg-helper.h
KleopatraApplication::commandLineOptions
static KCmdLineOptions commandLineOptions()
Definition: kleopatraapplication.cpp:129
Kleo::Commands::SignEncryptFilesCommand::setProtocol
void setProtocol(GpgME::Protocol protocol)
Definition: commands/signencryptfilescommand.cpp:208
QString::toLocal8Bit
QByteArray toLocal8Bit() const
ConfigureDialog
Definition: configuredialog.h:39
QList::contains
bool contains(const T &value) const
kleo_options
static const struct @3 kleo_options[]
Kleo::UiServer::setLogStream
static void setLogStream(FILE *file)
Definition: uiserver.cpp:68
Kleo::Commands::DetailsCommand
Definition: detailscommand.h:45
QDir
KleopatraApplication::startMonitoringSmartCard
void startMonitoringSmartCard()
Definition: kleopatraapplication.cpp:474
dir
static QString dir(const QString &id)
Definition: filedialog.cpp:54
Kleo::SmartCard::ReaderStatus
Definition: readerstatus.h:46
signencryptfilescommand.h
KleopatraApplication::newInstance
int newInstance()
Definition: kleopatraapplication.cpp:266
QWidget::isMinimized
bool isMinimized() const
Kleo::Commands::DecryptVerifyFilesCommand::setOperation
void setOperation(DecryptVerifyOperation operation)
Definition: commands/decryptverifyfilescommand.cpp:137
Kleo::Commands::SignEncryptFilesCommand::setSigningPolicy
void setSigningPolicy(Policy policy)
Definition: commands/signencryptfilescommand.cpp:138
SysTrayIcon
Definition: systrayicon.h:45
filesystemwatcher.h
QLatin1String
default_logging_options
static QList< QByteArray > default_logging_options()
Definition: kleopatraapplication.cpp:134
KleopatraApplication::setFirstNewInstance
void setFirstNewInstance(bool on)
Definition: kleopatraapplication.cpp:531
KleopatraApplication::signEncryptFiles
void signEncryptFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:503
q
#define q
Definition: adduseridcommand.cpp:90
KleopatraApplication::setMainWindow
void setMainWindow(MainWindow *mw)
Definition: kleopatraapplication.cpp:391
kdpipeiodevice.h
QDir::absoluteFilePath
QString absoluteFilePath(const QString &fileName) const
Kleo::KeyCache::instance
static boost::shared_ptr< const KeyCache > instance()
Definition: keycache.cpp:190
KleopatraApplication::~KleopatraApplication
~KleopatraApplication()
Definition: kleopatraapplication.cpp:243
QByteArray::data
char * data()
KleopatraApplication::KleopatraApplication
KleopatraApplication()
Definition: kleopatraapplication.cpp:230
KleopatraApplication::importCertificatesFromFile
void importCertificatesFromFile(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:478
QString::fromLatin1
QString fromLatin1(const char *str, int size)
Kleo::Commands::SignEncryptFilesCommand
Definition: commands/signencryptfilescommand.h:47
QWidget::show
void show()
Kleo::Decrypt
Definition: types.h:46
Kleo::Log::mutableInstance
static boost::shared_ptr< Log > mutableInstance()
Definition: log.cpp:99
keycache.h
kleopatraapplication.h
files_from_args
static QStringList files_from_args(const shared_ptr< const KCmdLineArgs > &args)
Definition: kleopatraapplication.cpp:248
log.h
make_kleopatra_args
static KCmdLineOptions make_kleopatra_args()
Definition: kleopatraapplication.cpp:114
KleopatraApplication::toggleMainWindowVisibility
void toggleMainWindowVisibility()
Definition: kleopatraapplication.cpp:416
open_or_raise
static void open_or_raise(QWidget *w)
Definition: kleopatraapplication.cpp:405
short_option
char short_option[4]
Definition: kleopatraapplication.cpp:95
uiserver.h
Kleo::mygetpid
static qint64 mygetpid()
Definition: getpid.h:49
MainWindow
Definition: kgpgconf/mainwindow.h:47
QFile::decodeName
QString decodeName(const QByteArray &localFileName)
Kleo::KeyCache::mutableInstance
static boost::shared_ptr< KeyCache > mutableInstance()
Definition: keycache.cpp:194
KleopatraApplication::signFiles
void signFiles(const QStringList &files, GpgME::Protocol proto)
Definition: kleopatraapplication.cpp:494
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal