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
Akonadi
Commits
f6e008cb
Commit
f6e008cb
authored
Aug 12, 2021
by
Laurent Montel
😁
Browse files
Use std::chrono_literals
parent
db5f99e1
Changes
20
Hide whitespace changes
Inline
Side-by-side
autotests/libs/fakeserverdata.cpp
View file @
f6e008cb
...
...
@@ -10,6 +10,7 @@
#include
"itemfetchjob.h"
#include
<QTimer>
using
namespace
std
::
chrono_literals
;
FakeServerData
::
FakeServerData
(
EntityTreeModel
*
model
,
FakeSession
*
session
,
FakeMonitor
*
monitor
,
QObject
*
parent
)
:
QObject
(
parent
)
...
...
@@ -24,7 +25,7 @@ FakeServerData::FakeServerData(EntityTreeModel *model, FakeSession *session, Fak
// the slot gets called
connect
(
session
,
&
FakeSession
::
jobAdded
,
[
this
](
Akonadi
::
Job
*
job
)
{
Collection
::
Id
fetchColId
=
job
->
property
(
"FetchCollectionId"
).
toULongLong
();
QTimer
::
singleShot
(
0
,
[
this
,
fetchColId
]()
{
QTimer
::
singleShot
(
0
s
,
[
this
,
fetchColId
]()
{
jobAdded
(
fetchColId
);
});
});
...
...
@@ -40,7 +41,7 @@ FakeServerData::FakeServerData(TagModel *model, FakeSession *session, FakeMonito
,
m_nextTagId
(
1
)
{
connect
(
session
,
&
FakeSession
::
jobAdded
,
[
this
](
Akonadi
::
Job
*
/*unused*/
)
{
QTimer
::
singleShot
(
0
,
[
this
]()
{
QTimer
::
singleShot
(
0
s
,
[
this
]()
{
jobAdded
();
});
});
...
...
autotests/libs/fakesession.cpp
View file @
f6e008cb
...
...
@@ -11,7 +11,7 @@
#include
<QCoreApplication>
#include
<QTimer>
using
namespace
std
::
chrono_literals
;
class
FakeSessionPrivate
:
public
SessionPrivate
{
public:
...
...
@@ -48,7 +48,7 @@ public:
}
// Like Session does: delay the actual disconnect+reconnect
QTimer
::
singleShot
(
10
,
q_ptr
,
[
&
]()
{
QTimer
::
singleShot
(
10
ms
,
q_ptr
,
[
&
]()
{
socketDisconnected
();
Q_EMIT
q_ptr
->
reconnected
();
connected
=
true
;
...
...
autotests/libs/inspectablechangerecorder.cpp
View file @
f6e008cb
...
...
@@ -5,7 +5,7 @@
*/
#include
"inspectablechangerecorder.h"
using
namespace
std
::
chrono_literals
;
InspectableChangeRecorderPrivate
::
InspectableChangeRecorderPrivate
(
FakeMonitorDependenciesFactory
*
dependenciesFactory
,
InspectableChangeRecorder
*
parent
)
:
ChangeRecorderPrivate
(
dependenciesFactory
,
parent
)
{
...
...
@@ -14,7 +14,7 @@ InspectableChangeRecorderPrivate::InspectableChangeRecorderPrivate(FakeMonitorDe
InspectableChangeRecorder
::
InspectableChangeRecorder
(
FakeMonitorDependenciesFactory
*
dependenciesFactory
,
QObject
*
parent
)
:
ChangeRecorder
(
new
Akonadi
::
ChangeRecorderPrivate
(
dependenciesFactory
,
this
),
parent
)
{
QTimer
::
singleShot
(
0
,
this
,
&
InspectableChangeRecorder
::
doConnectToNotificationManager
);
QTimer
::
singleShot
(
0
s
,
this
,
&
InspectableChangeRecorder
::
doConnectToNotificationManager
);
}
void
InspectableChangeRecorder
::
doConnectToNotificationManager
()
...
...
autotests/libs/inspectablemonitor.cpp
View file @
f6e008cb
...
...
@@ -5,7 +5,7 @@
*/
#include
"inspectablemonitor.h"
using
namespace
std
::
chrono_literals
;
InspectableMonitorPrivate
::
InspectableMonitorPrivate
(
FakeMonitorDependenciesFactory
*
dependenciesFactory
,
InspectableMonitor
*
parent
)
:
Akonadi
::
MonitorPrivate
(
dependenciesFactory
,
parent
)
{
...
...
@@ -36,7 +36,7 @@ InspectableMonitor::InspectableMonitor(FakeMonitorDependenciesFactory *dependenc
connect
(
this
,
&
Akonadi
::
Monitor
::
collectionSubscribed
,
this
,
&
InspectableMonitor
::
dummySignal
);
connect
(
this
,
&
Akonadi
::
Monitor
::
collectionUnsubscribed
,
this
,
&
InspectableMonitor
::
dummySignal
);
QTimer
::
singleShot
(
0
,
this
,
[
this
]()
{
QTimer
::
singleShot
(
0
s
,
this
,
[
this
]()
{
doConnectToNotificationManager
();
});
}
autotests/libs/itemsynctest.cpp
View file @
f6e008cb
...
...
@@ -29,7 +29,7 @@ using namespace Akonadi;
Q_DECLARE_METATYPE
(
KJob
*
)
Q_DECLARE_METATYPE
(
ItemSync
::
TransactionMode
)
using
namespace
std
::
chrono_literals
;
class
ItemsyncTest
:
public
QObject
{
Q_OBJECT
...
...
@@ -679,7 +679,7 @@ private Q_SLOTS:
syncer
->
setFullSyncItems
(
origItems
);
// When the user cancels the ItemSync
QTimer
::
singleShot
(
10
,
syncer
,
&
ItemSync
::
rollback
);
QTimer
::
singleShot
(
10
ms
,
syncer
,
&
ItemSync
::
rollback
);
// Then the itemsync should finish at some point, and not crash
QVERIFY
(
!
syncer
->
exec
());
...
...
autotests/libs/testrunner/setup.cpp
View file @
f6e008cb
...
...
@@ -24,6 +24,9 @@
#include
<QFile>
#include
<QSettings>
#include
<QTimer>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
bool
SetupTest
::
startAkonadiDaemon
()
{
...
...
@@ -323,7 +326,7 @@ void SetupTest::shutdown()
qCInfo
(
AKONADITEST_LOG
)
<<
"Shutting down Akonadi control..."
;
Akonadi
::
ServerManager
::
self
()
->
stop
();
// safety timeout
QTimer
::
singleShot
(
30
*
1000
,
this
,
&
SetupTest
::
shutdownHarder
);
QTimer
::
singleShot
(
30
s
,
this
,
&
SetupTest
::
shutdownHarder
);
break
;
case
Akonadi
::
ServerManager
::
NotRunning
:
case
Akonadi
::
ServerManager
::
Broken
:
...
...
@@ -331,7 +334,7 @@ void SetupTest::shutdown()
break
;
case
Akonadi
::
ServerManager
::
Stopping
:
// safety timeout
QTimer
::
singleShot
(
30
*
1000
,
this
,
&
SetupTest
::
shutdownHarder
);
QTimer
::
singleShot
(
30
s
,
this
,
&
SetupTest
::
shutdownHarder
);
break
;
}
}
...
...
autotests/server/itemretrievertest.cpp
View file @
f6e008cb
...
...
@@ -22,7 +22,7 @@
#include
<aktest.h>
using
namespace
Akonadi
::
Server
;
using
namespace
std
::
chrono_literals
;
struct
JobResult
{
qint64
pimItemId
;
QByteArray
partname
;
...
...
@@ -68,7 +68,7 @@ public:
}
}
QTimer
::
singleShot
(
0
,
this
,
[
this
]()
{
QTimer
::
singleShot
(
0
s
,
this
,
[
this
]()
{
Q_EMIT
requestCompleted
(
this
);
});
}
...
...
autotests/widgets/tageditwidgettest.cpp
View file @
f6e008cb
...
...
@@ -25,7 +25,7 @@
#include
<QTest>
#include
<memory>
using
namespace
std
::
chrono_literals
;
using
namespace
Akonadi
;
/***
...
...
@@ -125,7 +125,7 @@ class TagEditWidgetTest : public QObject
// Clicking the button blocks (QDialog::exec), so we need to confirm the
// dialog from event loop
bool
confirmed
=
false
;
QTimer
::
singleShot
(
100
,
[
this
,
confirmDeletion
,
&
confirmed
]()
{
QTimer
::
singleShot
(
100
ms
,
[
this
,
confirmDeletion
,
&
confirmed
]()
{
confirmed
=
confirmDialog
(
confirmDeletion
);
QVERIFY
(
confirmed
);
});
...
...
autotests/widgets/tagwidgettest.cpp
View file @
f6e008cb
...
...
@@ -26,7 +26,7 @@
#include
<memory>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
class
TagWidgetTest
:
public
QObject
{
Q_OBJECT
...
...
@@ -161,7 +161,7 @@ private Q_SLOTS:
bool
ok
=
false
;
// Clicking on the Edit button opens the dialog in a blocking way, so
// we need to dispatch the test from event loop
QTimer
::
singleShot
(
100
,
this
,
[
&
test
,
&
selection
,
&
ok
]()
{
QTimer
::
singleShot
(
100
ms
,
this
,
[
&
test
,
&
selection
,
&
ok
]()
{
QVERIFY
(
test
.
selectTagsInDialog
(
selection
));
ok
=
true
;
});
...
...
src/agentbase/agentbase.cpp
View file @
f6e008cb
...
...
@@ -55,7 +55,7 @@
#include
<thread>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
static
AgentBase
*
sAgentBase
=
nullptr
;
AgentBase
::
Observer
::
Observer
()
...
...
@@ -422,7 +422,7 @@ void AgentBasePrivate::init()
mResourceTypeName
=
AgentManager
::
self
()
->
instance
(
mId
).
type
().
name
();
setProgramName
();
QTimer
::
singleShot
(
0
,
q
,
[
this
]
{
QTimer
::
singleShot
(
0
s
,
q
,
[
this
]
{
delayedInit
();
});
}
...
...
@@ -734,7 +734,7 @@ void AgentBasePrivate::collectionUnsubscribed(const Akonadi::Collection &collect
void
AgentBasePrivate
::
changeProcessed
()
{
mChangeRecorder
->
changeProcessed
();
QTimer
::
singleShot
(
0
,
mChangeRecorder
,
&
ChangeRecorder
::
replayNext
);
QTimer
::
singleShot
(
0
s
,
mChangeRecorder
,
&
ChangeRecorder
::
replayNext
);
}
void
AgentBasePrivate
::
slotStatus
(
int
status
,
const
QString
&
message
)
...
...
src/agentbase/agentsearchinterface.cpp
View file @
f6e008cb
...
...
@@ -18,14 +18,14 @@
#include
<QDBusConnection>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
AgentSearchInterfacePrivate
::
AgentSearchInterfacePrivate
(
AgentSearchInterface
*
qq
)
:
q
(
qq
)
{
new
Akonadi__SearchAdaptor
(
this
);
QDBusConnection
::
sessionBus
().
registerObject
(
QStringLiteral
(
"/Search"
),
this
,
QDBusConnection
::
ExportAdaptors
);
QTimer
::
singleShot
(
0
,
this
,
&
AgentSearchInterfacePrivate
::
delayedInit
);
QTimer
::
singleShot
(
0
s
,
this
,
&
AgentSearchInterfacePrivate
::
delayedInit
);
}
void
AgentSearchInterfacePrivate
::
delayedInit
()
...
...
src/agentbase/resourcebase.cpp
View file @
f6e008cb
...
...
@@ -52,7 +52,7 @@
using
namespace
Akonadi
;
using
namespace
AkRanges
;
using
namespace
std
::
chrono_literals
;
class
Akonadi
::
ResourceBasePrivate
:
public
AgentBasePrivate
{
Q_OBJECT
...
...
@@ -114,7 +114,7 @@ public:
{
if
(
m_recursiveMover
)
{
m_recursiveMover
->
changeProcessed
();
QTimer
::
singleShot
(
0
,
m_recursiveMover
.
data
(),
&
RecursiveMover
::
replayNext
);
QTimer
::
singleShot
(
0
s
,
m_recursiveMover
.
data
(),
&
RecursiveMover
::
replayNext
);
return
;
}
...
...
src/agentbase/resourcescheduler.cpp
View file @
f6e008cb
...
...
@@ -17,7 +17,7 @@
#include
<QTimer>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
qint64
ResourceScheduler
::
Task
::
latestSerial
=
0
;
static
QDBusAbstractInterface
*
s_resourcetracker
=
nullptr
;
...
...
@@ -366,7 +366,7 @@ void ResourceScheduler::scheduleNext()
if
(
mCurrentTask
.
type
!=
Invalid
||
isEmpty
()
||
!
mOnline
)
{
return
;
}
QTimer
::
singleShot
(
0
,
this
,
&
ResourceScheduler
::
executeNext
);
QTimer
::
singleShot
(
0
s
,
this
,
&
ResourceScheduler
::
executeNext
);
}
void
ResourceScheduler
::
executeNext
()
...
...
src/agentserver/agentserver.cpp
View file @
f6e008cb
...
...
@@ -16,7 +16,7 @@
#include
<QTimer>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
AgentServer
::
AgentServer
(
QObject
*
parent
)
:
QObject
(
parent
)
{
...
...
@@ -35,7 +35,7 @@ void AgentServer::agentInstanceConfigure(const QString &identifier, qlonglong wi
{
m_configureQueue
.
enqueue
(
ConfigureInfo
(
identifier
,
windowId
));
if
(
!
m_processingConfigureRequests
)
{
// Start processing the requests if needed.
QTimer
::
singleShot
(
0
,
this
,
&
AgentServer
::
processConfigureRequest
);
QTimer
::
singleShot
(
0
s
,
this
,
&
AgentServer
::
processConfigureRequest
);
}
}
...
...
src/akonadicontrol/controlmanager.cpp
View file @
f6e008cb
...
...
@@ -10,7 +10,7 @@
#include
<QTimer>
#include
"controlmanageradaptor.h"
using
namespace
std
::
chrono_literals
;
ControlManager
::
ControlManager
(
QObject
*
parent
)
:
QObject
(
parent
)
{
...
...
@@ -24,5 +24,5 @@ ControlManager::~ControlManager()
void
ControlManager
::
shutdown
()
{
QTimer
::
singleShot
(
0
,
QCoreApplication
::
instance
(),
&
QCoreApplication
::
quit
);
QTimer
::
singleShot
(
0
s
,
QCoreApplication
::
instance
(),
&
QCoreApplication
::
quit
);
}
src/core/session.cpp
View file @
f6e008cb
...
...
@@ -37,7 +37,7 @@
//#define PIPELINE_LENGTH 2
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
/// @cond PRIVATE
void
SessionPrivate
::
startNext
()
...
...
@@ -104,7 +104,7 @@ bool SessionPrivate::handleCommands()
if
(
hello
.
isError
())
{
qCWarning
(
AKONADICORE_LOG
)
<<
"Error when establishing connection with Akonadi server:"
<<
hello
.
errorMessage
();
connection
->
closeConnection
();
QTimer
::
singleShot
(
1
000
,
connection
,
&
Connection
::
reconnect
);
QTimer
::
singleShot
(
1
s
,
connection
,
&
Connection
::
reconnect
);
return
false
;
}
...
...
@@ -123,7 +123,7 @@ bool SessionPrivate::handleCommands()
if
(
login
.
isError
())
{
qCWarning
(
AKONADICORE_LOG
)
<<
"Unable to login to Akonadi server:"
<<
login
.
errorMessage
();
connection
->
closeConnection
();
QTimer
::
singleShot
(
1
000
,
mParent
,
[
this
]()
{
QTimer
::
singleShot
(
1
s
,
mParent
,
[
this
]()
{
reconnect
();
});
return
false
;
...
...
src/server/akonadi.cpp
View file @
f6e008cb
...
...
@@ -43,7 +43,7 @@
using
namespace
Akonadi
;
using
namespace
Akonadi
::
Server
;
using
namespace
std
::
chrono_literals
;
namespace
{
class
AkonadiDataStore
:
public
DataStore
...
...
@@ -204,7 +204,7 @@ bool AkonadiServer::quit()
qCCritical
(
AKONADISERVER_LOG
)
<<
"Failed to remove runtime connection config file"
;
}
QTimer
::
singleShot
(
0
,
this
,
&
AkonadiServer
::
doQuit
);
QTimer
::
singleShot
(
0
s
,
this
,
&
AkonadiServer
::
doQuit
);
return
true
;
}
...
...
src/widgets/agentconfigurationwidget.cpp
View file @
f6e008cb
...
...
@@ -25,7 +25,7 @@
#include
<memory>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
AgentConfigurationWidget
::
Private
::
Private
(
const
AgentInstance
&
instance
)
:
agentInstance
(
instance
)
{
...
...
@@ -88,7 +88,7 @@ AgentConfigurationWidget::AgentConfigurationWidget(const AgentInstance &instance
if
(
auto
dlg
=
qobject_cast
<
AgentConfigurationDialog
*>
(
parent
))
{
const_cast
<
AgentInstance
&>
(
instance
).
configure
(
topLevelWidget
()
->
parentWidget
());
// If we are inside the AgentConfigurationDialog, hide the dialog
QTimer
::
singleShot
(
0
,
this
,
[
dlg
]()
{
QTimer
::
singleShot
(
0
s
,
this
,
[
dlg
]()
{
dlg
->
reject
();
});
}
else
{
...
...
src/widgets/controlgui.cpp
View file @
f6e008cb
...
...
@@ -20,7 +20,7 @@
#include
<QTimer>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
namespace
Akonadi
{
namespace
Internal
...
...
@@ -248,7 +248,7 @@ void ControlGui::widgetNeedsAkonadi(QWidget *widget)
s_instance
->
d
->
mPendingOverlays
.
append
(
widget
);
// delay the overlay creation since we rely on widget being reparented
// correctly already
QTimer
::
singleShot
(
0
,
s_instance
,
[]()
{
QTimer
::
singleShot
(
0
s
,
s_instance
,
[]()
{
s_instance
->
d
->
createErrorOverlays
();
});
}
...
...
tests/libs/etm_test_app/mainwindow.cpp
View file @
f6e008cb
...
...
@@ -15,7 +15,7 @@
#include
<QTimer>
using
namespace
Akonadi
;
using
namespace
std
::
chrono_literals
;
MainWindow
::
MainWindow
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QMainWindow
(
parent
,
flags
)
{
...
...
@@ -59,7 +59,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
view
->
expandAll
();
setCentralWidget
(
view
);
QTimer
::
singleShot
(
5
000
,
this
,
&
MainWindow
::
moveCollection
);
QTimer
::
singleShot
(
5
s
,
this
,
&
MainWindow
::
moveCollection
);
}
void
MainWindow
::
moveCollection
()
...
...
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