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
PIM
KAlarm
Commits
20e65306
Commit
20e65306
authored
Nov 05, 2022
by
Volker Krause
Browse files
Port away from QDesktopWidget
That's gone in Qt 6.
parent
fe6ab870
Pipeline
#261821
failed with stage
in 1 minute and 29 seconds
Changes
2
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
src/lib/config.cpp
View file @
20e65306
...
...
@@ -11,8 +11,8 @@
#include
<KConfigGroup>
#include
<KSharedConfig>
#include
<QDesktopWidget>
#include
<QApplication>
#include
<QScreen>
namespace
Config
{
...
...
@@ -26,14 +26,14 @@ namespace Config
bool
readWindowSize
(
const
char
*
window
,
QSize
&
result
,
int
*
splitterWidth
)
{
KConfigGroup
config
(
KSharedConfig
::
openConfig
(),
window
);
const
Q
Widget
*
desktop
=
QApplication
::
desktop
();
const
QSize
s
=
QSize
(
config
.
readEntry
(
QStringLiteral
(
"Width %1"
).
arg
(
desktop
->
width
()),
(
int
)
0
),
config
.
readEntry
(
QStringLiteral
(
"Height %1"
).
arg
(
desktop
->
height
()),
(
int
)
0
));
const
Q
Size
desktop
Size
=
QApplication
::
primaryScreen
()
->
virtualSize
();
const
QSize
s
=
QSize
(
config
.
readEntry
(
QStringLiteral
(
"Width %1"
).
arg
(
desktop
Size
.
width
()),
(
int
)
0
),
config
.
readEntry
(
QStringLiteral
(
"Height %1"
).
arg
(
desktop
Size
.
height
()),
(
int
)
0
));
if
(
s
.
isEmpty
())
return
false
;
result
=
s
;
if
(
splitterWidth
)
*
splitterWidth
=
config
.
readEntry
(
QStringLiteral
(
"Splitter %1"
).
arg
(
desktop
->
width
()),
-
1
);
*
splitterWidth
=
config
.
readEntry
(
QStringLiteral
(
"Splitter %1"
).
arg
(
desktop
Size
.
width
()),
-
1
);
return
true
;
}
...
...
@@ -44,11 +44,11 @@ bool readWindowSize(const char* window, QSize& result, int* splitterWidth)
void
writeWindowSize
(
const
char
*
window
,
const
QSize
&
size
,
int
splitterWidth
)
{
KConfigGroup
config
(
KSharedConfig
::
openConfig
(),
window
);
const
Q
Widget
*
desktop
=
QApplication
::
desktop
();
config
.
writeEntry
(
QStringLiteral
(
"Width %1"
).
arg
(
desktop
->
width
()),
size
.
width
());
config
.
writeEntry
(
QStringLiteral
(
"Height %1"
).
arg
(
desktop
->
height
()),
size
.
height
());
const
Q
Size
desktop
Size
=
QApplication
::
primaryScreen
()
->
virtualSize
();
config
.
writeEntry
(
QStringLiteral
(
"Width %1"
).
arg
(
desktop
Size
.
width
()),
size
.
width
());
config
.
writeEntry
(
QStringLiteral
(
"Height %1"
).
arg
(
desktop
Size
.
height
()),
size
.
height
());
if
(
splitterWidth
>=
0
)
config
.
writeEntry
(
QStringLiteral
(
"Splitter %1"
).
arg
(
desktop
->
width
()),
splitterWidth
);
config
.
writeEntry
(
QStringLiteral
(
"Splitter %1"
).
arg
(
desktop
Size
.
width
()),
splitterWidth
);
config
.
sync
();
}
...
...
src/messagewindow.cpp
View file @
20e65306
...
...
@@ -54,7 +54,6 @@
#include
<QHBoxLayout>
#include
<QResizeEvent>
#include
<QCloseEvent>
#include
<QDesktopWidget>
#include
<QScreen>
#include
<QStyle>
...
...
@@ -1251,7 +1250,7 @@ bool MessageWindow::getWorkAreaAndModal()
// There are multiple screens.
// Check for any full screen windows, even if they are not the active
// window, and try not to show the alarm message their screens.
mScreenNumber
=
QApplication
::
desktop
()
->
screenNumber
(
MainWindow
::
mainMainWindow
());
// default = KAlarm's screen
mScreenNumber
=
screens
.
indexOf
(
MainWindow
::
mainMainWindow
()
->
screen
()
);
// default = KAlarm's screen
if
(
QGuiApplication
::
primaryScreen
()
->
virtualSiblings
().
size
()
>
1
)
{
// The screens form a single virtual desktop.
...
...
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