From 4cd260bfcfcbf88a6efb8bf5a1abf3d37fb06463 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 31 Jan 2020 06:12:02 +0100 Subject: Optimize includes a bit --- src/Utils.h | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'src/Utils.h') diff --git a/src/Utils.h b/src/Utils.h index ea0df21f..a3854dd8 100644 --- a/src/Utils.h +++ b/src/Utils.h @@ -2,8 +2,6 @@ #include -#include "RoomInfoListItem.h" - #include #include #include @@ -12,6 +10,8 @@ #include +struct DescInfo; + namespace cache { // Forward declarations to prevent dependency on Cache.h, since this header is included often! QString @@ -166,25 +166,6 @@ messageDescription(const QString &username = "", } } -template -DescInfo -createDescriptionInfo(const Event &event, const QString &localUser, const QString &room_id) -{ - const auto msg = std::get(event); - const auto sender = QString::fromStdString(msg.sender); - - const auto username = cache::displayName(room_id, sender); - const auto ts = QDateTime::fromMSecsSinceEpoch(msg.origin_server_ts); - - return DescInfo{QString::fromStdString(msg.event_id), - sender, - messageDescription(username, - QString::fromStdString(msg.content.body).trimmed(), - sender == localUser), - utils::descriptiveTime(ts), - ts}; -} - //! Scale down an image to fit to the given width & height limitations. QPixmap scaleDown(uint64_t maxWidth, uint64_t maxHeight, const QPixmap &source); @@ -326,14 +307,4 @@ centerWidget(QWidget *widget, QWidget *parent); void restoreCombobox(QComboBox *combo, const QString &value); -struct SideBarSizes -{ - int small; - int normal; - int groups; - int collapsePoint; -}; - -SideBarSizes -calculateSidebarSizes(const QFont &f); } -- cgit 1.5.1