Fixed some more utf8 handling in the GUI.

Optimized creation of the RetroShare links for forum and channel messages.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4194 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-05-08 23:11:27 +00:00
parent dd457e15c7
commit 0619463948
16 changed files with 73 additions and 48 deletions

View file

@ -248,35 +248,60 @@ bool RetroShareLink::createPerson(const QString& name, const QString& hash)
return valid();
}
bool RetroShareLink::createForum(const QString& name, const QString& id, const QString& msgId)
bool RetroShareLink::createForum(const std::string& id, const std::string& msgId)
{
clear();
clear();
_name = name;
_hash = id;
_msgId = msgId;
if (!id.empty()) {
_hash = QString::fromStdString(id);
_msgId = QString::fromStdString(msgId);
_type = TYPE_FORUM;
_type = TYPE_FORUM;
check();
if (msgId.empty()) {
ForumInfo fi;
if (rsForums->getForumInfo(id, fi)) {
_name = QString::fromStdWString(fi.forumName);
}
} else {
ForumMsgInfo mi;
if (rsForums->getForumMessage(id, msgId, mi)) {
_name = QString::fromStdWString(mi.title);
}
}
}
return valid();
check();
return valid();
}
bool RetroShareLink::createChannel(const QString& name, const QString& id, const QString& msgId)
bool RetroShareLink::createChannel(const std::string& id, const std::string& msgId)
{
clear();
clear();
_name = name;
_size = 0;
_hash = id;
_msgId = msgId;
if (!id.empty()) {
_hash = QString::fromStdString(id);
_msgId = QString::fromStdString(msgId);
_type = TYPE_CHANNEL;
_type = TYPE_CHANNEL;
check();
if (msgId.empty()) {
ChannelInfo ci;
if (rsChannels->getChannelInfo(id, ci)) {
_name = QString::fromStdWString(ci.channelName);
}
} else {
ChannelMsgInfo mi;
if (rsChannels->getChannelMessage(id, msgId, mi)) {
_name = QString::fromStdWString(mi.subject);
}
}
}
return valid();
check();
return valid();
}
bool RetroShareLink::createSearch(const QString& keywords)