diff options
-rw-r--r-- | .travis.yml | 7 | ||||
-rw-r--r-- | ISSUE_TEMPLATE.md | 39 | ||||
-rw-r--r-- | connection.cpp | 9 |
3 files changed, 48 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index b75418f2..001ba11f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,15 +22,16 @@ matrix: before_install: - eval "${ENV_EVAL}" -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then . /opt/qt56/bin/qt56-env.sh; fi +- if [ "$TRAVIS_OS_NAME" = "linux" ]; then VALGRIND="valgrind $VALGRIND_OPTIONS"; . /opt/qt56/bin/qt56-env.sh; fi script: - mkdir build && cd build - cmake .. - cmake --build . --target all - cd .. -- qmake qmc-example.pro "CONFIG += debug" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" && make all -- if [ "$TRAVIS_OS_NAME" = "linux" ]; then valgrind --tool=memcheck --leak-check=yes --show-reachable=yes ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" '#qmc-test:matrix.org'; fi +- qmake qmc-example.pro "CONFIG += debug" "CONFIG -= app_bundle" "QMAKE_CC = $CC" "QMAKE_CXX = $CXX" +- make all +- $VALGRIND ./qmc-example "$QMC_TEST_USER" "$QMC_TEST_PWD" '#qmc-test:matrix.org' notifications: webhooks: diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..64a80350 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,39 @@ +<!-- + +This is a bug report template. By following the instructions below and +filling out the sections with your information, you will help the us to get all +the necessary data to fix your issue. + +You can also preview your report before submitting it. You may remove sections +that aren't relevant to your particular case. + +Text between <!-- and --> marks will be invisible in the report. + +--> + +### Description + +Describe here the problem that you are experiencing, or the feature you are requesting. + +### Steps to reproduce + +- For bugs, list the steps +- that reproduce the bug +- using hyphens as bullet points + +Describe how what happens differs from what you expected. + +libqmatrixclient-based clients either have a log file or dump log to the standard output. +If you can identify any log snippets relevant to your issue, please include +those here (please be careful to remove any personal or private data): + +### Version information + +<!-- IMPORTANT: please answer the following questions, to help us narrow down the problem --> + +- **The client application**: <!-- the problem might be not with the library but with the client --> +- **libqmatrixclient version if you know it**: <!-- try to find it basing on the client version --> +- **Qt version**: <!-- for Linux systems, it's usually installed system-wide; for other OSes, +as well as Flatpak/AppImage/etc. containerised environments, it's a version used in the container. --> +- **Install method**: <!-- package manager/Flatpak/archive downloaded (from which site?) --> +- **Platform**: <!-- Operating system and anything about your platform you think can be relevant --> diff --git a/connection.cpp b/connection.cpp index 1c65d66f..ad893168 100644 --- a/connection.cpp +++ b/connection.cpp @@ -636,7 +636,7 @@ void Connection::setHomeserver(const QUrl& url) emit homeserverChanged(homeserver()); } -static constexpr int CACHE_VERSION_MAJOR = 3; +static constexpr int CACHE_VERSION_MAJOR = 4; static constexpr int CACHE_VERSION_MINOR = 0; void Connection::saveState(const QUrl &toFile) const @@ -666,12 +666,13 @@ void Connection::saveState(const QUrl &toFile) const { QJsonObject rooms; QJsonObject inviteRooms; - for (auto i : roomMap()) // Pass on rooms in Leave state + for (const auto* i : roomMap()) // Pass on rooms in Leave state { if (i->joinState() == JoinState::Invite) inviteRooms.insert(i->id(), i->toJson()); else rooms.insert(i->id(), i->toJson()); + QCoreApplication::instance()->processEvents(); } if (!rooms.isEmpty()) @@ -689,7 +690,7 @@ void Connection::saveState(const QUrl &toFile) const versionObj.insert("minor", CACHE_VERSION_MINOR); rootObj.insert("cache_version", versionObj); - QByteArray data = QJsonDocument(rootObj).toJson(QJsonDocument::Compact); + QByteArray data = QJsonDocument(rootObj).toBinaryData(); qCDebug(MAIN) << "Writing state to file" << outfile.fileName(); outfile.write(data.data(), data.size()); @@ -713,7 +714,7 @@ void Connection::loadState(const QUrl &fromFile) file.open(QFile::ReadOnly); QByteArray data = file.readAll(); - auto jsonDoc = QJsonDocument::fromJson(data); + auto jsonDoc = QJsonDocument::fromBinaryData(data); auto actualCacheVersionMajor = jsonDoc.object() .value("cache_version").toObject() |