Get rid of some useless code

This commit is contained in:
Nicolas Werner 2021-12-30 19:32:28 +01:00
parent b7d6191e24
commit 750c64f323
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
8 changed files with 8 additions and 12 deletions

View File

@ -15,7 +15,7 @@ Rectangle {
required property string eventId required property string eventId
radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
width: parent ? parent.width : undefined width: parent.width
height: contents.implicitHeight + Nheko.paddingMedium * 2 height: contents.implicitHeight + Nheko.paddingMedium * 2
color: Nheko.colors.alternateBase color: Nheko.colors.alternateBase
@ -57,7 +57,7 @@ Rectangle {
} }
} }
color: Nheko.colors.text color: Nheko.colors.text
width: parent ? parent.width : undefined width: parent.width
} }
Button { Button {

View File

@ -12,7 +12,7 @@ Item {
required property string filesize required property string filesize
height: row.height + 24 height: row.height + 24
width: parent ? parent.width : undefined width: parent.width
RowLayout { RowLayout {
id: row id: row

View File

@ -16,7 +16,7 @@ Item {
required property string filename required property string filename
required property bool isReply required property bool isReply
required property string eventId required property string eventId
property double tempWidth: Math.min(parent ? parent.width : undefined, originalWidth < 1 ? 200 : originalWidth) property double tempWidth: Math.min(parent.width, originalWidth < 1 ? 200 : originalWidth)
property double tempHeight: tempWidth * proportionalHeight property double tempHeight: tempWidth * proportionalHeight
property double divisor: isReply ? 5 : 3 property double divisor: isReply ? 5 : 3
property bool tooHigh: tempHeight > timelineView.height / divisor property bool tooHigh: tempHeight > timelineView.height / divisor

View File

@ -409,7 +409,7 @@ Item {
roleValue: MtxEvent.Member roleValue: MtxEvent.Member
ColumnLayout { ColumnLayout {
width: parent ? parent.width : undefined width: parent.width
NoticeMessage { NoticeMessage {
body: formatted body: formatted

View File

@ -9,6 +9,6 @@ MatrixText {
required property string typeString required property string typeString
text: qsTr("unimplemented event: ") + typeString text: qsTr("unimplemented event: ") + typeString
width: parent ? parent.width : undefined width: parent.width
color: Nheko.inactiveColors.text color: Nheko.inactiveColors.text
} }

View File

@ -21,7 +21,7 @@ Item {
required property string url required property string url
required property string body required property string body
required property string filesize required property string filesize
property double tempWidth: Math.min(parent ? parent.width : undefined, originalWidth < 1 ? 400 : originalWidth) property double tempWidth: Math.min(parent.width, originalWidth < 1 ? 400 : originalWidth)
property double tempHeight: tempWidth * proportionalHeight property double tempHeight: tempWidth * proportionalHeight
property double divisor: isReply ? 4 : 2 property double divisor: isReply ? 4 : 2
property bool tooHigh: tempHeight > timelineRoot.height / divisor property bool tooHigh: tempHeight > timelineRoot.height / divisor

View File

@ -32,7 +32,7 @@ MatrixText {
blockquote { margin-left: 1em; } blockquote { margin-left: 1em; }
</style> </style>
" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace("<del>", "<s>").replace("</del>", "</s>").replace("<strike>", "<s>").replace("</strike>", "</s>") " + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace("<del>", "<s>").replace("</del>", "</s>").replace("<strike>", "<s>").replace("</strike>", "</s>")
width: parent ? parent.width : undefined width: parent.width
height: isReply ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : undefined height: isReply ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : undefined
clip: isReply clip: isReply
selectByMouse: !Settings.mobileMode && !isReply selectByMouse: !Settings.mobileMode && !isReply

View File

@ -543,10 +543,6 @@ EventStore::reactions(const std::string &event_id)
reaction.users_ += QString::fromStdString(user); reaction.users_ += QString::fromStdString(user);
} }
nhlog::db()->debug("key: {}, count: {}, users: {}",
reaction.key_.toStdString(),
reaction.count_,
reaction.users_.toStdString());
temp.append(QVariant::fromValue(reaction)); temp.append(QVariant::fromValue(reaction));
} }