1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Remove some dead code, refactor

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-07-01 00:36:48 +02:00
parent 73e3afe932
commit 324b0be091
8 changed files with 8 additions and 87 deletions

5
core.h
View File

@ -17,7 +17,6 @@
#ifndef CORE_HPP #ifndef CORE_HPP
#define CORE_HPP #define CORE_HPP
#include "status.h"
#include "audiobuffer.h" #include "audiobuffer.h"
#include <tox/tox.h> #include <tox/tox.h>
@ -50,6 +49,8 @@
class Camera; class Camera;
enum class Status : int {Online = 0, Away, Busy, Offline};
struct DhtServer struct DhtServer
{ {
QString name; QString name;
@ -131,9 +132,9 @@ public slots:
void removeFriend(int friendId); void removeFriend(int friendId);
void removeGroup(int groupId); void removeGroup(int groupId);
void setStatus(Status status);
void setUsername(const QString& username); void setUsername(const QString& username);
void setStatusMessage(const QString& message); void setStatusMessage(const QString& message);
void setStatus(Status status);
void sendMessage(int friendId, const QString& message); void sendMessage(int friendId, const QString& message);
void sendGroupMessage(int groupId, const QString& message); void sendGroupMessage(int groupId, const QString& message);

View File

@ -1,7 +1,6 @@
#include "friend.h" #include "friend.h"
#include "friendlist.h" #include "friendlist.h"
#include "widget/friendwidget.h" #include "widget/friendwidget.h"
#include "status.h"
Friend::Friend(int FriendId, QString UserId) Friend::Friend(int FriendId, QString UserId)
: friendId(FriendId), userId(UserId) : friendId(FriendId), userId(UserId)

View File

@ -3,7 +3,6 @@
#include <QString> #include <QString>
#include "widget/form/chatform.h" #include "widget/form/chatform.h"
#include "status.h"
struct FriendWidget; struct FriendWidget;

View File

@ -24,8 +24,8 @@ int main(int argc, char *argv[])
/** TODO /** TODO
* ">using a dedicated tool to maintain a TODO list" edition * ">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 * 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?) * 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 * => 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 * Sort the friend list by status, online first then busy then offline

View File

@ -5,4 +5,8 @@
<qresource prefix="/font"> <qresource prefix="/font">
<file alias="DejaVuSans.ttf">res/DejaVuSans.ttf</file> <file alias="DejaVuSans.ttf">res/DejaVuSans.ttf</file>
</qresource> </qresource>
<qresource prefix="/">
<file>audio/notification.wav</file>
<file>img/icon.png</file>
</qresource>
</RCC> </RCC>

View File

@ -1,35 +0,0 @@
/*
Copyright (C) 2013 by Maxim Biro <nurupo.contributions@gmail.com>
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> 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<int>(status));
}

View File

@ -1,45 +0,0 @@
/*
Copyright (C) 2013 by Maxim Biro <nurupo.contributions@gmail.com>
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 <QObject>
enum class Status : int {Online = 0, Away, Busy, Offline};
class StatusHelper
{
public:
static const int MAX_STATUS = static_cast<int>(Status::Offline);
struct Info {
QString name;
QString iconPath;
};
static Info getInfo(int status);
static Info getInfo(Status status);
private:
const static QList<Info> info;
};
Q_DECLARE_METATYPE(Status)
#endif // STATUS_HPP

View File

@ -29,7 +29,6 @@ HEADERS += widget/form/addfriendform.h \
group.h \ group.h \
grouplist.h \ grouplist.h \
settings.h \ settings.h \
status.h \
core.h \ core.h \
friendlist.h \ friendlist.h \
cdata.h \ cdata.h \
@ -71,7 +70,6 @@ SOURCES += \
grouplist.cpp \ grouplist.cpp \
main.cpp \ main.cpp \
settings.cpp \ settings.cpp \
status.cpp \
cdata.cpp \ cdata.cpp \
cstring.cpp \ cstring.cpp \
audiobuffer.cpp \ audiobuffer.cpp \