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

Merge branch 'pr593'

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-01 08:28:18 +01:00
commit bc52fbb12b
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
4 changed files with 31 additions and 6 deletions

View File

@ -103,9 +103,8 @@ rm -rf ${BASE_DIR}/${TOX_CORE_DIR}
# afterwards install libsodium to INSTALL_DIR
# skip the installation if TOX_ONLY is true
if [[ $TOX_ONLY = "false" ]]; then
git clone git://github.com/jedisct1/libsodium.git ${BASE_DIR}/${SODIUM_DIR} --depth 1
git clone --branch $SODIUM_VER git://github.com/jedisct1/libsodium.git ${BASE_DIR}/${SODIUM_DIR} --depth 1
pushd ${BASE_DIR}/${SODIUM_DIR}
git checkout tags/$SODIUM_VER
./autogen.sh
if [[ $GLOBAL = "false" ]]; then

View File

@ -49,8 +49,9 @@ TRANSLATIONS = translations/de.ts \
RESOURCES += res.qrc
GIT_VERSION = $$system(git rev-parse HEAD)
DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\"
GIT_VERSION = $$system(git rev-parse HEAD 2> /dev/null || echo "built without git")
DEFINES += GIT_VERSION=\"\\\"$$quote($$GIT_VERSION)\\\"\"
DEFINES += LOG_TO_FILE
contains(JENKINS,YES) {
INCLUDEPATH += ./libs/include/

View File

@ -19,6 +19,21 @@
#include <QApplication>
#include <QFontDatabase>
#include <QDebug>
#include <QFile>
#include <QDir>
#include <QDateTime>
#ifdef LOG_TO_FILE
static QtMessageHandler dflt;
static QTextStream logFile;
void myMessageHandler(QtMsgType type, const QMessageLogContext& ctxt, const QString& msg)
{
dflt(type, ctxt, msg);
logFile << QTime::currentTime().toString("HH:mm:ss' '") << msg << '\n';
logFile.flush();
}
#endif
int main(int argc, char *argv[])
{
@ -26,6 +41,16 @@ int main(int argc, char *argv[])
a.setApplicationName("qTox");
a.setOrganizationName("Tox");
#ifdef LOG_TO_FILE
dflt = qInstallMessageHandler(nullptr);
QFile logfile(QDir(Settings::getSettingsDirPath()).filePath("qtox.log"));
logfile.open(QIODevice::Append);
logFile.setDevice(&logfile);
logFile << QDateTime::currentDateTime().toString("yyyy-dd-MM HH:mm:ss' file logger starting\n'");
qInstallMessageHandler(myMessageHandler);
#endif
// Windows platform plugins DLL hell fix
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath());
a.addLibraryPath("platforms");

View File

@ -593,7 +593,7 @@ void Widget::setStatusMessage(const QString &statusMessage)
void Widget::addFriend(int friendId, const QString &userId)
{
qDebug() << "Widget: Adding friend with id" << userId;
//qDebug() << "Widget: Adding friend with id" << userId;
Friend* newfriend = FriendList::addFriend(friendId, userId);
QLayout* layout = contactListWidget->getFriendLayout(Status::Offline);
layout->addWidget(newfriend->widget);
@ -632,7 +632,7 @@ void Widget::addFriend(int friendId, const QString &userId)
QPixmap avatar = Settings::getInstance().getSavedAvatar(userId);
if (!avatar.isNull())
{
qWarning() << "Widget: loadded avatar for id" << userId;
//qWarning() << "Widget: loadded avatar for id" << userId;
newfriend->chatForm->onAvatarChange(friendId, avatar);
newfriend->widget->onAvatarChange(friendId, avatar);
}