mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-18 11:29:31 -04:00
Optimized fill of feed items by moving the fill of the hidden area to the first expand of the frame.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8514 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4cb081f4ff
commit
846d5f4f50
27 changed files with 152 additions and 41 deletions
|
@ -98,7 +98,7 @@ void FeedReaderFeedItem::toggle()
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FeedReaderFeedItem::expand(bool open)
|
void FeedReaderFeedItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->lockLayout(this, true);
|
mParent->lockLayout(this, true);
|
||||||
|
|
|
@ -42,8 +42,9 @@ public:
|
||||||
FeedReaderFeedItem(RsFeedReader *feedReader, FeedReaderNotify *notify, FeedHolder *parent, const FeedInfo &feedInfo, const FeedMsgInfo &msgInfo);
|
FeedReaderFeedItem(RsFeedReader *feedReader, FeedReaderNotify *notify, FeedHolder *parent, const FeedInfo &feedInfo, const FeedMsgInfo &msgInfo);
|
||||||
~FeedReaderFeedItem();
|
~FeedReaderFeedItem();
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
|
|
|
@ -51,8 +51,9 @@ public:
|
||||||
const RsPostedPost &getPost() const;
|
const RsPostedPost &getPost() const;
|
||||||
RsPostedPost &post();
|
RsPostedPost &post();
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool /*open*/) {}
|
virtual void doExpand(bool /*open*/) {}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void loadComments();
|
void loadComments();
|
||||||
|
|
|
@ -38,8 +38,9 @@ public:
|
||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool /*open*/) {}
|
virtual void doExpand(bool /*open*/) {}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
|
|
|
@ -24,9 +24,23 @@
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
FeedItem::FeedItem(QWidget *parent) : QWidget(parent)
|
FeedItem::FeedItem(QWidget *parent) : QWidget(parent)
|
||||||
{
|
{
|
||||||
|
mWasExpanded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
FeedItem::~FeedItem()
|
FeedItem::~FeedItem()
|
||||||
{
|
{
|
||||||
emit feedItemDestroyed(this);
|
emit feedItemDestroyed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FeedItem::expand(bool open)
|
||||||
|
{
|
||||||
|
if (open) {
|
||||||
|
expandFill(!mWasExpanded);
|
||||||
|
}
|
||||||
|
|
||||||
|
doExpand(open);
|
||||||
|
|
||||||
|
if (open) {
|
||||||
|
mWasExpanded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -34,11 +34,19 @@ public:
|
||||||
/** Default Destructor */
|
/** Default Destructor */
|
||||||
virtual ~FeedItem();
|
virtual ~FeedItem();
|
||||||
|
|
||||||
virtual void expand(bool open) = 0;
|
bool wasExpanded() { return mWasExpanded; }
|
||||||
|
void expand(bool open);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void doExpand(bool open) = 0;
|
||||||
|
virtual void expandFill(bool /*first*/) {}
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void sizeChanged(FeedItem *feedItem);
|
void sizeChanged(FeedItem *feedItem);
|
||||||
void feedItemDestroyed(FeedItem *feedItem);
|
void feedItemDestroyed(FeedItem *feedItem);
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool mWasExpanded;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -166,7 +166,7 @@ void GxsChannelGroupItem::toggle()
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelGroupItem::expand(bool open)
|
void GxsChannelGroupItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mFeedHolder)
|
if (mFeedHolder)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,10 +43,10 @@ public:
|
||||||
|
|
||||||
bool setGroup(const RsGxsChannelGroup &group);
|
bool setGroup(const RsGxsChannelGroup &group);
|
||||||
|
|
||||||
/* FeedItem */
|
|
||||||
virtual void expand(bool open);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* FeedItem */
|
||||||
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
/* GxsGroupFeedItem */
|
/* GxsGroupFeedItem */
|
||||||
virtual QString groupName();
|
virtual QString groupName();
|
||||||
virtual void loadGroup(const uint32_t &token);
|
virtual void loadGroup(const uint32_t &token);
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
|
#include "util/stringutil.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -311,7 +312,9 @@ void GxsChannelPostItem::fill()
|
||||||
{
|
{
|
||||||
/* subject */
|
/* subject */
|
||||||
ui->titleLabel->setText(QString::fromUtf8(mPost.mMeta.mMsgName.c_str()));
|
ui->titleLabel->setText(QString::fromUtf8(mPost.mMeta.mMsgName.c_str()));
|
||||||
ui->subjectLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
|
||||||
|
// fill first 4 lines of message
|
||||||
|
ui->subjectLabel->setText(RsHtml().formatText(NULL, RsStringUtil::CopyLines(QString::fromUtf8(mPost.mMsg.c_str()), 4), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
|
||||||
//QString score = QString::number(post.mTopScore);
|
//QString score = QString::number(post.mTopScore);
|
||||||
// scoreLabel->setText(score);
|
// scoreLabel->setText(score);
|
||||||
|
@ -376,8 +379,10 @@ void GxsChannelPostItem::fill()
|
||||||
voteDownButton->setEnabled(false);
|
voteDownButton->setEnabled(false);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
|
||||||
ui->msgFrame->setVisible(!mPost.mMsg.empty());
|
ui->msgFrame->setVisible(!mPost.mMsg.empty());
|
||||||
|
if (wasExpanded() || ui->expandFrame->isVisible()) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
|
||||||
ui->datetimelabel->setText(DateTime::formatLongDateTime(mPost.mMeta.mPublishTs));
|
ui->datetimelabel->setText(DateTime::formatLongDateTime(mPost.mMeta.mPublishTs));
|
||||||
|
|
||||||
|
@ -427,6 +432,11 @@ void GxsChannelPostItem::fill()
|
||||||
mInFill = false;
|
mInFill = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsChannelPostItem::fillExpandFrame()
|
||||||
|
{
|
||||||
|
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mPost.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
}
|
||||||
|
|
||||||
QString GxsChannelPostItem::messageName()
|
QString GxsChannelPostItem::messageName()
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(mPost.mMeta.mMsgName.c_str());
|
return QString::fromUtf8(mPost.mMeta.mMsgName.c_str());
|
||||||
|
@ -552,7 +562,7 @@ void GxsChannelPostItem::updateItem()
|
||||||
//downloadButton->setEnabled(true);
|
//downloadButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsChannelPostItem::expand(bool open)
|
void GxsChannelPostItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mFeedHolder)
|
if (mFeedHolder)
|
||||||
{
|
{
|
||||||
|
@ -582,6 +592,15 @@ void GxsChannelPostItem::expand(bool open)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsChannelPostItem::expandFill(bool first)
|
||||||
|
{
|
||||||
|
GxsFeedItem::expandFill(first);
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GxsChannelPostItem::toggle()
|
void GxsChannelPostItem::toggle()
|
||||||
{
|
{
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
|
|
|
@ -55,12 +55,13 @@ public:
|
||||||
QString getMsgLabel();
|
QString getMsgLabel();
|
||||||
const std::list<SubFileItem *> &getFileItems() {return mFileItems; }
|
const std::list<SubFileItem *> &getFileItems() {return mFileItems; }
|
||||||
|
|
||||||
/* FeedItem */
|
|
||||||
virtual void expand(bool open);
|
|
||||||
|
|
||||||
bool isUnread() const ;
|
bool isUnread() const ;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* FeedItem */
|
||||||
|
virtual void doExpand(bool open);
|
||||||
|
virtual void expandFill(bool first);
|
||||||
|
|
||||||
/* GxsGroupFeedItem */
|
/* GxsGroupFeedItem */
|
||||||
virtual QString groupName();
|
virtual QString groupName();
|
||||||
virtual void loadGroup(const uint32_t &token);
|
virtual void loadGroup(const uint32_t &token);
|
||||||
|
@ -92,6 +93,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
void setup();
|
void setup();
|
||||||
void fill();
|
void fill();
|
||||||
|
void fillExpandFrame();
|
||||||
void setReadStatus(bool isNew, bool isUnread);
|
void setReadStatus(bool isNew, bool isUnread);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -166,7 +166,7 @@ void GxsForumGroupItem::toggle()
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumGroupItem::expand(bool open)
|
void GxsForumGroupItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mFeedHolder)
|
if (mFeedHolder)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,10 +43,10 @@ public:
|
||||||
|
|
||||||
bool setGroup(const RsGxsForumGroup &group);
|
bool setGroup(const RsGxsForumGroup &group);
|
||||||
|
|
||||||
/* FeedItem */
|
|
||||||
virtual void expand(bool open);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* FeedItem */
|
||||||
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
/* GxsGroupFeedItem */
|
/* GxsGroupFeedItem */
|
||||||
virtual QString groupName();
|
virtual QString groupName();
|
||||||
virtual void loadGroup(const uint32_t &token);
|
virtual void loadGroup(const uint32_t &token);
|
||||||
|
|
|
@ -313,7 +313,9 @@ void GxsForumMsgItem::fill()
|
||||||
RetroShareLink msgLink;
|
RetroShareLink msgLink;
|
||||||
msgLink.createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
|
msgLink.createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
|
||||||
ui->subLabel->setText(msgLink.toHtml());
|
ui->subLabel->setText(msgLink.toHtml());
|
||||||
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
if (wasExpanded() || ui->expandFrame->isVisible()) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
|
||||||
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
|
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
|
||||||
|
|
||||||
|
@ -355,12 +357,17 @@ void GxsForumMsgItem::fill()
|
||||||
mInFill = false;
|
mInFill = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumMsgItem::fillExpandFrame()
|
||||||
|
{
|
||||||
|
ui->msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
}
|
||||||
|
|
||||||
QString GxsForumMsgItem::messageName()
|
QString GxsForumMsgItem::messageName()
|
||||||
{
|
{
|
||||||
return QString::fromUtf8(mMessage.mMeta.mMsgName.c_str());
|
return QString::fromUtf8(mMessage.mMeta.mMsgName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumMsgItem::expand(bool open)
|
void GxsForumMsgItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mFeedHolder)
|
if (mFeedHolder)
|
||||||
{
|
{
|
||||||
|
@ -395,6 +402,15 @@ void GxsForumMsgItem::expand(bool open)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsForumMsgItem::expandFill(bool first)
|
||||||
|
{
|
||||||
|
GxsFeedItem::expandFill(first);
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GxsForumMsgItem::toggle()
|
void GxsForumMsgItem::toggle()
|
||||||
{
|
{
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
|
|
|
@ -46,10 +46,11 @@ 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);
|
||||||
|
|
||||||
/* FeedItem */
|
|
||||||
virtual void expand(bool open);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* FeedItem */
|
||||||
|
virtual void doExpand(bool open);
|
||||||
|
virtual void expandFill(bool first);
|
||||||
|
|
||||||
/* load message data */
|
/* load message data */
|
||||||
void requestParentMessage(const RsGxsMessageId &msgId);
|
void requestParentMessage(const RsGxsMessageId &msgId);
|
||||||
virtual void loadParentMessage(const uint32_t &token);
|
virtual void loadParentMessage(const uint32_t &token);
|
||||||
|
@ -78,6 +79,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
void setup();
|
void setup();
|
||||||
void fill();
|
void fill();
|
||||||
|
void fillExpandFrame();
|
||||||
void setReadStatus(bool isNew, bool isUnread);
|
void setReadStatus(bool isNew, bool isUnread);
|
||||||
void setAsRead();
|
void setAsRead();
|
||||||
bool isTop();
|
bool isTop();
|
||||||
|
|
|
@ -69,7 +69,6 @@ MsgItem::MsgItem(FeedHolder *parent, uint32_t feedId, const std::string &msgId,
|
||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MsgItem::updateItemStatic()
|
void MsgItem::updateItemStatic()
|
||||||
{
|
{
|
||||||
/* fill in */
|
/* fill in */
|
||||||
|
@ -148,8 +147,11 @@ void MsgItem::updateItemStatic()
|
||||||
|
|
||||||
titleLabel->setText(title);
|
titleLabel->setText(title);
|
||||||
subjectLabel->setText(QString::fromUtf8(mi.title.c_str()));
|
subjectLabel->setText(QString::fromUtf8(mi.title.c_str()));
|
||||||
|
mMsg = QString::fromUtf8(mi.msg.c_str());
|
||||||
|
|
||||||
msgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mi.msg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
if (wasExpanded() || expandFrame->isVisible()) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
|
||||||
std::list<FileInfo>::iterator it;
|
std::list<FileInfo>::iterator it;
|
||||||
for(it = mi.files.begin(); it != mi.files.end(); ++it)
|
for(it = mi.files.begin(); it != mi.files.end(); ++it)
|
||||||
|
@ -175,6 +177,10 @@ void MsgItem::updateItemStatic()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MsgItem::fillExpandFrame()
|
||||||
|
{
|
||||||
|
msgLabel->setText(RsHtml().formatText(NULL, mMsg, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
|
||||||
|
}
|
||||||
|
|
||||||
void MsgItem::updateItem()
|
void MsgItem::updateItem()
|
||||||
{
|
{
|
||||||
|
@ -207,7 +213,7 @@ void MsgItem::toggle()
|
||||||
expand(expandFrame->isHidden());
|
expand(expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MsgItem::expand(bool open)
|
void MsgItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->lockLayout(this, true);
|
mParent->lockLayout(this, true);
|
||||||
|
@ -237,6 +243,15 @@ void MsgItem::expand(bool open)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MsgItem::expandFill(bool first)
|
||||||
|
{
|
||||||
|
FeedItem::expandFill(first);
|
||||||
|
|
||||||
|
if (first) {
|
||||||
|
fillExpandFrame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void MsgItem::removeItem()
|
void MsgItem::removeItem()
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_ITEM
|
#ifdef DEBUG_ITEM
|
||||||
|
|
|
@ -39,8 +39,13 @@ public:
|
||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
virtual void expandFill(bool first);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void fillExpandFrame();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
|
@ -61,6 +66,7 @@ private:
|
||||||
|
|
||||||
ChatId mPeerId;
|
ChatId mPeerId;
|
||||||
std::string mMsgId;
|
std::string mMsgId;
|
||||||
|
QString mMsg;
|
||||||
|
|
||||||
bool mIsHome;
|
bool mIsHome;
|
||||||
bool mCloseOnRead;
|
bool mCloseOnRead;
|
||||||
|
|
|
@ -201,7 +201,7 @@ void PeerItem::toggle()
|
||||||
expand(expandFrame->isHidden());
|
expand(expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerItem::expand(bool open)
|
void PeerItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->lockLayout(this, true);
|
mParent->lockLayout(this, true);
|
||||||
|
|
|
@ -43,8 +43,9 @@ public:
|
||||||
|
|
||||||
void updateItemStatic();
|
void updateItemStatic();
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
|
|
|
@ -171,7 +171,7 @@ void PostedGroupItem::toggle()
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostedGroupItem::expand(bool open)
|
void PostedGroupItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mFeedHolder)
|
if (mFeedHolder)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,10 +43,10 @@ public:
|
||||||
|
|
||||||
bool setGroup(const RsPostedGroup &group);
|
bool setGroup(const RsPostedGroup &group);
|
||||||
|
|
||||||
/* FeedItem */
|
|
||||||
virtual void expand(bool open);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
/* FeedItem */
|
||||||
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
/* GxsGroupFeedItem */
|
/* GxsGroupFeedItem */
|
||||||
virtual QString groupName();
|
virtual QString groupName();
|
||||||
virtual void loadGroup(const uint32_t &token);
|
virtual void loadGroup(const uint32_t &token);
|
||||||
|
|
|
@ -195,7 +195,7 @@ void SecurityIpItem::toggle()
|
||||||
expand(ui->expandFrame->isHidden());
|
expand(ui->expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityIpItem::expand(bool open)
|
void SecurityIpItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->lockLayout(this, true);
|
mParent->lockLayout(this, true);
|
||||||
|
|
|
@ -46,8 +46,9 @@ public:
|
||||||
|
|
||||||
bool isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type);
|
bool isSame(const std::string& ipAddr, const std::string& ipAddrReported, uint32_t type);
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setup();
|
void setup();
|
||||||
|
|
|
@ -286,7 +286,7 @@ void SecurityItem::toggle()
|
||||||
expand(expandFrame->isHidden());
|
expand(expandFrame->isHidden());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityItem::expand(bool open)
|
void SecurityItem::doExpand(bool open)
|
||||||
{
|
{
|
||||||
if (mParent) {
|
if (mParent) {
|
||||||
mParent->lockLayout(this, true);
|
mParent->lockLayout(this, true);
|
||||||
|
|
|
@ -45,8 +45,9 @@ public:
|
||||||
|
|
||||||
bool isSame(const RsPeerId &sslId, uint32_t type);
|
bool isSame(const RsPeerId &sslId, uint32_t type);
|
||||||
|
|
||||||
|
protected:
|
||||||
/* FeedItem */
|
/* FeedItem */
|
||||||
virtual void expand(bool open);
|
virtual void doExpand(bool open);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
/* default stuff */
|
/* default stuff */
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
//#define ENABLE_GENERATE
|
#define ENABLE_GENERATE
|
||||||
|
|
||||||
#define CREATEMSG_CHANNELINFO 0x002
|
#define CREATEMSG_CHANNELINFO 0x002
|
||||||
|
|
||||||
|
|
|
@ -317,3 +317,23 @@ string_is_hex(const QString &str)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace RsStringUtil
|
||||||
|
{
|
||||||
|
|
||||||
|
QString CopyLines(const QString &s, quint16 lines)
|
||||||
|
{
|
||||||
|
int index = -1;
|
||||||
|
for (int i = 0; i < lines; ++i) {
|
||||||
|
index = s.indexOf("\n", index + 1);
|
||||||
|
if (index == -1) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index != -1) {
|
||||||
|
return s.left(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -84,5 +84,8 @@ QString string_format_arguments(const QStringList &args);
|
||||||
* otherwise. */
|
* otherwise. */
|
||||||
bool string_is_hex(const QString &str);
|
bool string_is_hex(const QString &str);
|
||||||
|
|
||||||
|
namespace RsStringUtil
|
||||||
|
{
|
||||||
|
QString CopyLines(const QString &s, quint16 lines);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue