Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nheko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nheko Reborn
nheko
Commits
e8e48305
Verified
Commit
e8e48305
authored
3 years ago
by
Nicolas Werner
Browse files
Options
Downloads
Patches
Plain Diff
Remove version checks for unsupported Qt versions
parent
c8879e7c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/notifications/ManagerLinux.cpp
+1
-4
1 addition, 4 deletions
src/notifications/ManagerLinux.cpp
src/ui/InfoMessage.cpp
+2
-13
2 additions, 13 deletions
src/ui/InfoMessage.cpp
src/ui/Painter.h
+0
-5
0 additions, 5 deletions
src/ui/Painter.h
with
3 additions
and
22 deletions
src/notifications/ManagerLinux.cpp
+
1
−
4
View file @
e8e48305
...
@@ -295,12 +295,9 @@ operator<<(QDBusArgument &arg, const QImage &image)
...
@@ -295,12 +295,9 @@ operator<<(QDBusArgument &arg, const QImage &image)
int
channels
=
i
.
isGrayscale
()
?
1
:
(
i
.
hasAlphaChannel
()
?
4
:
3
);
int
channels
=
i
.
isGrayscale
()
?
1
:
(
i
.
hasAlphaChannel
()
?
4
:
3
);
arg
<<
i
.
depth
()
/
channels
;
arg
<<
i
.
depth
()
/
channels
;
arg
<<
channels
;
arg
<<
channels
;
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0)
arg
<<
QByteArray
(
reinterpret_cast
<
const
char
*>
(
i
.
bits
()),
i
.
byteCount
());
#else
arg
<<
QByteArray
(
reinterpret_cast
<
const
char
*>
(
i
.
bits
()),
i
.
sizeInBytes
());
arg
<<
QByteArray
(
reinterpret_cast
<
const
char
*>
(
i
.
bits
()),
i
.
sizeInBytes
());
#endif
arg
.
endStructure
();
arg
.
endStructure
();
return
arg
;
return
arg
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/ui/InfoMessage.cpp
+
2
−
13
View file @
e8e48305
...
@@ -29,13 +29,7 @@ InfoMessage::InfoMessage(QString msg, QWidget *parent)
...
@@ -29,13 +29,7 @@ InfoMessage::InfoMessage(QString msg, QWidget *parent)
initFont
();
initFont
();
QFontMetrics
fm
{
font
()};
QFontMetrics
fm
{
font
()};
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
width_
=
fm
.
horizontalAdvance
(
msg_
)
+
HPadding
*
2
;
// width deprecated in 5.13
width_
=
fm
.
width
(
msg_
)
+
HPadding
*
2
;
#else
width_
=
fm
.
horizontalAdvance
(
msg_
)
+
HPadding
*
2
;
#endif
height_
=
fm
.
ascent
()
+
2
*
VPadding
;
height_
=
fm
.
ascent
()
+
2
*
VPadding
;
setFixedHeight
(
height_
+
2
*
HMargin
);
setFixedHeight
(
height_
+
2
*
HMargin
);
...
@@ -77,12 +71,7 @@ DateSeparator::DateSeparator(QDateTime datetime, QWidget *parent)
...
@@ -77,12 +71,7 @@ DateSeparator::DateSeparator(QDateTime datetime, QWidget *parent)
msg_
=
datetime
.
date
().
toString
(
fmt
);
msg_
=
datetime
.
date
().
toString
(
fmt
);
QFontMetrics
fm
{
font
()};
QFontMetrics
fm
{
font
()};
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
width_
=
fm
.
horizontalAdvance
(
msg_
)
+
HPadding
*
2
;
// width deprecated in 5.13
width_
=
fm
.
width
(
msg_
)
+
HPadding
*
2
;
#else
width_
=
fm
.
horizontalAdvance
(
msg_
)
+
HPadding
*
2
;
#endif
height_
=
fm
.
ascent
()
+
2
*
VPadding
;
height_
=
fm
.
ascent
()
+
2
*
VPadding
;
setFixedHeight
(
height_
+
2
*
HMargin
);
setFixedHeight
(
height_
+
2
*
HMargin
);
...
...
This diff is collapsed.
Click to expand it.
src/ui/Painter.h
+
0
−
5
View file @
e8e48305
...
@@ -27,12 +27,7 @@ public:
...
@@ -27,12 +27,7 @@ public:
{
{
QFontMetrics
m
(
fontMetrics
());
QFontMetrics
m
(
fontMetrics
());
if
(
textWidth
<
0
)
{
if
(
textWidth
<
0
)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
// deprecated in 5.13:
textWidth
=
m
.
width
(
text
);
#else
textWidth
=
m
.
horizontalAdvance
(
text
);
textWidth
=
m
.
horizontalAdvance
(
text
);
#endif
}
}
drawText
((
outerw
-
x
-
textWidth
),
y
+
m
.
ascent
(),
text
);
drawText
((
outerw
-
x
-
textWidth
),
y
+
m
.
ascent
(),
text
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment