diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-15 10:01:34 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-01-15 10:12:52 +0900 |
commit | 0910bf6c5bbc6c9250023796b2e641f19232c3cd (patch) | |
tree | d76fbd6cdac2691c3512282cda1fd68c0160ef34 | |
parent | 525be6dce815f88ed9cc97480bff461741665e8f (diff) | |
download | libquotient-0910bf6c5bbc6c9250023796b2e641f19232c3cd.tar.gz libquotient-0910bf6c5bbc6c9250023796b2e641f19232c3cd.zip |
One more fix, this time for MSVC 2015 only
Making a structure from an initializer list seems to be a problem for it if initializers are defined in the structure.
-rw-r--r-- | room.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -96,6 +96,12 @@ class Room::Private struct FileTransferPrivateInfo { +#if defined(_MSC_VER) && _MSC_VER < 1910 + FileTransferPrivateInfo() = default; + FileTransferPrivateInfo(BaseJob* j, QString fileName) + : job(j), localFileInfo(fileName) + { } +#endif QPointer<BaseJob> job = nullptr; QFileInfo localFileInfo { }; FileTransferInfo::Status status = FileTransferInfo::Started; @@ -466,10 +472,22 @@ FileTransferInfo Room::fileTransferInfo(const QString& id) const total = INT_MAX; } +#if defined(_MSC_VER) && _MSC_VER < 1910 + // A workaround for MSVC 2015 that fails with "error C2440: 'return': + // cannot convert from 'initializer list' to 'QMatrixClient::FileTransferInfo'" + FileTransferInfo fti; + fti.status = infoIt->status; + fti.progress = int(progress); + fti.total = int(total); + fti.localDir = QUrl::fromLocalFile(infoIt->localFileInfo.absolutePath()); + fti.localPath = QUrl::fromLocalFile(infoIt->localFileInfo.absoluteFilePath()); + return fti; +#else return { infoIt->status, int(progress), int(total), QUrl::fromLocalFile(infoIt->localFileInfo.absolutePath()), QUrl::fromLocalFile(infoIt->localFileInfo.absoluteFilePath()) }; +#endif } QList< User* > Room::usersTyping() const |