diff --git a/retroshare-gui/src/gui/ChatLobbyWidget.cpp b/retroshare-gui/src/gui/ChatLobbyWidget.cpp index 622825b6b..7b5fad30b 100644 --- a/retroshare-gui/src/gui/ChatLobbyWidget.cpp +++ b/retroshare-gui/src/gui/ChatLobbyWidget.cpp @@ -328,7 +328,7 @@ void ChatLobbyWidget::updateDisplay() // now, do a nice display of lobbies - std::string vpid; + RsPeerId vpid; std::list::const_iterator lobbyIt; // remove not existing public lobbies @@ -575,7 +575,7 @@ static void subscribeLobby(QTreeWidgetItem *item) ChatLobbyId id = item->data(COLUMN_DATA, ROLE_ID).toULongLong(); if (rsMsgs->joinVisibleChatLobby(id)) { - std::string vpeer_id; + RsPeerId vpeer_id; if (rsMsgs->getVirtualPeerId(id, vpeer_id)) { ChatDialog::chatFriend(vpeer_id,true) ; } @@ -739,7 +739,7 @@ void ChatLobbyWidget::unsubscribeChatLobby(ChatLobbyId id) } // Unsubscribe the chat lobby - std::string vpeer_id; + RsPeerId vpeer_id; if (rsMsgs->getVirtualPeerId(id, vpeer_id)) ChatDialog::closeChat(vpeer_id); @@ -812,7 +812,7 @@ void ChatLobbyWidget::itemDoubleClicked(QTreeWidgetItem *item, int /*column*/) void ChatLobbyWidget::displayChatLobbyEvent(qulonglong lobby_id, int event_type, const QString& nickname, const QString& str) { - std::string vpid; + RsPeerId vpid; if (rsMsgs->getVirtualPeerId(lobby_id, vpid)) { if (ChatLobbyDialog *cld = dynamic_cast(ChatDialog::getExistingChat(vpid))) { cld->displayLobbyEvent(event_type, nickname, str); @@ -831,7 +831,7 @@ void ChatLobbyWidget::readChatLobbyInvites() rsMsgs->acceptLobbyInvite((*it).lobby_id); - std::string vpid; + RsPeerId vpid; if(rsMsgs->getVirtualPeerId((*it).lobby_id,vpid )) { ChatDialog::chatFriend(vpid,true); } else { diff --git a/retroshare-gui/src/gui/chat/ChatDialog.cpp b/retroshare-gui/src/gui/chat/ChatDialog.cpp index 779e1c5cc..4e9e89480 100644 --- a/retroshare-gui/src/gui/chat/ChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatDialog.cpp @@ -36,7 +36,7 @@ #include #include -static std::map chatDialogs; +static std::map chatDialogs; ChatDialog::ChatDialog(QWidget *parent, Qt::WindowFlags flags) : QWidget(parent, flags) @@ -46,7 +46,7 @@ ChatDialog::ChatDialog(QWidget *parent, Qt::WindowFlags flags) : ChatDialog::~ChatDialog() { - std::map::iterator it; + std::map::iterator it; if (chatDialogs.end() != (it = chatDialogs.find(getPeerId()))) { chatDialogs.erase(it); } @@ -76,7 +76,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) /*static*/ ChatDialog *ChatDialog::getExistingChat(const RsPeerId &peerId) { - std::map::iterator it; + std::map::iterator it; if (chatDialogs.end() != (it = chatDialogs.find(peerId))) { /* exists already */ return it->second; @@ -85,7 +85,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) return NULL; } -/*static*/ ChatDialog *ChatDialog::getChat(const std::string &peerId, uint chatflags) +/*static*/ ChatDialog *ChatDialog::getChat(const RsPeerId &peerId, uint chatflags) { /* see if it already exists */ ChatDialog *cd = getExistingChat(peerId); @@ -98,7 +98,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) } uint32_t distant_peer_status ; - std::string distant_chat_pgp_id ; + RsPgpId distant_chat_pgp_id ; if(rsMsgs->getDistantChatStatus(peerId,distant_peer_status,distant_chat_pgp_id)) chatflags = RS_CHAT_OPEN | RS_CHAT_FOCUS; // use own flags @@ -119,7 +119,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) cd = new PopupDistantChatDialog(); chatDialogs[peerId] = cd; std::string peer_name = rsPeers->getGPGName(distant_chat_pgp_id) ; - cd->init(peerId, tr("Talking to ")+QString::fromStdString(peer_name)+" (PGP id="+QString::fromStdString(distant_chat_pgp_id)+")") ; + cd->init(peerId, tr("Talking to ")+QString::fromStdString(peer_name)+" (PGP id="+QString::fromStdString(distant_chat_pgp_id.toStdString())+")") ; } else { RsPeerDetails sslDetails; @@ -150,7 +150,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) /* ChatDialog destuctor removes the entry from the map */ std::list list; - std::map::iterator it; + std::map::iterator it; for (it = chatDialogs.begin(); it != chatDialogs.end(); it++) { if (it->second) { list.push_back(it->second); @@ -171,11 +171,11 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) // play sound when recv a message soundManager->play(SOUND_NEW_CHAT_MESSAGE); - std::list ids; + std::list ids; if (rsMsgs->getPrivateChatQueueIds(true, ids)) { uint chatflags = Settings->getChatFlags(); - std::list::iterator id; + std::list::iterator id; for (id = ids.begin(); id != ids.end(); id++) { ChatDialog *cd = getChat(*id, chatflags); @@ -187,7 +187,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) } /* now notify all open priavate chat windows */ - std::map::iterator it; + std::map::iterator it; for (it = chatDialogs.begin (); it != chatDialogs.end(); it++) { if (it->second) { it->second->onChatChanged(list, type); @@ -206,11 +206,11 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) /*static*/ void ChatDialog::chatFriend(const RsPeerId &peerId, const bool forceFocus) { - if (peerId.empty()){ + if (peerId.isNull()){ return; } - std::string distant_chat_pgp_id ; + RsPgpId distant_chat_pgp_id ; uint32_t distant_peer_status ; if(rsMsgs->getDistantChatStatus(peerId,distant_peer_status,distant_chat_pgp_id)) @@ -229,10 +229,10 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) return; if (detail.isOnlyGPGdetail) { - std::list onlineIds; + std::list onlineIds; //let's get the ssl child details - std::list sslIds; + std::list sslIds; rsPeers->getAssociatedSSLIds(detail.gpg_id, sslIds); if (sslIds.size() == 1) { @@ -242,7 +242,7 @@ void ChatDialog::init(const RsPeerId &peerId, const QString &title) } // more than one ssl ids available, check for online - for (std::list::iterator it = sslIds.begin(); it != sslIds.end(); ++it) { + for (std::list::iterator it = sslIds.begin(); it != sslIds.end(); ++it) { if (rsPeers->isOnline(*it)) { onlineIds.push_back(*it); } @@ -307,7 +307,7 @@ void ChatDialog::setPeerStatus(uint32_t status) { ChatWidget *cw = getChatWidget(); if (cw) - cw->updateStatus(QString::fromStdString(getPeerId()), status); + cw->updateStatus(QString::fromStdString(getPeerId().toStdString()), status); } int ChatDialog::getPeerStatus() { @@ -369,7 +369,7 @@ void ChatDialog::chatNewMessage(ChatWidget*) void ChatDialog::insertChatMsgs() { - std::string peerId = getPeerId(); + RsPeerId peerId = getPeerId(); std::list newchat; if (!rsMsgs->getPrivateChatQueue(true, peerId, newchat)) { diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp index 687723ef1..301c170ed 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.cpp @@ -111,7 +111,7 @@ void ChatLobbyDialog::inviteFriends() { std::cerr << "Inviting friends" << std::endl; - std::list ids = FriendSelectionDialog::selectFriends(NULL,tr("Invite friends"),tr("Select friends to invite:")) ; + std::list ids = FriendSelectionDialog::selectFriends_SSL(NULL,tr("Invite friends"),tr("Select friends to invite:")) ; std::cerr << "Inviting these friends:" << std::endl; @@ -119,7 +119,7 @@ void ChatLobbyDialog::inviteFriends() if (!rsMsgs->isLobbyId(getPeerId(), lobby_id)) return ; - for(std::list::const_iterator it(ids.begin());it!=ids.end();++it) + for(std::list::const_iterator it(ids.begin());it!=ids.end();++it) { std::cerr << " " << *it << std::endl; @@ -158,14 +158,14 @@ void ChatLobbyDialog::participantsTreeWidgetCustomPopupMenu(QPoint) contextMnu.exec(QCursor::pos()); } -void ChatLobbyDialog::init(const std::string &peerId, const QString &title) +void ChatLobbyDialog::init(const RsPeerId &peerId, const QString &title) { std::list lobbies; rsMsgs->getChatLobbyList(lobbies); std::list::const_iterator lobbyIt; for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { - std::string vpid; + RsPeerId vpid; if (rsMsgs->getVirtualPeerId(lobbyIt->lobby_id, vpid)) { if (vpid == peerId) { QString msg = tr("Welcome to lobby %1").arg(RsHtml::plainText(lobbyIt->lobby_name)); @@ -288,7 +288,7 @@ void ChatLobbyDialog::addIncomingChatMsg(const ChatInfo& info) QDateTime recvTime = QDateTime::fromTime_t(info.recvTime); QString message = QString::fromUtf8(info.msg.c_str()); QString name = QString::fromUtf8(info.peer_nickname.c_str()); - QString rsid = QString::fromUtf8(info.rsid.c_str()); + QString rsid = QString::fromUtf8(info.rsid.toStdString().c_str()); //std::cerr << "message from rsid " << info.rsid.c_str() << std::endl; diff --git a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h index 087b90466..d321ac332 100644 --- a/retroshare-gui/src/gui/chat/ChatLobbyDialog.h +++ b/retroshare-gui/src/gui/chat/ChatLobbyDialog.h @@ -67,7 +67,7 @@ protected: void processSettings(bool load); - virtual void init(const std::string &peerId, const QString &title); + virtual void init(const RsPeerId &peerId, const QString &title); virtual bool canClose(); virtual void addIncomingChatMsg(const ChatInfo& info); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.cpp b/retroshare-gui/src/gui/chat/ChatWidget.cpp index 175cd6363..ac67e2f41 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.cpp +++ b/retroshare-gui/src/gui/chat/ChatWidget.cpp @@ -172,7 +172,7 @@ void ChatWidget::addChatBarWidget(QWidget *w) ui->pluginButtonFrame->layout()->addWidget(w) ; } -void ChatWidget::init(const std::string &peerId, const QString &title) +void ChatWidget::init(const RsPeerId &peerId, const QString &title) { this->peerId = peerId; this->title = title; @@ -187,8 +187,8 @@ void ChatWidget::init(const std::string &peerId, const QString &title) mChatType = CHATTYPE_LOBBY; } else { uint32_t status; - std::string pgp_id; - if (rsMsgs->getDistantChatStatus(peerId, status, pgp_id)) { + RsPgpId pgp_id; + if (rsMsgs->getDistantChatStatus(peerId, status, pgp_id)) { mChatType = CHATTYPE_DISTANT; } else { mChatType = CHATTYPE_PRIVATE; @@ -206,15 +206,15 @@ void ChatWidget::init(const std::string &peerId, const QString &title) break; } - currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId)); - currentFont.fromString(PeerSettings->getPrivateChatFont(peerId)); + currentColor.setNamedColor(PeerSettings->getPrivateChatColor(peerId)); + currentFont.fromString(PeerSettings->getPrivateChatFont(peerId)); colorChanged(); fontChanged(); setColorAndFont(); // load style - PeerSettings->getStyle(peerId, "ChatWidget", style); + PeerSettings->getStyle(peerId, "ChatWidget", style); /* Add plugin functions */ int pluginCount = rsPlugins->nbPlugins(); @@ -244,11 +244,11 @@ void ChatWidget::init(const std::string &peerId, const QString &title) StatusInfo peerStatusInfo; // No check of return value. Non existing status info is handled as offline. rsStatus->getStatus(peerId, peerStatusInfo); - updateStatus(QString::fromStdString(peerId), peerStatusInfo.status); + updateStatus(QString::fromStdString(peerId.toStdString()), peerStatusInfo.status); // initialize first custom state string QString customStateString = QString::fromUtf8(rsMsgs->getCustomStateString(peerId).c_str()); - updatePeersCustomStateString(QString::fromStdString(peerId), customStateString); + updatePeersCustomStateString(QString::fromStdString(peerId.toStdString()), customStateString); } @@ -384,7 +384,7 @@ void ChatWidget::completeNickname(bool reverse) std::list::const_iterator lobbyIt; for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { - std::string vpid; + RsPeerId vpid; if (rsMsgs->getVirtualPeerId(lobbyIt->lobby_id, vpid)) { if (vpid == peerId) { lobby = &*lobbyIt; @@ -490,7 +490,7 @@ QAbstractItemModel *ChatWidget::modelFromPeers() std::list::const_iterator lobbyIt; for (lobbyIt = lobbies.begin(); lobbyIt != lobbies.end(); ++lobbyIt) { - std::string vpid; + RsPeerId vpid; if (rsMsgs->getVirtualPeerId(lobbyIt->lobby_id, vpid)) { if (vpid == peerId) { lobby = &*lobbyIt; @@ -880,7 +880,7 @@ void ChatWidget::fileHashingFinished(QList hashedFiles) if(mDefaultExtraFileFlags & RS_FILE_REQ_ANONYMOUS_ROUTING) link.createFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash)); else - link.createExtraFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash),QString::fromStdString(rsPeers->getOwnId())); + link.createExtraFile(hashedFile.filename, hashedFile.size, QString::fromStdString(hashedFile.hash),QString::fromStdString(rsPeers->getOwnId().toStdString())); if (hashedFile.flag & HashedFile::Picture) { message += QString("").arg(hashedFile.filepath); @@ -947,15 +947,15 @@ void ChatWidget::updateStatus(const QString &peer_id, int status) } /* set font size for status */ - if (peer_id.toStdString() == peerId) { + if (RsPeerId(peer_id.toStdString()) == peerId) { // the peers status has changed QString peerName ; uint32_t stts ; - std::string pgp_id ; + RsPgpId pgp_id ; if(rsMsgs->getDistantChatStatus(peerId,stts,pgp_id)) - peerName = QString::fromUtf8(rsPeers->getPeerName(pgp_id).c_str()); + peerName = QString::fromUtf8(rsPeers->getGPGName(pgp_id).c_str()); else peerName = QString::fromUtf8(rsPeers->getPeerName(peerId).c_str()); @@ -1025,10 +1025,9 @@ void ChatWidget::updateTitle() void ChatWidget::updatePeersCustomStateString(const QString& peer_id, const QString& status_string) { - std::string stdPeerId = peer_id.toStdString(); QString status_text; - if (stdPeerId == peerId) { + if (RsPeerId(peer_id.toStdString()) == peerId) { // the peers status string has changed if (status_string.isEmpty()) { ui->statusMessageLabel->hide(); diff --git a/retroshare-gui/src/gui/chat/ChatWidget.h b/retroshare-gui/src/gui/chat/ChatWidget.h index 4d2a1620a..978edefa8 100644 --- a/retroshare-gui/src/gui/chat/ChatWidget.h +++ b/retroshare-gui/src/gui/chat/ChatWidget.h @@ -68,7 +68,7 @@ public: explicit ChatWidget(QWidget *parent = 0); ~ChatWidget(); - void init(const std::string &peerId, const QString &title); + void init(const RsPeerId &peerId, const QString &title); ChatType chatType() { return mChatType; } bool hasNewMessages() { return newMessages; } @@ -84,7 +84,7 @@ public: void addToolsAction(QAction *action); - std::string getPeerId() { return peerId; } + RsPeerId getPeerId() { return peerId; } QString getTitle() { return title; } int getPeerStatus() { return peerStatus; } void setName(const QString &name); @@ -158,7 +158,7 @@ private: void completeNickname(bool reverse); QAbstractItemModel *modelFromPeers(); - std::string peerId; + RsPeerId peerId; QString title; QString name; QString completionWord; diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index 548735b08..29dc99d73 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -56,7 +56,7 @@ void PopupChatDialog::init(const RsPeerId &peerId, const QString &title) ChatDialog::init(peerId, title); /* Hide or show the avatar frames */ - showAvatarFrame(PeerSettings->getShowAvatarFrame(peerId.toStdString())); + showAvatarFrame(PeerSettings->getShowAvatarFrame(peerId)); ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); ui.avatarWidget->setId(peerId.toStdString(), false); @@ -219,7 +219,7 @@ void PopupChatDialog::showAvatarFrame(bool show) ui.avatarFrameButton->setIcon(QIcon(":images/show_toolbox_frame.png")); } - PeerSettings->setShowAvatarFrame(getPeerId().toStdString(), show); + PeerSettings->setShowAvatarFrame(getPeerId(), show); } void PopupChatDialog::clearOfflineMessages() diff --git a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp index 23ecc24b1..66d7bc1ca 100644 --- a/retroshare-gui/src/gui/chat/PopupChatWindow.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatWindow.cpp @@ -126,8 +126,8 @@ void PopupChatWindow::saveSettings() Settings->setValueToGroup("ChatWindow", "OnTop", ui.actionSetOnTop->isChecked()); } else { if (!peerId.isNull()) { - PeerSettings->saveWidgetInformation(peerId.toStdString(), this); - PeerSettings->setPrivateChatOnTop(peerId.toStdString(), ui.actionSetOnTop->isChecked()); + PeerSettings->saveWidgetInformation(peerId, this); + PeerSettings->setPrivateChatOnTop(peerId, ui.actionSetOnTop->isChecked()); } } } @@ -141,7 +141,7 @@ void PopupChatWindow::showEvent(QShowEvent */*event*/) Settings->loadWidgetInformation(this); } else { this->move(qrand()%100, qrand()%100); //avoid to stack multiple popup chat windows on the same position - PeerSettings->loadWidgetInformation(peerId.toStdString(), this); + PeerSettings->loadWidgetInformation(peerId, this); } } } @@ -189,7 +189,7 @@ void PopupChatWindow::addDialog(ChatDialog *dialog) calculateStyle(dialog); /* signal toggled is called */ - ui.actionSetOnTop->setChecked(PeerSettings->getPrivateChatOnTop(peerId.toStdString())); + ui.actionSetOnTop->setChecked(PeerSettings->getPrivateChatOnTop(peerId)); QObject::connect(dialog, SIGNAL(dialogClose(ChatDialog*)), this, SLOT(dialogClose(ChatDialog*))); } diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp index 3318d9506..edc9bdd73 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.cpp @@ -92,7 +92,7 @@ void RsharePeerSettings::cleanDeadIds() } } -bool RsharePeerSettings::getSettingsIdOfPeerId(const std::string &peerId, std::string &settingsId) +bool RsharePeerSettings::getSettingsIdOfPeerId(const RsPeerId &peerId, std::string &settingsId) { ChatLobbyId lid; if (rsMsgs->isLobbyId(peerId, lid)) { @@ -111,14 +111,14 @@ bool RsharePeerSettings::getSettingsIdOfPeerId(const std::string &peerId, std::s return false; } - settingsId = details.gpg_id; + settingsId = details.gpg_id.toStdString(); m_SslToGpg[peerId] = settingsId; return true; } /* get value of peer */ -QVariant RsharePeerSettings::get(const std::string &peerId, const QString &key, const QVariant &defaultValue) +QVariant RsharePeerSettings::get(const RsPeerId &peerId, const QString &key, const QVariant &defaultValue) { QVariant result; @@ -153,22 +153,22 @@ void RsharePeerSettings::set(const std::string &peerId, const QString &key, cons endGroup(); } -QString RsharePeerSettings::getPrivateChatColor(const std::string &peerId) +QString RsharePeerSettings::getPrivateChatColor(const RsPeerId &peerId) { return get(peerId, "PrivateChatColor", QColor(Qt::black).name()).toString(); } -void RsharePeerSettings::setPrivateChatColor(const std::string &peerId, const QString &value) +void RsharePeerSettings::setPrivateChatColor(const RsPeerId &peerId, const QString &value) { set(peerId, "PrivateChatColor", value); } -QString RsharePeerSettings::getPrivateChatFont(const std::string &peerId) +QString RsharePeerSettings::getPrivateChatFont(const RsPeerId &peerId) { return get(peerId, "PrivateChatFont", Settings->getChatScreenFont()).toString(); } -void RsharePeerSettings::setPrivateChatFont(const std::string &peerId, const QString &value) +void RsharePeerSettings::setPrivateChatFont(const RsPeerId &peerId, const QString &value) { if (Settings->getChatScreenFont() == value) { set(peerId, "PrivateChatFont", QVariant()); @@ -177,17 +177,17 @@ void RsharePeerSettings::setPrivateChatFont(const std::string &peerId, const QSt } } -bool RsharePeerSettings::getPrivateChatOnTop(const std::string &peerId) +bool RsharePeerSettings::getPrivateChatOnTop(const RsPeerId &peerId) { return get(peerId, "PrivateChatOnTop", false).toBool(); } -void RsharePeerSettings::setPrivateChatOnTop(const std::string &peerId, bool value) +void RsharePeerSettings::setPrivateChatOnTop(const RsPeerId &peerId, bool value) { set(peerId, "PrivateChatOnTop", value); } -void RsharePeerSettings::saveWidgetInformation(const std::string &peerId, QWidget *widget) +void RsharePeerSettings::saveWidgetInformation(const RsPeerId &peerId, QWidget *widget) { std::string settingsId; if (getSettingsIdOfPeerId(peerId, settingsId) == false) { @@ -207,7 +207,7 @@ void RsharePeerSettings::saveWidgetInformation(const std::string &peerId, QWidge endGroup(); } -void RsharePeerSettings::loadWidgetInformation(const std::string &peerId, QWidget *widget) +void RsharePeerSettings::loadWidgetInformation(const RsPeerId &peerId, QWidget *widget) { std::string settingsId; if (getSettingsIdOfPeerId(peerId, settingsId) == false) { @@ -227,27 +227,27 @@ void RsharePeerSettings::loadWidgetInformation(const std::string &peerId, QWidge endGroup(); } -bool RsharePeerSettings::getShowAvatarFrame(const std::string &peerId) +bool RsharePeerSettings::getShowAvatarFrame(const RsPeerId &peerId) { return get(peerId, "ShowAvatarFrame", true).toBool(); } -void RsharePeerSettings::setShowAvatarFrame(const std::string &peerId, bool value) +void RsharePeerSettings::setShowAvatarFrame(const RsPeerId &peerId, bool value) { return set(peerId, "ShowAvatarFrame", value); } -bool RsharePeerSettings::getShowParticipantsFrame(const std::string &peerId) +bool RsharePeerSettings::getShowParticipantsFrame(const RsPeerId &peerId) { return get(peerId, "ShowParticipantsFrame", true).toBool(); } -void RsharePeerSettings::setShowParticipantsFrame(const std::string &peerId, bool value) +void RsharePeerSettings::setShowParticipantsFrame(const RsPeerId &peerId, bool value) { return set(peerId, "ShowParticipantsFrame", value); } -void RsharePeerSettings::getStyle(const std::string &peerId, const QString &name, RSStyle &style) +void RsharePeerSettings::getStyle(const RsPeerId &peerId, const QString &name, RSStyle &style) { std::string settingsId; if (getSettingsIdOfPeerId(peerId, settingsId) == false) { @@ -266,7 +266,7 @@ void RsharePeerSettings::getStyle(const std::string &peerId, const QString &name endGroup(); } -void RsharePeerSettings::setStyle(const std::string &peerId, const QString &name, RSStyle &style) +void RsharePeerSettings::setStyle(const RsPeerId &peerId, const QString &name, RSStyle &style) { std::string settingsId; if (getSettingsIdOfPeerId(peerId, settingsId) == false) { diff --git a/retroshare-gui/src/gui/settings/RsharePeerSettings.h b/retroshare-gui/src/gui/settings/RsharePeerSettings.h index ab411d562..4486c8c6f 100644 --- a/retroshare-gui/src/gui/settings/RsharePeerSettings.h +++ b/retroshare-gui/src/gui/settings/RsharePeerSettings.h @@ -33,41 +33,41 @@ public: /* create settings object */ static void Create (); - QString getPrivateChatColor(const std::string &peerId); - void setPrivateChatColor(const std::string &peerId, const QString &value); + QString getPrivateChatColor(const RsPeerId &peerId); + void setPrivateChatColor(const RsPeerId &peerId, const QString &value); - QString getPrivateChatFont(const std::string &peerId); - void setPrivateChatFont(const std::string &peerId, const QString &value); + QString getPrivateChatFont(const RsPeerId &peerId); + void setPrivateChatFont(const RsPeerId &peerId, const QString &value); - bool getPrivateChatOnTop(const std::string &peerId); - void setPrivateChatOnTop(const std::string &peerId, bool value); + bool getPrivateChatOnTop(const RsPeerId &peerId); + void setPrivateChatOnTop(const RsPeerId &peerId, bool value); - void saveWidgetInformation(const std::string &peerId, QWidget *widget); - void loadWidgetInformation(const std::string &peerId, QWidget *widget); + void saveWidgetInformation(const RsPeerId &peerId, QWidget *widget); + void loadWidgetInformation(const RsPeerId &peerId, QWidget *widget); - bool getShowAvatarFrame(const std::string &peerId); - void setShowAvatarFrame(const std::string &peerId, bool value); + bool getShowAvatarFrame(const RsPeerId &peerId); + void setShowAvatarFrame(const RsPeerId &peerId, bool value); - bool getShowParticipantsFrame(const std::string &peerId); - void setShowParticipantsFrame(const std::string &peerId, bool value); + bool getShowParticipantsFrame(const RsPeerId &peerId); + void setShowParticipantsFrame(const RsPeerId &peerId, bool value); - void getStyle(const std::string &peerId, const QString &name, RSStyle &style); - void setStyle(const std::string &peerId, const QString &name, RSStyle &style); + void getStyle(const RsPeerId &peerId, const QString &name, RSStyle &style); + void setStyle(const RsPeerId &peerId, const QString &name, RSStyle &style); protected: /** Default constructor. */ RsharePeerSettings(); - bool getSettingsIdOfPeerId(const std::string &peerId, std::string &settingsId); + bool getSettingsIdOfPeerId(const RsPeerId &peerId, std::string &settingsId); void cleanDeadIds(); /* get value of peer */ - QVariant get(const std::string &peerId, const QString &key, const QVariant &defaultValue = QVariant()); + QVariant get(const RsPeerId &peerId, const QString &key, const QVariant &defaultValue = QVariant()); /* set value of peer */ - void set(const std::string &peerId, const QString &key, const QVariant &value); + void set(const RsPeerId &peerId, const QString &key, const QVariant &value); /* map for fast access of the gpg id to the ssl id */ - std::map m_SslToGpg; + std::map m_SslToGpg; }; // the one and only global settings object