Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F22067964
controller.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
controller.cpp
View Options
/*
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include
<config-kleopatra.h>
#include
"controller.h"
using
namespace
Kleo
;
using
namespace
Kleo
::
Crypto
;
class
Controller
::
Private
{
friend
class
::
Kleo
::
Crypto
::
Controller
;
Controller
*
const
q
;
public
:
explicit
Private
(
Controller
*
qq
)
:
q
(
qq
)
{
}
private
:
int
lastError
=
0
;
QString
lastErrorString
;
};
Controller
::
Controller
(
QObject
*
parent
)
:
QObject
(
parent
)
,
ExecutionContextUser
()
,
d
(
new
Private
(
this
))
{
}
Controller
::
Controller
(
const
std
::
shared_ptr
<
const
ExecutionContext
>
&
ctx
,
QObject
*
parent
)
:
QObject
(
parent
)
,
ExecutionContextUser
(
ctx
)
,
d
(
new
Private
(
this
))
{
}
Controller
::~
Controller
()
{
}
void
Controller
::
taskDone
(
const
std
::
shared_ptr
<
const
Task
::
Result
>
&
result
)
{
const
Task
*
task
=
qobject_cast
<
const
Task
*>
(
sender
());
Q_ASSERT
(
task
);
doTaskDone
(
task
,
result
);
}
void
Controller
::
doTaskDone
(
const
Task
*
,
const
std
::
shared_ptr
<
const
Task
::
Result
>
&
)
{
}
void
Controller
::
connectTask
(
const
std
::
shared_ptr
<
Task
>
&
task
)
{
Q_ASSERT
(
task
);
connect
(
task
.
get
(),
&
Task
::
result
,
this
,
&
Controller
::
taskDone
);
}
void
Controller
::
setLastError
(
int
err
,
const
QString
&
msg
)
{
d
->
lastError
=
err
;
d
->
lastErrorString
=
msg
;
}
void
Controller
::
emitDoneOrError
()
{
if
(
d
->
lastError
)
{
Q_EMIT
error
(
d
->
lastError
,
d
->
lastErrorString
,
QPrivateSignal
{});
d
->
lastError
=
0
;
d
->
lastErrorString
=
QString
();
}
else
{
Q_EMIT
done
(
QPrivateSignal
{});
}
}
#include
"moc_controller.cpp"
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Tue, Apr 22, 4:01 AM (1 h, 3 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d6/98/b07ded173deec3763b9705b24f1e
Attached To
rKLEOPATRA Kleopatra
Event Timeline
Log In to Comment