mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Merge pull request #1878 from csoler/v0.6-ImprovedGUI_4
[WIP] fixing some GUI bugs
This commit is contained in:
commit
07e71c3ea6
@ -543,10 +543,16 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process(
|
||||
break;
|
||||
case RsGenericSerializer::DESERIALIZE:
|
||||
{
|
||||
// In case first,second is not properly initialized, we set them to nullptr,0
|
||||
first = nullptr;
|
||||
second = 0;
|
||||
|
||||
uint32_t serialSize = 0;
|
||||
RS_SERIAL_PROCESS(serialSize);
|
||||
|
||||
if(!ctx.mOk) break;
|
||||
ctx.mOk = serialSize <= MAX_SERIALIZED_CHUNK_SIZE;
|
||||
ctx.mOk = (serialSize <= MAX_SERIALIZED_CHUNK_SIZE);
|
||||
|
||||
if(!ctx.mOk)
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__
|
||||
@ -565,25 +571,23 @@ void RsTypeSerializer::RawMemoryWrapper::serial_process(
|
||||
break;
|
||||
}
|
||||
|
||||
ctx.mOk = ctx.mSize >= ctx.mOffset + serialSize;
|
||||
ctx.mOk = (ctx.mSize >= ctx.mOffset + serialSize);
|
||||
|
||||
if(!ctx.mOk)
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__ << std::errc::no_buffer_space
|
||||
<< std::endl;
|
||||
RsErr() << __PRETTY_FUNCTION__ << std::errc::no_buffer_space << std::endl;
|
||||
print_stacktrace();
|
||||
|
||||
clear();
|
||||
break;
|
||||
}
|
||||
|
||||
if(serialSize != second)
|
||||
{
|
||||
first = reinterpret_cast<uint8_t*>(realloc(first, serialSize));
|
||||
first = reinterpret_cast<uint8_t*>(malloc(serialSize));
|
||||
second = serialSize;
|
||||
}
|
||||
|
||||
memcpy(first, ctx.mData + ctx.mOffset, second);
|
||||
ctx.mOffset += second;
|
||||
memcpy(first, ctx.mData + ctx.mOffset, serialSize);
|
||||
ctx.mOffset += serialSize;
|
||||
|
||||
break;
|
||||
}
|
||||
case RsGenericSerializer::PRINT: break;
|
||||
|
@ -166,7 +166,13 @@ class RsTurtleRegExpSearchRequestItem: public RsTurtleFileSearchRequestItem
|
||||
class RsTurtleGenericSearchRequestItem: public RsTurtleSearchRequestItem
|
||||
{
|
||||
public:
|
||||
RsTurtleGenericSearchRequestItem() : RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST) {}
|
||||
RsTurtleGenericSearchRequestItem()
|
||||
: RsTurtleSearchRequestItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_REQUEST),
|
||||
service_id(0),
|
||||
search_data_len(0),
|
||||
request_type(0),
|
||||
search_data(nullptr)
|
||||
{}
|
||||
virtual ~RsTurtleGenericSearchRequestItem() { clear(); }
|
||||
|
||||
uint16_t service_id ; // service to search
|
||||
@ -221,7 +227,11 @@ class RsTurtleFTSearchResultItem: public RsTurtleSearchResultItem
|
||||
class RsTurtleGenericSearchResultItem: public RsTurtleSearchResultItem
|
||||
{
|
||||
public:
|
||||
RsTurtleGenericSearchResultItem() : RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT){}
|
||||
RsTurtleGenericSearchResultItem()
|
||||
: RsTurtleSearchResultItem(RS_TURTLE_SUBTYPE_GENERIC_SEARCH_RESULT),
|
||||
result_data(nullptr),
|
||||
result_data_len(0)
|
||||
{}
|
||||
virtual ~RsTurtleGenericSearchResultItem() {}
|
||||
|
||||
uint32_t count() const { return result_data_len/50 ; } // This is a blind size estimate. We should probably use the actual size to limit search results.
|
||||
|
@ -42,13 +42,9 @@ std::ostream& operator<<(std::ostream& o, const QModelIndex& i);// defined elsew
|
||||
const QString RsGxsForumModel::FilterString("filtered");
|
||||
|
||||
RsGxsForumModel::RsGxsForumModel(QObject *parent)
|
||||
: QAbstractItemModel(parent)
|
||||
: QAbstractItemModel(parent), mUseChildTS(false),mFilteringEnabled(false),mTreeMode(TREE_MODE_TREE)
|
||||
{
|
||||
initEmptyHierarchy(mPosts);
|
||||
|
||||
mUseChildTS=false;
|
||||
mFilteringEnabled=false;
|
||||
mTreeMode = TREE_MODE_TREE;
|
||||
}
|
||||
|
||||
void RsGxsForumModel::preMods()
|
||||
|
@ -57,6 +57,7 @@ RSPermissionMatrixWidget::RSPermissionMatrixWidget(QWidget *parent)
|
||||
:QFrame(parent)
|
||||
{
|
||||
_painter = new QPainter();
|
||||
_current_service_id = 0;
|
||||
|
||||
setMouseTracking(true) ;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user