kleopatra
libkleopatraclient/core/command.cpp
Go to the documentation of this file.
209 const std::map<std::string,Private::Option>::const_iterator it = d->inputs.options.find( name );
252 const std::map<std::string,Private::Option>::const_iterator it = d->inputs.options.find( name );
359 explicit AssuanClientContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &assuan_disconnect ) {}
362 explicit AssuanClientContext( assuan_context_t ctx ) : AssuanContextBase( ctx, &my_assuan_release ) {}
383 return assuan_transact( ctx.get(), command, data_cb, data_cb_arg, inquire_cb, inquire_cb_arg, status_cb, status_cb_arg );
423 if ( !QProcess::startDetached( uiserver_executable(), QStringList() << QLatin1String( "--daemon" ) ) )
464 static assuan_error_t send_option( const AssuanClientContext & ctx, const char * name, const QVariant & value ) {
478 static assuan_error_t send_recipient( const AssuanClientContext & ctx, const QString & recipient, bool info ) {
487 static assuan_error_t send_sender( const AssuanClientContext & ctx, const QString & sender, bool info ) {
533 out.errorString = tr( "Could not allocate resources to connect to Kleopatra UI server at %1: %2" )
595 err = send_option( ctx, "window-id", QString().sprintf( "%lx", reinterpret_cast<quintptr>( in.parentWId ) ) );
597 err = send_option( ctx, "window-id", QString().sprintf( "%lx", static_cast<unsigned long>( in.parentWId ) ) );
603 for ( std::map<std::string,Option>::const_iterator it = in.options.begin(), end = in.options.end() ; it != end ; ++it )
604 if ( ( err = send_option( ctx, it->first.c_str(), it->second.hasValue ? it->second.value.toString() : QVariant() ) ) ) {
610 qDebug() << "Failed to send non-critical option" << it->first.c_str() << ":" << to_error_string( err );
639 err = my_assuan_transact( ctx, in.command.constData(), &command_data_cb, &out.data, &command_inquire_cb, &id );
QString serverLocation() const
Definition: libkleopatraclient/core/command.cpp:146
void cancel()
Definition: libkleopatraclient/core/command.cpp:187
QStringList filePaths() const
Definition: libkleopatraclient/core/command.cpp:261
QByteArray receivedData() const
Definition: libkleopatraclient/core/command.cpp:327
QObject * sender() const
bool error() const
Definition: libkleopatraclient/core/command.cpp:161
bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory, qint64 *pid)
bool isNull() const
void setSenders(const QStringList &senders, bool informative)
Definition: libkleopatraclient/core/command.cpp:284
bool isEmpty() const
static QString default_socket_name()
Definition: libkleopatraclient/core/command.cpp:413
T value() const
static assuan_error_t send_sender(const AssuanClientContext &ctx, const QString &sender, bool info)
Definition: libkleopatraclient/core/command.cpp:487
static assuan_error_t send_option(const AssuanClientContext &ctx, const char *name, const QVariant &value)
Definition: libkleopatraclient/core/command.cpp:464
QStringList senders() const
Definition: libkleopatraclient/core/command.cpp:290
char * default_homedir(void)
bool wasCanceled() const
Definition: libkleopatraclient/core/command.cpp:166
shared_ptr< remove_pointer< assuan_context_t >::type > AssuanContextBase
Definition: libkleopatraclient/core/command.cpp:354
WId parentWId() const
Definition: libkleopatraclient/core/command.cpp:135
QString errorString() const
Definition: libkleopatraclient/core/command.cpp:171
void start()
Definition: libkleopatraclient/core/command.cpp:183
QString homePath()
static assuan_error_t my_assuan_transact(const AssuanClientContext &ctx, const char *command, assuan_error_t(*data_cb)(void *, const void *, size_t)=0, void *data_cb_arg=0, assuan_error_t(*inquire_cb)(void *, const char *)=0, void *inquire_cb_arg=0, assuan_error_t(*status_cb)(void *, const char *)=0, void *status_cb_arg=0)
Definition: libkleopatraclient/core/command.cpp:374
QString tr(const char *sourceText, const char *disambiguation, int n)
static assuan_error_t getinfo_pid_cb(void *opaque, const void *buffer, size_t length)
Definition: libkleopatraclient/core/command.cpp:429
~Command()
Definition: libkleopatraclient/core/command.cpp:121
void start(Priority priority)
const char * name() const
QString fromLocal8Bit(const char *str, int size)
static std::string hexencode(const std::string &in)
Definition: libkleopatraclient/core/command.cpp:60
Command(QObject *parent=0)
Definition: libkleopatraclient/core/command.cpp:109
bool areSendersInformative() const
Definition: libkleopatraclient/core/command.cpp:295
static std::ostream & operator<<(std::ostream &s, const QByteArray &ba)
Definition: libkleopatraclient/core/command.cpp:460
qint64 serverPid() const
Definition: libkleopatraclient/core/command.cpp:177
QByteArray inquireData(const char *what) const
Definition: libkleopatraclient/core/command.cpp:311
void setCommand(const char *command)
Definition: libkleopatraclient/core/command.cpp:333
static QString uiserver_executable()
Definition: libkleopatraclient/core/command.cpp:418
bool isInquireDataSet(const char *what) const
Definition: libkleopatraclient/core/command.cpp:320
void setInquireData(const char *what, const QByteArray &data)
Definition: libkleopatraclient/core/command.cpp:301
void unsetInquireData(const char *what)
Definition: libkleopatraclient/core/command.cpp:306
bool isEmpty() const
const char * constData() const
bool waitForFinished()
Definition: libkleopatraclient/core/command.cpp:152
void setServerLocation(const QString &location)
Definition: libkleopatraclient/core/command.cpp:141
static QString gnupg_home_directory()
Definition: libkleopatraclient/core/command.cpp:394
QFuture< void > map(Sequence &sequence, MapFunction function)
bool areRecipientsInformative() const
Definition: libkleopatraclient/core/command.cpp:278
QByteArray & append(char ch)
void setOptionValue(const char *name, const QVariant &value, bool critical=true)
Definition: libkleopatraclient/core/command.cpp:192
bool isOptionSet(const char *name) const
Definition: libkleopatraclient/core/command.cpp:241
static QString get_default_socket_name()
Definition: libkleopatraclient/core/command.cpp:406
qlonglong toLongLong(bool *ok, int base) const
bool isOptionCritical(const char *name) const
Definition: libkleopatraclient/core/command.cpp:248
void setParentWId(WId wid)
Definition: libkleopatraclient/core/command.cpp:130
static assuan_error_t send_recipient(const AssuanClientContext &ctx, const QString &recipient, bool info)
Definition: libkleopatraclient/core/command.cpp:478
void setFilePaths(const QStringList &filePaths)
Definition: libkleopatraclient/core/command.cpp:256
bool wait(unsigned long time)
QByteArray command() const
Definition: libkleopatraclient/core/command.cpp:338
QString absoluteFilePath(const QString &fileName) const
char * data()
QString fromLatin1(const char *str, int size)
bool isValid() const
void setOption(const char *name, bool critical=true)
Definition: libkleopatraclient/core/command.cpp:217
QVariant optionValue(const char *name) const
Definition: libkleopatraclient/core/command.cpp:204
void started()
QStringList recipients() const
Definition: libkleopatraclient/core/command.cpp:273
void unsetOption(const char *name)
Definition: libkleopatraclient/core/command.cpp:234
int size() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
static QString to_error_string(int err)
Definition: libkleopatraclient/core/command.cpp:386
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QString toString() const
static assuan_error_t command_inquire_cb(void *opaque, const char *what)
Definition: libkleopatraclient/core/command.cpp:448
static assuan_error_t command_data_cb(void *opaque, const void *buffer, size_t length)
Definition: libkleopatraclient/core/command.cpp:435
void setRecipients(const QStringList &recipients, bool informative)
Definition: libkleopatraclient/core/command.cpp:267
QByteArray encodeName(const QString &fileName)
QString decodeName(const QByteArray &localFileName)
void finished()
static assuan_error_t send_file(const AssuanClientContext &ctx, const QString &file)
Definition: libkleopatraclient/core/command.cpp:472
QByteArray toUtf8() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.