Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
d09854cb
Commit
d09854cb
authored
Mar 18, 2022
by
Laurent Montel
Browse files
Use directly std::chrono_literals
parent
cbe0a015
Pipeline
#151538
passed with stage
in 8 minutes and 32 seconds
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
components/containmentlayoutmanager/appletslayout.cpp
View file @
d09854cb
...
...
@@ -18,6 +18,9 @@
#include
<Containment>
#include
<Corona>
#include
<PlasmaQuick/AppletQuickItem>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
AppletsLayout
::
AppletsLayout
(
QQuickItem
*
parent
)
:
QQuickItem
(
parent
)
...
...
@@ -29,7 +32,7 @@ AppletsLayout::AppletsLayout(QQuickItem *parent)
m_saveLayoutTimer
=
new
QTimer
(
this
);
m_saveLayoutTimer
->
setSingleShot
(
true
);
m_saveLayoutTimer
->
setInterval
(
100
);
m_saveLayoutTimer
->
setInterval
(
100
ms
);
connect
(
m_layoutManager
,
&
AbstractLayoutManager
::
layoutNeedsSaving
,
m_saveLayoutTimer
,
QOverload
<>::
of
(
&
QTimer
::
start
));
connect
(
m_saveLayoutTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
// We can't assume m_containment to be valid: if we load in a plasmoid that can run also
...
...
@@ -53,7 +56,7 @@ AppletsLayout::AppletsLayout(QQuickItem *parent)
m_layoutChangeTimer
=
new
QTimer
(
this
);
m_layoutChangeTimer
->
setSingleShot
(
true
);
m_layoutChangeTimer
->
setInterval
(
100
);
m_layoutChangeTimer
->
setInterval
(
100
ms
);
connect
(
m_layoutChangeTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
// We can't assume m_containment to be valid: if we load in a plasmoid that can run also
// in "applet" mode, m_containment will never be valid
...
...
components/containmentlayoutmanager/configoverlay.cpp
View file @
d09854cb
...
...
@@ -6,14 +6,17 @@
#include
"configoverlay.h"
#include
<chrono>
#include
<cmath>
using
namespace
std
::
chrono_literals
;
ConfigOverlay
::
ConfigOverlay
(
QQuickItem
*
parent
)
:
QQuickItem
(
parent
)
{
m_hideTimer
=
new
QTimer
(
this
);
m_hideTimer
->
setSingleShot
(
true
);
m_hideTimer
->
setInterval
(
600
);
m_hideTimer
->
setInterval
(
600
ms
);
connect
(
m_hideTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
setVisible
(
false
);
});
...
...
components/containmentlayoutmanager/itemcontainer.cpp
View file @
d09854cb
...
...
@@ -17,6 +17,9 @@
#include
<cmath>
#include
<PlasmaQuick/AppletQuickItem>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
ItemContainer
::
ItemContainer
(
QQuickItem
*
parent
)
:
QQuickItem
(
parent
)
...
...
@@ -656,7 +659,7 @@ void ItemContainer::hoverLeaveEvent(QHoverEvent *event)
if
(
!
m_closeEditModeTimer
)
{
m_closeEditModeTimer
=
new
QTimer
(
this
);
m_closeEditModeTimer
->
setSingleShot
(
true
);
m_closeEditModeTimer
->
setInterval
(
500
);
m_closeEditModeTimer
->
setInterval
(
500
ms
);
connect
(
m_closeEditModeTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]()
{
setEditMode
(
false
);
});
...
...
gmenu-dbusmenu-proxy/menuproxy.cpp
View file @
d09854cb
...
...
@@ -32,6 +32,9 @@
#include
<xcb/xcb.h>
#include
"window.h"
#include
<chrono>
using
namespace
std
::
chrono_literals
;
static
const
QString
s_ourServiceName
=
QStringLiteral
(
"org.kde.plasma.gmenu_dbusmenu_proxy"
);
...
...
@@ -87,7 +90,7 @@ MenuProxy::MenuProxy()
// kde-gtk-config just deletes and re-creates the gtkrc-2.0, watch this and add our config to it again
m_writeGtk2SettingsTimer
->
setSingleShot
(
true
);
m_writeGtk2SettingsTimer
->
setInterval
(
1
000
);
m_writeGtk2SettingsTimer
->
setInterval
(
1
s
);
connect
(
m_writeGtk2SettingsTimer
,
&
QTimer
::
timeout
,
this
,
&
MenuProxy
::
writeGtk2Settings
);
auto
startGtk2SettingsTimer
=
[
this
]
{
...
...
klipper/klipper.cpp
View file @
d09854cb
...
...
@@ -47,7 +47,10 @@
#else
#include
<QX11Info>
#endif
#include
<chrono>
#include
<xcb/xcb.h>
using
namespace
std
::
chrono_literals
;
#endif
namespace
...
...
@@ -351,7 +354,7 @@ void Klipper::loadSettings()
if
(
m_bKeepContents
&&
!
m_saveFileTimer
)
{
m_saveFileTimer
=
new
QTimer
(
this
);
m_saveFileTimer
->
setSingleShot
(
true
);
m_saveFileTimer
->
setInterval
(
5
000
);
m_saveFileTimer
->
setInterval
(
5
s
);
connect
(
m_saveFileTimer
,
&
QTimer
::
timeout
,
this
,
[
this
]
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QtConcurrent
::
run
(
this
,
&
Klipper
::
saveHistory
,
false
);
...
...
@@ -682,12 +685,12 @@ bool Klipper::blockFetchingNewData()
if
(((
queryPointer
->
mask
&
(
XCB_KEY_BUT_MASK_SHIFT
|
XCB_KEY_BUT_MASK_BUTTON_1
))
==
XCB_KEY_BUT_MASK_SHIFT
)
// BUG: 85198
||
((
queryPointer
->
mask
&
XCB_KEY_BUT_MASK_BUTTON_1
)
==
XCB_KEY_BUT_MASK_BUTTON_1
))
{
// BUG: 80302
m_pendingContentsCheck
=
true
;
m_pendingCheckTimer
.
start
(
100
);
m_pendingCheckTimer
.
start
(
100
ms
);
return
true
;
}
m_pendingContentsCheck
=
false
;
if
(
m_overflowCounter
==
0
)
m_overflowClearTimer
.
start
(
1
000
);
m_overflowClearTimer
.
start
(
1
s
);
if
(
++
m_overflowCounter
>
MAX_CLIPBOARD_CHANGES
)
return
true
;
#endif
...
...
libnotificationmanager/abstractnotificationsmodel.cpp
View file @
d09854cb
...
...
@@ -18,8 +18,11 @@
#include
<KShell>
#include
<algorithm>
#include
<chrono>
#include
<functional>
using
namespace
std
::
chrono_literals
;
static
const
int
s_notificationsLimit
=
1000
;
using
namespace
NotificationManager
;
...
...
@@ -29,7 +32,7 @@ AbstractNotificationsModel::Private::Private(AbstractNotificationsModel *q)
,
lastRead
(
QDateTime
::
currentDateTimeUtc
())
{
pendingRemovalTimer
.
setSingleShot
(
true
);
pendingRemovalTimer
.
setInterval
(
50
);
pendingRemovalTimer
.
setInterval
(
50
ms
);
connect
(
&
pendingRemovalTimer
,
&
QTimer
::
timeout
,
q
,
[
this
,
q
]
{
QVector
<
int
>
rowsToBeRemoved
;
rowsToBeRemoved
.
reserve
(
pendingRemovals
.
count
());
...
...
libtaskmanager/launchertasksmodel.cpp
View file @
d09854cb
...
...
@@ -35,6 +35,9 @@
#endif
#include
"launchertasksmodel_p.h"
#include
<chrono>
using
namespace
std
::
chrono_literals
;
namespace
TaskManager
{
...
...
@@ -86,7 +89,7 @@ LauncherTasksModel::Private::Private(LauncherTasksModel *q)
void
LauncherTasksModel
::
Private
::
init
()
{
sycocaChangeTimer
.
setSingleShot
(
true
);
sycocaChangeTimer
.
setInterval
(
100
);
sycocaChangeTimer
.
setInterval
(
100
ms
);
QObject
::
connect
(
&
sycocaChangeTimer
,
&
QTimer
::
timeout
,
q
,
[
this
]()
{
if
(
!
launchersOrder
.
count
())
{
...
...
libtaskmanager/xwindowtasksmodel.cpp
View file @
d09854cb
...
...
@@ -30,6 +30,9 @@
#include
<private/qtx11extras_p.h>
#else
#include
<QX11Info>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
#endif
namespace
TaskManager
...
...
@@ -122,7 +125,7 @@ void XWindowTasksModel::Private::init()
cachedStackingOrder
=
KWindowSystem
::
stackingOrder
();
sycocaChangeTimer
.
setSingleShot
(
true
);
sycocaChangeTimer
.
setInterval
(
100
);
sycocaChangeTimer
.
setInterval
(
100
ms
);
QObject
::
connect
(
&
sycocaChangeTimer
,
&
QTimer
::
timeout
,
q
,
clearCacheAndRefresh
);
...
...
shell/panelconfigview.cpp
View file @
d09854cb
...
...
@@ -27,6 +27,10 @@
#include
<KWayland/Client/plasmashell.h>
#include
<KWayland/Client/surface.h>
#include
<chrono>
using
namespace
std
::
chrono_literals
;
//////////////////////////////PanelConfigView
PanelConfigView
::
PanelConfigView
(
Plasma
::
Containment
*
containment
,
PanelView
*
panelView
,
QWindow
*
parent
)
:
ConfigView
(
containment
,
parent
)
...
...
@@ -39,7 +43,7 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa
connect
(
panelView
,
&
QWindow
::
screenChanged
,
&
m_screenSyncTimer
,
QOverload
<>::
of
(
&
QTimer
::
start
));
m_screenSyncTimer
.
setSingleShot
(
true
);
m_screenSyncTimer
.
setInterval
(
150
);
m_screenSyncTimer
.
setInterval
(
150
ms
);
connect
(
&
m_screenSyncTimer
,
&
QTimer
::
timeout
,
[
=
]()
{
setScreen
(
panelView
->
screen
());
KWindowSystem
::
setType
(
winId
(),
NET
::
Dock
);
...
...
shell/panelview.cpp
View file @
d09854cb
...
...
@@ -43,7 +43,9 @@
#endif
#include
<xcb/xcb.h>
#endif
#include
<chrono>
using
namespace
std
::
chrono_literals
;
static
const
int
MINSIZE
=
10
;
PanelView
::
PanelView
(
ShellCorona
*
corona
,
QScreen
*
targetScreen
,
QWindow
*
parent
)
...
...
@@ -85,7 +87,7 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent
connect
(
&
m_positionPaneltimer
,
&
QTimer
::
timeout
,
this
,
&
PanelView
::
restore
);
m_unhideTimer
.
setSingleShot
(
true
);
m_unhideTimer
.
setInterval
(
500
);
m_unhideTimer
.
setInterval
(
500
ms
);
connect
(
&
m_unhideTimer
,
&
QTimer
::
timeout
,
this
,
&
PanelView
::
restoreAutoHide
);
m_lastScreen
=
targetScreen
;
...
...
@@ -1355,7 +1357,7 @@ void PanelView::showTemporarily()
QTimer
*
t
=
new
QTimer
(
this
);
t
->
setSingleShot
(
true
);
t
->
setInterval
(
3
000
);
t
->
setInterval
(
3
s
);
connect
(
t
,
&
QTimer
::
timeout
,
this
,
&
PanelView
::
restoreAutoHide
);
connect
(
t
,
&
QTimer
::
timeout
,
t
,
&
QObject
::
deleteLater
);
t
->
start
();
...
...
shell/screenpool.cpp
View file @
d09854cb
...
...
@@ -19,6 +19,10 @@
#define CHECK_SCREEN_INVARIANTS
#endif
#include
<chrono>
using
namespace
std
::
chrono_literals
;
ScreenPool
::
ScreenPool
(
const
KSharedConfig
::
Ptr
&
config
,
QObject
*
parent
)
:
QObject
(
parent
)
,
m_configGroup
(
KConfigGroup
(
config
,
QStringLiteral
(
"ScreenConnectors"
)))
...
...
@@ -29,7 +33,7 @@ ScreenPool::ScreenPool(const KSharedConfig::Ptr &config, QObject *parent)
connect
(
m_primaryWatcher
,
&
PrimaryOutputWatcher
::
primaryOutputNameChanged
,
this
,
&
ScreenPool
::
handlePrimaryOutputNameChanged
);
m_reconsiderOutputsTimer
.
setSingleShot
(
true
);
m_reconsiderOutputsTimer
.
setInterval
(
250
);
m_reconsiderOutputsTimer
.
setInterval
(
250
ms
);
connect
(
&
m_reconsiderOutputsTimer
,
&
QTimer
::
timeout
,
this
,
&
ScreenPool
::
reconsiderOutputs
);
m_configSaveTimer
.
setSingleShot
(
true
);
...
...
shell/scripting/configgroup.cpp
View file @
d09854cb
...
...
@@ -10,10 +10,13 @@
#include
<QDebug>
#include
<QTimer>
#include
<chrono>
#include
<kconfig.h>
#include
<kconfiggroup.h>
#include
<ksharedconfig.h>
using
namespace
std
::
chrono_literals
;
class
ConfigGroupPrivate
{
public:
...
...
@@ -44,7 +47,7 @@ ConfigGroup::ConfigGroup(QObject *parent)
// Delay and compress everything within 5 seconds into one sync
d
->
synchTimer
=
new
QTimer
(
this
);
d
->
synchTimer
->
setSingleShot
(
true
);
d
->
synchTimer
->
setInterval
(
1500
);
d
->
synchTimer
->
setInterval
(
1500
ms
);
connect
(
d
->
synchTimer
,
&
QTimer
::
timeout
,
this
,
&
ConfigGroup
::
sync
);
}
...
...
shell/shellcontainmentconfig.cpp
View file @
d09854cb
...
...
@@ -17,10 +17,12 @@
#include
<QQuickItem>
#include
<QScreen>
#include
"shellcorona.h"
#include
"screenpool.h"
#include
"panelview.h"
#include
"screenpool.h"
#include
"shellcorona.h"
#include
<chrono>
using
namespace
std
::
chrono_literals
;
ScreenPoolModel
::
ScreenPoolModel
(
ShellCorona
*
corona
,
QObject
*
parent
)
:
QAbstractListModel
(
parent
)
...
...
@@ -28,7 +30,7 @@ ScreenPoolModel::ScreenPoolModel(ShellCorona *corona, QObject *parent)
{
m_reloadTimer
=
new
QTimer
(
this
);
m_reloadTimer
->
setSingleShot
(
true
);
m_reloadTimer
->
setInterval
(
200
);
m_reloadTimer
->
setInterval
(
200
ms
);
connect
(
m_reloadTimer
,
&
QTimer
::
timeout
,
this
,
&
ScreenPoolModel
::
load
);
...
...
@@ -148,7 +150,7 @@ ShellContainmentModel::ShellContainmentModel(ShellCorona *corona, int screenId,
{
m_reloadTimer
=
new
QTimer
(
this
);
m_reloadTimer
->
setSingleShot
(
true
);
m_reloadTimer
->
setInterval
(
200
);
m_reloadTimer
->
setInterval
(
200
ms
);
connect
(
m_reloadTimer
,
&
QTimer
::
timeout
,
this
,
&
ShellContainmentModel
::
load
);
...
...
shell/shellcorona.cpp
View file @
d09854cb
...
...
@@ -77,7 +77,9 @@
#endif
#include
<xcb/xcb.h>
#endif
#include
<chrono>
using
namespace
std
::
chrono_literals
;
static
const
int
s_configSyncDelay
=
10000
;
// 10 seconds
ShellCorona
::
ShellCorona
(
QObject
*
parent
)
...
...
@@ -117,12 +119,12 @@ void ShellCorona::init()
connect
(
this
,
&
Corona
::
configSynced
,
this
,
&
ShellCorona
::
syncAppConfig
);
m_waitingPanelsTimer
.
setSingleShot
(
true
);
m_waitingPanelsTimer
.
setInterval
(
250
);
m_waitingPanelsTimer
.
setInterval
(
250
ms
);
connect
(
&
m_waitingPanelsTimer
,
&
QTimer
::
timeout
,
this
,
&
ShellCorona
::
createWaitingPanels
);
#ifndef NDEBUG
m_invariantsTimer
.
setSingleShot
(
true
);
m_invariantsTimer
.
setInterval
(
250
);
m_invariantsTimer
.
setInterval
(
250
ms
);
connect
(
&
m_invariantsTimer
,
&
QTimer
::
timeout
,
this
,
&
ShellCorona
::
screenInvariants
);
#endif
...
...
Volker Krause
@vkrause
mentioned in commit
dc2da58e
·
Mar 18, 2022
mentioned in commit
dc2da58e
mentioned in commit dc2da58e8353986d32066aa1dc7e92161f0b3f5c
Toggle commit list
Volker Krause
@vkrause
mentioned in merge request
!1577 (merged)
·
Mar 18, 2022
mentioned in merge request
!1577 (merged)
mentioned in merge request !1577
Toggle commit list
Volker Krause
@vkrause
mentioned in commit
0a9b734b
·
Mar 19, 2022
mentioned in commit
0a9b734b
mentioned in commit 0a9b734b73dc142238d5047cb583e5eb1a916cb9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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