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

Fix segfault, minor cleanup

This commit is contained in:
Dubslow 2015-01-23 05:48:55 -06:00
parent 29cc9e1b7d
commit dea2ccf0b7

View File

@ -224,7 +224,6 @@ void Core::start()
if (loadPath.isEmpty())
{
qCritical() << "Core: loadConfiguration failed, exiting now";
deadifyTox();
emit failedToStart();
return;
}
@ -302,7 +301,7 @@ void Core::start()
void Core::process()
{
if (!tox)
if (!isReady())
return;
static int tolerance = CORE_DISCONNECT_TOLERANCE;
@ -1004,7 +1003,7 @@ void Core::acceptFileRecvRequest(int friendId, int fileNum, QString path)
void Core::removeFriend(int friendId, bool fake)
{
if (!tox || fake)
if (!isReady() || fake)
return;
if (tox_del_friend(tox, friendId) == -1) {
emit failedToRemoveFriend(friendId);
@ -1016,7 +1015,7 @@ void Core::removeFriend(int friendId, bool fake)
void Core::removeGroup(int groupId, bool fake)
{
if (!tox || fake)
if (!isReady() || fake)
return;
tox_del_groupchat(tox, groupId);
@ -1673,7 +1672,7 @@ QString Core::getPeerName(const ToxID& id) const
bool Core::isReady()
{
return ready;
return toxav && tox && ready;
}
void Core::setNospam(uint32_t nospam)