Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
f63b94cb
Commit
f63b94cb
authored
Aug 26, 2021
by
Laurent Montel
😁
Browse files
Use std::chrono_literals
parent
785049dc
Pipeline
#76647
passed with stage
in 15 minutes and 21 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
autotests/kuniqueservicetest.cpp
View file @
f63b94cb
...
...
@@ -25,6 +25,8 @@
#include
"utils/kuniqueservice.h"
#include
<stdio.h>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
class
TestObject
:
public
QObject
{
...
...
@@ -151,7 +153,7 @@ int main(int argc, char *argv[])
Qt
::
QueuedConnection
,
Q_ARG
(
QStringList
,
args
),
Q_ARG
(
QString
,
QDir
::
currentPath
()));
QTimer
::
singleShot
(
400
,
&
testObject
,
SLOT
(
firstCall
()));
QTimer
::
singleShot
(
400
ms
,
&
testObject
,
SLOT
(
firstCall
()));
qDebug
()
<<
"Running."
;
a
.
exec
();
...
...
src/mainwindow.cpp
View file @
f63b94cb
...
...
@@ -77,6 +77,8 @@
#include
<vector>
#include
<KSharedConfig>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
using
namespace
Kleo
;
using
namespace
Kleo
::
Commands
;
...
...
@@ -515,7 +517,7 @@ void MainWindow::closeEvent(QCloseEvent *e)
// wait for them to be finished:
setEnabled
(
false
);
QEventLoop
ev
;
QTimer
::
singleShot
(
100
,
&
ev
,
&
QEventLoop
::
quit
);
QTimer
::
singleShot
(
100
ms
,
&
ev
,
&
QEventLoop
::
quit
);
connect
(
&
d
->
controller
,
&
KeyListController
::
commandsExecuting
,
&
ev
,
&
QEventLoop
::
quit
);
ev
.
exec
();
if
(
d
->
controller
.
hasRunningCommands
())
...
...
tests/test_verify.cpp
View file @
f63b94cb
...
...
@@ -23,6 +23,9 @@
#include
<QObject>
#include
<QSignalSpy>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
// Replace this with a gpgme version check once GnuPG Bug #2092
// ( https://bugs.gnupg.org/gnupg/issue2092 ) is fixed.
#define GPGME_MULTITHREADED_KEYLIST_BROKEN
...
...
@@ -107,7 +110,7 @@ public Q_SLOTS:
// Quit after 2500 jobs, that should be enough
mJobsStarted
++
;
if
(
mJobsStarted
>=
2500
)
{
QTimer
::
singleShot
(
1
000
,
&
mEventLoop
,
&
QEventLoop
::
quit
);
QTimer
::
singleShot
(
1
s
,
&
mEventLoop
,
&
QEventLoop
::
quit
);
}
else
{
QTimer
::
singleShot
(
0
,
this
,
&
VerifyTest
::
startAnotherJob
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment