Fixed html title bug in the forum message when answering to a message in ForumMsgItem.

Fixed enabled sate of the new message buton in ForumsDialog.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4312 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-06-20 21:19:48 +00:00
parent dd17fcdcda
commit 886b366d5c
2 changed files with 35 additions and 25 deletions

View File

@ -759,7 +759,6 @@ void ForumsDialog::fillThreadFinished()
insertPost ();
CalculateIconsAndFonts();
ui.newmessageButton->setEnabled (IS_FORUM_SUBSCRIBED(subscribeFlags));
ui.newthreadButton->setEnabled (IS_FORUM_SUBSCRIBED(subscribeFlags));
}

View File

@ -351,7 +351,6 @@ void ForumMsgItem::sendMsg()
return;
}
QString name = prevSubLabel->text();
QString desc = textEdit->toHtml();
if(textEdit->toPlainText().isEmpty())
@ -362,6 +361,10 @@ void ForumMsgItem::sendMsg()
return; //Don't add a empty Message!!
}
ForumMsgInfo msg;
/* get message */
if (rsForums->getForumMessage(mForumId, mPostId, msg)) {
ForumMsgInfo msgInfo;
msgInfo.forumId = mForumId;
@ -369,7 +372,14 @@ void ForumMsgItem::sendMsg()
msgInfo.parentId = mPostId;
msgInfo.msgId = "";
msgInfo.title = name.toStdWString();
/* modify title */
QString text = QString::fromStdWString(msg.title);
if (text.startsWith("Re:", Qt::CaseInsensitive)) {
msgInfo.title = msg.title;
} else {
msgInfo.title = L"Re: " + msg.title;
}
msgInfo.msg = desc.toStdWString();
msgInfo.msgflags = 0;
@ -385,6 +395,7 @@ void ForumMsgItem::sendMsg()
textEdit->clear();
}
}
}
void ForumMsgItem::updateAvatar(const QString &peer_id)
{