mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-04 09:05:34 -05:00
replaced QString output of uniqueIdentifier() in feedItem classes by a std::string because QString caused random crashes
This commit is contained in:
parent
da6e7f9e9b
commit
11c520d280
@ -442,6 +442,7 @@ bool RttPeerInfo::initialisePeerInfo(const RsPeerId& id)
|
|||||||
mCurrentPingTS = 0;
|
mCurrentPingTS = 0;
|
||||||
mCurrentPingCounter = 0;
|
mCurrentPingCounter = 0;
|
||||||
mCurrentPongRecvd = true;
|
mCurrentPongRecvd = true;
|
||||||
|
mCurrentMeanOffset = 0;
|
||||||
|
|
||||||
mSentPings = 0;
|
mSentPings = 0;
|
||||||
mLostPongs = 0;
|
mLostPongs = 0;
|
||||||
|
@ -34,6 +34,8 @@ class p3ServiceControl;
|
|||||||
class RttPeerInfo
|
class RttPeerInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
RttPeerInfo()
|
||||||
|
: mCurrentPingTS(0.0),mCurrentPingCounter(0.0),mCurrentPongRecvd(false),mCurrentMeanOffset(0.0),mLostPongs(0),mSentPings(0){}
|
||||||
|
|
||||||
bool initialisePeerInfo(const RsPeerId& id);
|
bool initialisePeerInfo(const RsPeerId& id);
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
const RsPostedPost &getPost() const;
|
const RsPostedPost &getPost() const;
|
||||||
RsPostedPost &post();
|
RsPostedPost &post();
|
||||||
|
|
||||||
QString uniqueIdentifier() const override { return "PostedItem " + QString::fromStdString(mMessageId.toStdString()); }
|
std::string uniqueIdentifier() const override { return "PostedItem " + mMessageId.toStdString(); }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
@ -476,10 +476,10 @@ void RSFeedWidget::withAll(RSFeedWidgetCallbackFunction callback, void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedItem *RSFeedWidget::findFeedItem(const QString& identifier)
|
FeedItem *RSFeedWidget::findFeedItem(const std::string& identifier)
|
||||||
{
|
{
|
||||||
QTreeWidgetItemIterator it(ui->treeWidget);
|
QTreeWidgetItemIterator it(ui->treeWidget);
|
||||||
QTreeWidgetItem *treeItem;
|
QTreeWidgetItem *treeItem=NULL;
|
||||||
|
|
||||||
// this search could probably be automatised by giving the tree items the identifier as data for some specific role, then calling QTreeWidget::findItems()
|
// this search could probably be automatised by giving the tree items the identifier as data for some specific role, then calling QTreeWidget::findItems()
|
||||||
#warning TODO
|
#warning TODO
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
bool scrollTo(FeedItem *feedItem, bool focus);
|
bool scrollTo(FeedItem *feedItem, bool focus);
|
||||||
|
|
||||||
void withAll(RSFeedWidgetCallbackFunction callback, void *data);
|
void withAll(RSFeedWidgetCallbackFunction callback, void *data);
|
||||||
FeedItem *findFeedItem(const QString &identifier);
|
FeedItem *findFeedItem(const std::string &identifier);
|
||||||
|
|
||||||
void selectedFeedItems(QList<FeedItem*> &feedItems);
|
void selectedFeedItems(QList<FeedItem*> &feedItems);
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const override { return "ChatMsgItem " + QString::fromStdString(mPeerId.toStdString()) ;}
|
virtual std::string uniqueIdentifier() const override { return "ChatMsgItem " + mPeerId.toStdString(); }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool /*open*/) {}
|
virtual void doExpand(bool /*open*/) {}
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
* \return returns a string that is unique to this specific item. The string will be used to search for an existing item that
|
* \return returns a string that is unique to this specific item. The string will be used to search for an existing item that
|
||||||
* would contain the same information. It should therefore sumarise the data represented by the item.
|
* would contain the same information. It should therefore sumarise the data represented by the item.
|
||||||
*/
|
*/
|
||||||
virtual QString uniqueIdentifier() const =0;
|
virtual std::string uniqueIdentifier() const =0;
|
||||||
protected:
|
protected:
|
||||||
virtual void doExpand(bool open) = 0;
|
virtual void doExpand(bool open) = 0;
|
||||||
virtual void expandFill(bool /*first*/) {}
|
virtual void expandFill(bool /*first*/) {}
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
bool setGroup(const RsGxsChannelGroup &group);
|
bool setGroup(const RsGxsChannelGroup &group);
|
||||||
|
|
||||||
QString uniqueIdentifier() const override { return "GxsChannelGroupItem " + QString::fromStdString(mGroup.mMeta.mGroupId.toStdString()) ; }
|
std::string uniqueIdentifier() const override { return "GxsChannelGroupItem " + mGroup.mMeta.mGroupId.toStdString() ; }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
@ -53,7 +53,7 @@ public:
|
|||||||
//GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost &post, bool isHome, bool autoUpdate);
|
//GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost &post, bool isHome, bool autoUpdate);
|
||||||
virtual ~GxsChannelPostItem();
|
virtual ~GxsChannelPostItem();
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const override { "GxsChannelPostItem " + QString::fromStdString(mPost.mMeta.mMsgId.toStdString()) ; }
|
virtual std::string uniqueIdentifier() const override { "GxsChannelPostItem " + mPost.mMeta.mMsgId.toStdString() ; }
|
||||||
|
|
||||||
bool setGroup(const RsGxsChannelGroup &group, bool doFill = true);
|
bool setGroup(const RsGxsChannelGroup &group, bool doFill = true);
|
||||||
bool setPost(const RsGxsChannelPost &post, bool doFill = true);
|
bool setPost(const RsGxsChannelPost &post, bool doFill = true);
|
||||||
|
@ -167,9 +167,9 @@ void GxsCircleItem::setup()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GxsCircleItem::uniqueIdentifier() const
|
std::string GxsCircleItem::uniqueIdentifier() const
|
||||||
{
|
{
|
||||||
return "GxsCircle " + QString::fromStdString(mCircleId.toStdString()) + " " + QString::fromStdString(mGxsId.toStdString()) + " " + QString::number(mType);
|
return "GxsCircle " + mCircleId.toStdString() + " " + mGxsId.toStdString() + " " + QString::number(mType).toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsCircleItem::removeItem()
|
void GxsCircleItem::removeItem()
|
||||||
|
@ -52,7 +52,7 @@ public:
|
|||||||
GxsCircleItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsCircleId &circleId, const RsGxsId &gxsId, const uint32_t type);
|
GxsCircleItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsCircleId &circleId, const RsGxsId &gxsId, const uint32_t type);
|
||||||
virtual ~GxsCircleItem();
|
virtual ~GxsCircleItem();
|
||||||
|
|
||||||
QString uniqueIdentifier() const override;
|
std::string uniqueIdentifier() const override;
|
||||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
bool setGroup(const RsGxsForumGroup &group);
|
bool setGroup(const RsGxsForumGroup &group);
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const override { return "GxsForumGroupItem " + QString::fromStdString(mGroup.mMeta.mGroupId.toStdString()) ; }
|
virtual std::string uniqueIdentifier() const override { return "GxsForumGroupItem " + mGroup.mMeta.mGroupId.toStdString() ; }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
bool setGroup(const RsGxsForumGroup &group, bool doFill = true);
|
bool setGroup(const RsGxsForumGroup &group, bool doFill = true);
|
||||||
bool setMessage(const RsGxsForumMsg &msg, bool doFill = true);
|
bool setMessage(const RsGxsForumMsg &msg, bool doFill = true);
|
||||||
|
|
||||||
QString uniqueIdentifier() const override { return "GxsForumMsgItem " + QString::fromStdString(mMessage.mMeta.mMsgId.toStdString()) ; }
|
std::string uniqueIdentifier() const override { return "GxsForumMsgItem " + mMessage.mMeta.mMsgId.toStdString() ; }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
@ -38,7 +38,7 @@ public:
|
|||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const override { return "MsgItem " + QString::fromStdString(mMsgId) ; }
|
virtual std::string uniqueIdentifier() const override { return "MsgItem " + mMsgId ; }
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void doExpand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
@ -67,9 +67,9 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId,
|
|||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PeerItem::uniqueIdentifier() const
|
std::string PeerItem::uniqueIdentifier() const
|
||||||
{
|
{
|
||||||
return "PeerItem " + QString::fromStdString(mPeerId.toStdString()) + " " + QString::number(mType) ;
|
return "PeerItem " + mPeerId.toStdString() + " " + QString::number(mType).toStdString() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerItem::updateItemStatic()
|
void PeerItem::updateItemStatic()
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const;
|
std::string uniqueIdentifier() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
bool setGroup(const RsPostedGroup &group);
|
bool setGroup(const RsPostedGroup &group);
|
||||||
|
|
||||||
virtual QString uniqueIdentifier() const override { return "PostedGroupItem " + QString::fromStdString(mGroup.mMeta.mGroupId.toStdString()) ; }
|
virtual std::string uniqueIdentifier() const override { return "PostedGroupItem " + mGroup.mMeta.mGroupId.toStdString() ; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
|
@ -78,10 +78,9 @@ void SecurityIpItem::setup()
|
|||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SecurityIpItem::uniqueIdentifier() const
|
std::string SecurityIpItem::uniqueIdentifier() const
|
||||||
{
|
{
|
||||||
return "SecurityItem " + QString::number(mType) + " " + QString::fromStdString(mSslId.toStdString())
|
return "SecurityItem " + QString::number(mType).toStdString() + " " + mSslId.toStdString() + " " + mIpAddr + " " + mIpAddrReported ;
|
||||||
+ " " + QString::fromStdString(mIpAddr) + " " + QString::fromStdString(mIpAddrReported) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityIpItem::updateItemStatic()
|
void SecurityIpItem::updateItemStatic()
|
||||||
|
@ -43,7 +43,7 @@ public:
|
|||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
QString uniqueIdentifier() const override;
|
std::string uniqueIdentifier() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
|
@ -81,9 +81,9 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &g
|
|||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SecurityItem::uniqueIdentifier() const
|
std::string SecurityItem::uniqueIdentifier() const
|
||||||
{
|
{
|
||||||
return "SecurityItem " + QString::number(mType) + " " + QString::fromStdString(mSslId.toStdString());
|
return "SecurityItem " + QString::number(mType).toStdString() + " " + mSslId.toStdString();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityItem::updateItemStatic()
|
void SecurityItem::updateItemStatic()
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
QString uniqueIdentifier() const override;
|
std::string uniqueIdentifier() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user