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

refactor: Core refactoring

Brief list of changes:
  - removed unnecessary headers from core.h and core.cpp;
  - added missing brackets and aligned long lists of parameters;
  - some other small changes.
This commit is contained in:
noavarice 2017-04-01 01:01:25 +03:00
parent c8ed535bba
commit d126b18d76
3 changed files with 306 additions and 247 deletions

File diff suppressed because it is too large Load Diff

View File

@ -21,24 +21,17 @@
#ifndef CORE_HPP
#define CORE_HPP
#include <QMutex>
#include <QObject>
#include <cstdint>
#include <tox/tox.h>
#include <tox/toxencryptsave.h>
#include "corestructs.h"
#include "toxid.h"
class Profile;
template <typename T>
class QList;
class QTimer;
class QString;
struct ToxAV;
#include <tox/tox.h>
#include <QMutex>
#include <QObject>
class CoreAV;
struct vpx_image;
class Profile;
class QTimer;
class Core : public QObject
{
@ -53,7 +46,7 @@ public:
static const QString TOX_EXT;
static const QString CONFIG_FILE_NAME;
static QString sanitize(QString name);
static QList<QString> splitMessage(const QString& message, int maxLen);
static QStringList splitMessage(const QString& message, int maxLen);
static QByteArray getSaltFromFile(QString filename);
@ -63,7 +56,7 @@ public:
uint32_t getGroupNumberPeers(int groupId) const;
QString getGroupPeerName(int groupId, int peerId) const;
ToxPk getGroupPeerPk(int groupId, int peerId) const;
QList<QString> getGroupPeerNames(int groupId) const;
QStringList getGroupPeerNames(int groupId) const;
ToxPk getFriendPublicKey(uint32_t friendNumber) const;
QString getFriendUsername(uint32_t friendNumber) const;
@ -220,6 +213,7 @@ private:
void checkLastOnline(uint32_t friendId);
void deadifyTox();
QString getFriendRequestErrorMessage(const ToxId& friendId, const QString& message) const;
private slots:
void killTimers(bool onlyStop);

View File

@ -972,7 +972,7 @@ void ChatForm::SendMessageStr(QString msg)
msg.remove(0, ACTION_PREFIX.length());
}
QList<QString> splittedMsg = Core::splitMessage(msg, TOX_MAX_MESSAGE_LENGTH);
QStringList splittedMsg = Core::splitMessage(msg, TOX_MAX_MESSAGE_LENGTH);
QDateTime timestamp = QDateTime::currentDateTime();
for (const QString& part : splittedMsg) {