summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-19 22:09:21 +0200
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-02-19 22:09:21 +0200
commit8b139c32a3b4a92e32a4737b599cf14e61b8a096 (patch)
tree6d145d2a1098753286929d516dff983e31479349
parentNotify the user on upload failures (diff)
downloadnheko-8b139c32a3b4a92e32a4737b599cf14e61b8a096.tar.xz
Minor adjustments
-rw-r--r--include/MatrixClient.h16
-rw-r--r--include/Utils.h2
-rw-r--r--include/dialogs/PreviewUploadOverlay.h2
-rw-r--r--include/timeline/TimelineView.h8
-rw-r--r--include/timeline/TimelineViewManager.h8
-rw-r--r--include/timeline/widgets/AudioItem.h2
-rw-r--r--include/timeline/widgets/FileItem.h2
-rw-r--r--include/timeline/widgets/ImageItem.h2
-rw-r--r--include/timeline/widgets/VideoItem.h2
-rw-r--r--src/ChatPage.cc8
-rw-r--r--src/MatrixClient.cc2
-rw-r--r--src/Utils.cc2
-rw-r--r--src/dialogs/PreviewUploadOverlay.cc2
-rw-r--r--src/timeline/TimelineViewManager.cc8
-rw-r--r--src/timeline/widgets/AudioItem.cc2
-rw-r--r--src/timeline/widgets/FileItem.cc2
-rw-r--r--src/timeline/widgets/ImageItem.cc2
-rw-r--r--src/timeline/widgets/VideoItem.cc2
18 files changed, 37 insertions, 37 deletions
diff --git a/include/MatrixClient.h b/include/MatrixClient.h
index 03cd8669..91e6db28 100644
--- a/include/MatrixClient.h
+++ b/include/MatrixClient.h
@@ -40,7 +40,7 @@ public:
                              const QString &roomid,
                              const QString &msg,
                              const QString &mime,
-                             const int64_t media_size,
+                             uint64_t media_size,
                              const QString &url = "") noexcept;
         void login(const QString &username, const QString &password) noexcept;
         void registerUser(const QString &username,
@@ -116,22 +116,22 @@ signals:
                            const QString &filename,
                            const QString &url,
                            const QString &mime,
-                           const int64_t size);
+                           uint64_t size);
         void fileUploaded(const QString &roomid,
                           const QString &filename,
                           const QString &url,
                           const QString &mime,
-                          const int64_t size);
+                          uint64_t size);
         void audioUploaded(const QString &roomid,
                            const QString &filename,
                            const QString &url,
                            const QString &mime,
-                           const int64_t size);
+                           uint64_t size);
         void videoUploaded(const QString &roomid,
                            const QString &filename,
                            const QString &url,
                            const QString &mime,
-                           const int64_t size);
+                           uint64_t size);
         void roomAvatarRetrieved(const QString &roomid,
                                  const QPixmap &img,
                                  const QString &url,
@@ -151,9 +151,9 @@ signals:
         void syncCompleted(const mtx::responses::Sync &response);
         void syncFailed(const QString &msg);
         void joinFailed(const QString &msg);
-        void messageSent(const QString &event_id, const QString &roomid, const int txn_id);
-        void messageSendFailed(const QString &roomid, const int txn_id);
-        void emoteSent(const QString &event_id, const QString &roomid, const int txn_id);
+        void messageSent(const QString &event_id, const QString &roomid, int txn_id);
+        void messageSendFailed(const QString &roomid, int txn_id);
+        void emoteSent(const QString &event_id, const QString &roomid, int txn_id);
         void messagesRetrieved(const QString &room_id, const mtx::responses::Messages &msgs);
         void joinedRoom(const QString &room_id);
         void leftRoom(const QString &room_id);
diff --git a/include/Utils.h b/include/Utils.h
index 2c764f88..30e592cd 100644
--- a/include/Utils.h
+++ b/include/Utils.h
@@ -25,5 +25,5 @@ firstChar(const QString &input);
 
 //! Get a human readable file size with the appropriate units attached.
 QString
-humanReadableFileSize(const uint64_t bytes);
+humanReadableFileSize(uint64_t bytes);
 }
diff --git a/include/dialogs/PreviewUploadOverlay.h b/include/dialogs/PreviewUploadOverlay.h
index c9516719..48795ca0 100644
--- a/include/dialogs/PreviewUploadOverlay.h
+++ b/include/dialogs/PreviewUploadOverlay.h
@@ -42,7 +42,7 @@ signals:
 
 private:
         void init();
-        void setLabels(const QString &type, const QString &mime, const int upload_size);
+        void setLabels(const QString &type, const QString &mime, uint64_t upload_size);
 
         bool isImage_;
         QPixmap image_;
diff --git a/include/timeline/TimelineView.h b/include/timeline/TimelineView.h
index 782f3afd..96d7690d 100644
--- a/include/timeline/TimelineView.h
+++ b/include/timeline/TimelineView.h
@@ -45,7 +45,7 @@ struct PendingMessage
         QString body;
         QString filename;
         QString mime;
-        int64_t media_size;
+        uint64_t media_size;
         QString event_id;
         TimelineItem *widget;
 
@@ -54,7 +54,7 @@ struct PendingMessage
                        QString body,
                        QString filename,
                        QString mime,
-                       int64_t media_size,
+                       uint64_t media_size,
                        QString event_id,
                        TimelineItem *widget)
           : ty(ty)
@@ -96,7 +96,7 @@ public:
         void addUserMessage(const QString &url,
                             const QString &filename,
                             const QString &mime,
-                            const int64_t size);
+                            uint64_t size);
         void updatePendingMessage(int txn_id, QString event_id);
         void scrollDown();
         QLabel *createDateSeparator(QDateTime datetime);
@@ -243,7 +243,7 @@ void
 TimelineView::addUserMessage(const QString &url,
                              const QString &filename,
                              const QString &mime,
-                             const int64_t size)
+                             uint64_t size)
 {
         auto with_sender = lastSender_ != local_user_;
         auto trimmed     = QFileInfo{filename}.fileName(); // Trim file path.
diff --git a/include/timeline/TimelineViewManager.h b/include/timeline/TimelineViewManager.h
index a531be88..c7bbd71a 100644
--- a/include/timeline/TimelineViewManager.h
+++ b/include/timeline/TimelineViewManager.h
@@ -67,22 +67,22 @@ public slots:
                                const QString &filename,
                                const QString &url,
                                const QString &mime,
-                               const int64_t dsize);
+                               uint64_t dsize);
         void queueFileMessage(const QString &roomid,
                               const QString &filename,
                               const QString &url,
                               const QString &mime,
-                              const int64_t dsize);
+                              uint64_t dsize);
         void queueAudioMessage(const QString &roomid,
                                const QString &filename,
                                const QString &url,
                                const QString &mime,
-                               const int64_t dsize);
+                               uint64_t dsize);
         void queueVideoMessage(const QString &roomid,
                                const QString &filename,
                                const QString &url,
                                const QString &mime,
-                               const int64_t dsize);
+                               uint64_t dsize);
 
 private slots:
         void messageSent(const QString &eventid, const QString &roomid, int txnid);
diff --git a/include/timeline/widgets/AudioItem.h b/include/timeline/widgets/AudioItem.h
index 06f4b8ff..88e84d0c 100644
--- a/include/timeline/widgets/AudioItem.h
+++ b/include/timeline/widgets/AudioItem.h
@@ -49,7 +49,7 @@ public:
         AudioItem(QSharedPointer<MatrixClient> client,
                   const QString &url,
                   const QString &filename,
-                  const int64_t size,
+                  uint64_t size,
                   QWidget *parent = nullptr);
 
         QSize sizeHint() const override;
diff --git a/include/timeline/widgets/FileItem.h b/include/timeline/widgets/FileItem.h
index 36d72f25..cc6cd2ee 100644
--- a/include/timeline/widgets/FileItem.h
+++ b/include/timeline/widgets/FileItem.h
@@ -43,7 +43,7 @@ public:
         FileItem(QSharedPointer<MatrixClient> client,
                  const QString &url,
                  const QString &filename,
-                 const int64_t size,
+                 uint64_t size,
                  QWidget *parent = nullptr);
 
         QSize sizeHint() const override;
diff --git a/include/timeline/widgets/ImageItem.h b/include/timeline/widgets/ImageItem.h
index 9e5fa82b..28a0b461 100644
--- a/include/timeline/widgets/ImageItem.h
+++ b/include/timeline/widgets/ImageItem.h
@@ -37,7 +37,7 @@ public:
         ImageItem(QSharedPointer<MatrixClient> client,
                   const QString &url,
                   const QString &filename,
-                  const int64_t size,
+                  uint64_t size,
                   QWidget *parent = nullptr);
 
         void setImage(const QPixmap &image);
diff --git a/include/timeline/widgets/VideoItem.h b/include/timeline/widgets/VideoItem.h
index 65b87c95..89732975 100644
--- a/include/timeline/widgets/VideoItem.h
+++ b/include/timeline/widgets/VideoItem.h
@@ -38,7 +38,7 @@ public:
         VideoItem(QSharedPointer<MatrixClient> client,
                   const QString &url,
                   const QString &filename,
-                  const int64_t size,
+                  uint64_t size,
                   QWidget *parent = nullptr);
 
 private:
diff --git a/src/ChatPage.cc b/src/ChatPage.cc
index 8899ffca..3bca5cd8 100644
--- a/src/ChatPage.cc
+++ b/src/ChatPage.cc
@@ -263,28 +263,28 @@ ChatPage::ChatPage(QSharedPointer<MatrixClient> client,
         connect(client_.data(),
                 &MatrixClient::imageUploaded,
                 this,
-                [=](QString roomid, QString filename, QString url, QString mime, int64_t dsize) {
+                [=](QString roomid, QString filename, QString url, QString mime, uint64_t dsize) {
                         text_input_->hideUploadSpinner();
                         view_manager_->queueImageMessage(roomid, filename, url, mime, dsize);
                 });
         connect(client_.data(),
                 &MatrixClient::fileUploaded,
                 this,
-                [=](QString roomid, QString filename, QString url, QString mime, int64_t dsize) {
+                [=](QString roomid, QString filename, QString url, QString mime, uint64_t dsize) {
                         text_input_->hideUploadSpinner();
                         view_manager_->queueFileMessage(roomid, filename, url, mime, dsize);
                 });
         connect(client_.data(),
                 &MatrixClient::audioUploaded,
                 this,
-                [=](QString roomid, QString filename, QString url, QString mime, int64_t dsize) {
+                [=](QString roomid, QString filename, QString url, QString mime, uint64_t dsize) {
                         text_input_->hideUploadSpinner();
                         view_manager_->queueAudioMessage(roomid, filename, url, mime, dsize);
                 });
         connect(client_.data(),
                 &MatrixClient::videoUploaded,
                 this,
-                [=](QString roomid, QString filename, QString url, QString mime, int64_t dsize) {
+                [=](QString roomid, QString filename, QString url, QString mime, uint64_t dsize) {
                         text_input_->hideUploadSpinner();
                         view_manager_->queueVideoMessage(roomid, filename, url, mime, dsize);
                 });
diff --git a/src/MatrixClient.cc b/src/MatrixClient.cc
index de9ce779..fae02302 100644
--- a/src/MatrixClient.cc
+++ b/src/MatrixClient.cc
@@ -281,7 +281,7 @@ MatrixClient::sendRoomMessage(mtx::events::MessageType ty,
                               const QString &roomid,
                               const QString &msg,
                               const QString &mime,
-                              const int64_t media_size,
+                              uint64_t media_size,
                               const QString &url) noexcept
 {
         QUrlQuery query;
diff --git a/src/Utils.cc b/src/Utils.cc
index 858d4e76..6f438c20 100644
--- a/src/Utils.cc
+++ b/src/Utils.cc
@@ -135,7 +135,7 @@ utils::firstChar(const QString &input)
 }
 
 QString
-utils::humanReadableFileSize(const uint64_t bytes)
+utils::humanReadableFileSize(uint64_t bytes)
 {
         constexpr static const char *units[] = {"B", "KiB", "MiB", "GiB", "TiB"};
         constexpr static const int length    = sizeof(units) / sizeof(units[0]);
diff --git a/src/dialogs/PreviewUploadOverlay.cc b/src/dialogs/PreviewUploadOverlay.cc
index f2007011..5b4b9ffa 100644
--- a/src/dialogs/PreviewUploadOverlay.cc
+++ b/src/dialogs/PreviewUploadOverlay.cc
@@ -103,7 +103,7 @@ PreviewUploadOverlay::init()
 }
 
 void
-PreviewUploadOverlay::setLabels(const QString &type, const QString &mime, const int upload_size)
+PreviewUploadOverlay::setLabels(const QString &type, const QString &mime, uint64_t upload_size)
 {
         if (mediaType_ == "image") {
                 if (!image_.loadFromData(data_)) {
diff --git a/src/timeline/TimelineViewManager.cc b/src/timeline/TimelineViewManager.cc
index 0e2bde2e..3fee59c7 100644
--- a/src/timeline/TimelineViewManager.cc
+++ b/src/timeline/TimelineViewManager.cc
@@ -93,7 +93,7 @@ TimelineViewManager::queueImageMessage(const QString &roomid,
                                        const QString &filename,
                                        const QString &url,
                                        const QString &mime,
-                                       const int64_t size)
+                                       uint64_t size)
 {
         if (!timelineViewExists(roomid)) {
                 qDebug() << "Cannot send m.image message to a non-managed view";
@@ -110,7 +110,7 @@ TimelineViewManager::queueFileMessage(const QString &roomid,
                                       const QString &filename,
                                       const QString &url,
                                       const QString &mime,
-                                      const int64_t size)
+                                      uint64_t size)
 {
         if (!timelineViewExists(roomid)) {
                 qDebug() << "Cannot send m.file message to a non-managed view";
@@ -127,7 +127,7 @@ TimelineViewManager::queueAudioMessage(const QString &roomid,
                                        const QString &filename,
                                        const QString &url,
                                        const QString &mime,
-                                       const int64_t size)
+                                       uint64_t size)
 {
         if (!timelineViewExists(roomid)) {
                 qDebug() << "Cannot send m.audio message to a non-managed view";
@@ -144,7 +144,7 @@ TimelineViewManager::queueVideoMessage(const QString &roomid,
                                        const QString &filename,
                                        const QString &url,
                                        const QString &mime,
-                                       const int64_t size)
+                                       uint64_t size)
 {
         if (!timelineViewExists(roomid)) {
                 qDebug() << "Cannot send m.video message to a non-managed view";
diff --git a/src/timeline/widgets/AudioItem.cc b/src/timeline/widgets/AudioItem.cc
index 9075bc55..6054d70b 100644
--- a/src/timeline/widgets/AudioItem.cc
+++ b/src/timeline/widgets/AudioItem.cc
@@ -91,7 +91,7 @@ AudioItem::AudioItem(QSharedPointer<MatrixClient> client,
 AudioItem::AudioItem(QSharedPointer<MatrixClient> client,
                      const QString &url,
                      const QString &filename,
-                     const int64_t size,
+                     uint64_t size,
                      QWidget *parent)
   : QWidget(parent)
   , url_{url}
diff --git a/src/timeline/widgets/FileItem.cc b/src/timeline/widgets/FileItem.cc
index eda6e835..258536e7 100644
--- a/src/timeline/widgets/FileItem.cc
+++ b/src/timeline/widgets/FileItem.cc
@@ -78,7 +78,7 @@ FileItem::FileItem(QSharedPointer<MatrixClient> client,
 FileItem::FileItem(QSharedPointer<MatrixClient> client,
                    const QString &url,
                    const QString &filename,
-                   const int64_t size,
+                   uint64_t size,
                    QWidget *parent)
   : QWidget(parent)
   , url_{url}
diff --git a/src/timeline/widgets/ImageItem.cc b/src/timeline/widgets/ImageItem.cc
index f91799c3..e8fa069e 100644
--- a/src/timeline/widgets/ImageItem.cc
+++ b/src/timeline/widgets/ImageItem.cc
@@ -62,7 +62,7 @@ ImageItem::ImageItem(QSharedPointer<MatrixClient> client,
 ImageItem::ImageItem(QSharedPointer<MatrixClient> client,
                      const QString &url,
                      const QString &filename,
-                     const int64_t size,
+                     uint64_t size,
                      QWidget *parent)
   : QWidget(parent)
   , url_{url}
diff --git a/src/timeline/widgets/VideoItem.cc b/src/timeline/widgets/VideoItem.cc
index 34c0a643..788db0ed 100644
--- a/src/timeline/widgets/VideoItem.cc
+++ b/src/timeline/widgets/VideoItem.cc
@@ -68,7 +68,7 @@ VideoItem::VideoItem(QSharedPointer<MatrixClient> client,
 VideoItem::VideoItem(QSharedPointer<MatrixClient> client,
                      const QString &url,
                      const QString &filename,
-                     const int64_t size,
+                     uint64_t size,
                      QWidget *parent)
   : QWidget(parent)
   , url_{url}