Allow setting KAuth parent widget.
This commit is contained in:
parent
4b1793f79b
commit
5814c6c02a
|
@ -58,6 +58,8 @@ KAuth::ExecuteJob* ExternalCommand::m_job;
|
|||
QCA::PrivateKey* ExternalCommand::privateKey;
|
||||
QCA::Initializer* ExternalCommand::init;
|
||||
bool ExternalCommand::helperStarted = false;
|
||||
QWidget* ExternalCommand::parent;
|
||||
|
||||
|
||||
/** Creates a new ExternalCommand instance without Report.
|
||||
@param cmd the command to run
|
||||
|
@ -368,6 +370,7 @@ bool ExternalCommand::startHelper()
|
|||
KAuth::Action action = KAuth::Action(QStringLiteral("org.kde.kpmcore.externalcommand.init"));
|
||||
action.setHelperId(QStringLiteral("org.kde.kpmcore.externalcommand"));
|
||||
action.setTimeout(10 * 24 * 3600 * 1000); // 10 days
|
||||
action.setParentWidget(parent);
|
||||
QVariantMap arguments;
|
||||
arguments.insert(QStringLiteral("pubkey"), pubkey.toDER());
|
||||
action.setArguments(arguments);
|
||||
|
|
|
@ -99,6 +99,13 @@ public:
|
|||
/**< stop ExternalCommand Helper */
|
||||
static void stopHelper();
|
||||
|
||||
/**< Sets a parent widget for the authentication dialog.
|
||||
* @param p parent widget
|
||||
*/
|
||||
static void setParentWidget(QWidget *p) {
|
||||
parent = p;
|
||||
}
|
||||
|
||||
Q_SIGNALS:
|
||||
void progress(int);
|
||||
void reportSignal(const QVariantMap&);
|
||||
|
@ -122,6 +129,7 @@ private:
|
|||
static QCA::Initializer *init;
|
||||
static QCA::PrivateKey *privateKey;
|
||||
static bool helperStarted;
|
||||
static QWidget *parent;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue