From 324b0be091f0f9c475be56a44e080bbbd71b49bd Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Tue, 1 Jul 2014 00:36:48 +0200 Subject: [PATCH] Remove some dead code, refactor --- core.h | 5 +++-- friend.cpp | 1 - friend.h | 1 - main.cpp | 2 +- res.qrc | 4 ++++ status.cpp | 35 ----------------------------------- status.h | 45 --------------------------------------------- toxgui.pro | 2 -- 8 files changed, 8 insertions(+), 87 deletions(-) delete mode 100644 status.cpp delete mode 100644 status.h diff --git a/core.h b/core.h index 2698c0488..988787a48 100644 --- a/core.h +++ b/core.h @@ -17,7 +17,6 @@ #ifndef CORE_HPP #define CORE_HPP -#include "status.h" #include "audiobuffer.h" #include @@ -50,6 +49,8 @@ class Camera; +enum class Status : int {Online = 0, Away, Busy, Offline}; + struct DhtServer { QString name; @@ -131,9 +132,9 @@ public slots: void removeFriend(int friendId); void removeGroup(int groupId); + void setStatus(Status status); void setUsername(const QString& username); void setStatusMessage(const QString& message); - void setStatus(Status status); void sendMessage(int friendId, const QString& message); void sendGroupMessage(int groupId, const QString& message); diff --git a/friend.cpp b/friend.cpp index 14a55b173..b44bd127f 100644 --- a/friend.cpp +++ b/friend.cpp @@ -1,7 +1,6 @@ #include "friend.h" #include "friendlist.h" #include "widget/friendwidget.h" -#include "status.h" Friend::Friend(int FriendId, QString UserId) : friendId(FriendId), userId(UserId) diff --git a/friend.h b/friend.h index 812f5c853..af3ba68a3 100644 --- a/friend.h +++ b/friend.h @@ -3,7 +3,6 @@ #include #include "widget/form/chatform.h" -#include "status.h" struct FriendWidget; diff --git a/main.cpp b/main.cpp index 888fa06e5..26e43905e 100644 --- a/main.cpp +++ b/main.cpp @@ -24,8 +24,8 @@ int main(int argc, char *argv[]) /** TODO * ">using a dedicated tool to maintain a TODO list" edition * + * QRC FILES DO YOU EVEN INTO THEM ? Fix it soon for packaging and Urras. * Most cameras use YUYV, implement YUYV -> YUV240 - * Groupchat users count not updated when people leave * Sending large files (~380MB) "restarts" after ~10MB. Goes back to 0%, consumes twice as much ram (reloads the file?) * => Don't load the whole file at once, load small chunks (25MB?) when needed, then free them and load the next * Sort the friend list by status, online first then busy then offline diff --git a/res.qrc b/res.qrc index cd4405d34..82ce64784 100644 --- a/res.qrc +++ b/res.qrc @@ -5,4 +5,8 @@ res/DejaVuSans.ttf + + audio/notification.wav + img/icon.png + diff --git a/status.cpp b/status.cpp deleted file mode 100644 index 4d9445e25..000000000 --- a/status.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2013 by Maxim Biro - - This file is part of Tox Qt GUI. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the COPYING file for more details. -*/ - -#include "status.h" - -const QList StatusHelper::info = -{ - {"Online", ":/icons/status_online.png"}, - {"Away", ":/icons/status_away.png"}, - {"Busy", ":/icons/status_busy.png"}, - {"Offline", ":/icons/status_offline.png"} -}; - -StatusHelper::Info StatusHelper::getInfo(int status) -{ - return info.at(status); -} - -StatusHelper::Info StatusHelper::getInfo(Status status) -{ - return StatusHelper::getInfo(static_cast(status)); -} diff --git a/status.h b/status.h deleted file mode 100644 index 3d753dcca..000000000 --- a/status.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - Copyright (C) 2013 by Maxim Biro - - This file is part of Tox Qt GUI. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - - See the COPYING file for more details. -*/ - -#ifndef STATUS_HPP -#define STATUS_HPP - -#include - -enum class Status : int {Online = 0, Away, Busy, Offline}; - -class StatusHelper -{ -public: - - static const int MAX_STATUS = static_cast(Status::Offline); - - struct Info { - QString name; - QString iconPath; - }; - - static Info getInfo(int status); - static Info getInfo(Status status); - -private: - const static QList info; - -}; - -Q_DECLARE_METATYPE(Status) - -#endif // STATUS_HPP diff --git a/toxgui.pro b/toxgui.pro index 47ce626c6..cca83a4d7 100644 --- a/toxgui.pro +++ b/toxgui.pro @@ -29,7 +29,6 @@ HEADERS += widget/form/addfriendform.h \ group.h \ grouplist.h \ settings.h \ - status.h \ core.h \ friendlist.h \ cdata.h \ @@ -71,7 +70,6 @@ SOURCES += \ grouplist.cpp \ main.cpp \ settings.cpp \ - status.cpp \ cdata.cpp \ cstring.cpp \ audiobuffer.cpp \