Use `pubsetbuf` only with `libstdc++`
This usage of the function seems only to work as intended with that standard lib. With `libc++` and the MSVC standard lib the call has no effect.
This commit is contained in:
parent
140d2e1782
commit
34e7fb123a
|
@ -301,8 +301,11 @@ bool EntryModel::setData(const QModelIndex &index, const QVariant &value, int ro
|
||||||
try {
|
try {
|
||||||
stringstream ss(stringstream::in | stringstream::out | stringstream::binary);
|
stringstream ss(stringstream::in | stringstream::out | stringstream::binary);
|
||||||
ss.exceptions(std::stringstream::failbit | std::stringstream::badbit);
|
ss.exceptions(std::stringstream::failbit | std::stringstream::badbit);
|
||||||
|
#if defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION)
|
||||||
ss.rdbuf()->pubsetbuf(array.data(), array.size());
|
ss.rdbuf()->pubsetbuf(array.data(), array.size());
|
||||||
|
#else
|
||||||
|
ss.write(array.data(), array.size());
|
||||||
|
#endif
|
||||||
Entry *const newEntry = Entry::parse(ss);
|
Entry *const newEntry = Entry::parse(ss);
|
||||||
const int row = entry->index();
|
const int row = entry->index();
|
||||||
beginRemoveRows(parentIndex, row, row);
|
beginRemoveRows(parentIndex, row, row);
|
||||||
|
|
Loading…
Reference in New Issue