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:
parent
c8ed535bba
commit
d126b18d76
File diff suppressed because it is too large
Load Diff
@ -21,24 +21,17 @@
|
|||||||
#ifndef CORE_HPP
|
#ifndef CORE_HPP
|
||||||
#define CORE_HPP
|
#define CORE_HPP
|
||||||
|
|
||||||
#include <QMutex>
|
|
||||||
#include <QObject>
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include <tox/tox.h>
|
|
||||||
#include <tox/toxencryptsave.h>
|
|
||||||
|
|
||||||
#include "corestructs.h"
|
#include "corestructs.h"
|
||||||
#include "toxid.h"
|
#include "toxid.h"
|
||||||
|
|
||||||
class Profile;
|
#include <tox/tox.h>
|
||||||
template <typename T>
|
|
||||||
class QList;
|
#include <QMutex>
|
||||||
class QTimer;
|
#include <QObject>
|
||||||
class QString;
|
|
||||||
struct ToxAV;
|
|
||||||
class CoreAV;
|
class CoreAV;
|
||||||
struct vpx_image;
|
class Profile;
|
||||||
|
class QTimer;
|
||||||
|
|
||||||
class Core : public QObject
|
class Core : public QObject
|
||||||
{
|
{
|
||||||
@ -53,7 +46,7 @@ public:
|
|||||||
static const QString TOX_EXT;
|
static const QString TOX_EXT;
|
||||||
static const QString CONFIG_FILE_NAME;
|
static const QString CONFIG_FILE_NAME;
|
||||||
static QString sanitize(QString 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);
|
static QByteArray getSaltFromFile(QString filename);
|
||||||
|
|
||||||
@ -63,7 +56,7 @@ public:
|
|||||||
uint32_t getGroupNumberPeers(int groupId) const;
|
uint32_t getGroupNumberPeers(int groupId) const;
|
||||||
QString getGroupPeerName(int groupId, int peerId) const;
|
QString getGroupPeerName(int groupId, int peerId) const;
|
||||||
ToxPk getGroupPeerPk(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;
|
ToxPk getFriendPublicKey(uint32_t friendNumber) const;
|
||||||
QString getFriendUsername(uint32_t friendNumber) const;
|
QString getFriendUsername(uint32_t friendNumber) const;
|
||||||
|
|
||||||
@ -220,6 +213,7 @@ private:
|
|||||||
void checkLastOnline(uint32_t friendId);
|
void checkLastOnline(uint32_t friendId);
|
||||||
|
|
||||||
void deadifyTox();
|
void deadifyTox();
|
||||||
|
QString getFriendRequestErrorMessage(const ToxId& friendId, const QString& message) const;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void killTimers(bool onlyStop);
|
void killTimers(bool onlyStop);
|
||||||
|
@ -972,7 +972,7 @@ void ChatForm::SendMessageStr(QString msg)
|
|||||||
msg.remove(0, ACTION_PREFIX.length());
|
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();
|
QDateTime timestamp = QDateTime::currentDateTime();
|
||||||
|
|
||||||
for (const QString& part : splittedMsg) {
|
for (const QString& part : splittedMsg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user