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:
commit
bc52fbb12b
|
@ -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
|
||||
|
|
5
qtox.pro
5
qtox.pro
|
@ -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/
|
||||
|
|
25
src/main.cpp
25
src/main.cpp
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user