diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index d2723b677..9a6020367 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1127,7 +1127,8 @@ static bool splitCert(const std::string &certstr, std::string &cert, std::string if (pos != std::string::npos) { pos += pgpend.length(); cert = certstr.substr(0, pos); - peerInfo = certstr.substr(pos + 1); + if (pos + 1 < certstr.length()) + peerInfo = certstr.substr(pos + 1); } return !cert.empty(); diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 3ce6556ff..60f76eaf7 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -1234,7 +1234,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con drags[details.hash] = details.count; - QString line = QString("%1/%2/%3/").arg(QString::fromUtf8(details.name.c_str())).arg(QString::fromStdString(details.hash)).arg(details.count); + QString line = QString("%1/%2/%3/").arg(QString::fromUtf8(details.name.c_str()), QString::fromStdString(details.hash), QString::number(details.count)); if (RemoteMode) { @@ -1258,7 +1258,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con #endif QMimeData *data = new QMimeData(); - data->setData("application/x-rsfilelist", QByteArray(text.toAscii())); + data->setData("application/x-rsfilelist", text.toUtf8()); return data; } diff --git a/retroshare-gui/src/gui/SearchDialog.cpp b/retroshare-gui/src/gui/SearchDialog.cpp index 0e7cabbc1..128f0dc83 100644 --- a/retroshare-gui/src/gui/SearchDialog.cpp +++ b/retroshare-gui/src/gui/SearchDialog.cpp @@ -47,20 +47,6 @@ /* Key for UI Preferences */ #define UI_PREF_ADVANCED_SEARCH "UIOptions/AdvancedSearch" -/* indicies for search results item columns SR_ = Search Result */ -/* indicies for search results item columns SR_ = Search Result */ -#define SR_NAME_COL 0 -#define SR_SIZE_COL 1 -#define SR_ID_COL 2 -#define SR_TYPE_COL 3 -#define SR_AGE_COL 4 -#define SR_HASH_COL 5 -#define SR_SEARCH_ID_COL 6 -#define SR_UID_COL 7 -#define SR_DATA_COL SR_NAME_COL - -#define SR_ROLE_LOCAL Qt::UserRole - /* indicies for search summary item columns SS_ = Search Summary */ #define SS_TEXT_COL 0 #define SS_COUNT_COL 1 diff --git a/retroshare-gui/src/gui/SearchTreeWidget.cpp b/retroshare-gui/src/gui/SearchTreeWidget.cpp index 22ccd1af3..646524f24 100644 --- a/retroshare-gui/src/gui/SearchTreeWidget.cpp +++ b/retroshare-gui/src/gui/SearchTreeWidget.cpp @@ -38,20 +38,26 @@ QMimeData * SearchTreeWidget::mimeData ( const QList items ) QString text; for(it = items.begin(); it != items.end(); it++) { - QString line; - for(int i = 0; i < (*it)->columnCount(); i++) + QString line = QString("%1/%2/%3/").arg((*it)->text(SR_NAME_COL), (*it)->text(SR_HASH_COL), (*it)->text(SR_SIZE_COL)); + + bool isLocal = (*it)->data(SR_DATA_COL, SR_ROLE_LOCAL).toBool(); + if (isLocal) { - line += (*it)->text(i); - line += "/"; + line += "Local"; } - line += "\n"; + else + { + line += "Remote"; + } + line += "/\n"; + text += line; } std::cerr << "Created MimeData:"; std::cerr << std::endl; - std::string str = text.toStdString(); + std::string str = text.toUtf8().constData(); std::cerr << str; std::cerr << std::endl; diff --git a/retroshare-gui/src/gui/SearchTreeWidget.h b/retroshare-gui/src/gui/SearchTreeWidget.h index 64637f473..eb818ecfb 100644 --- a/retroshare-gui/src/gui/SearchTreeWidget.h +++ b/retroshare-gui/src/gui/SearchTreeWidget.h @@ -24,6 +24,19 @@ #include +/* indicies for search results item columns SR_ = Search Result */ +#define SR_NAME_COL 0 +#define SR_SIZE_COL 1 +#define SR_ID_COL 2 +#define SR_TYPE_COL 3 +#define SR_AGE_COL 4 +#define SR_HASH_COL 5 +#define SR_SEARCH_ID_COL 6 +#define SR_UID_COL 7 +#define SR_DATA_COL SR_NAME_COL + +#define SR_ROLE_LOCAL Qt::UserRole + class SearchTreeWidget : public QTreeWidget { Q_OBJECT diff --git a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp index 99252ea3f..7d18cd6c3 100644 --- a/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp +++ b/retroshare-gui/src/gui/channels/CreateChannelMsg.cpp @@ -110,7 +110,7 @@ void CreateChannelMsg::pasteLink() FileInfo info ; if(rsFiles->alreadyHaveFile( (*it).hash().toStdString(),info ) ) - addAttachment((*it).hash().toStdString(), (*it).name().toStdString(), (*it).size(), true, "") ; + addAttachment((*it).hash().toStdString(), (*it).name().toUtf8().constData(), (*it).size(), true, "") ; else not_have.push_back( *it ) ; } diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index e937af17a..793d624dc 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -363,7 +363,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu() } QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson())); - if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON)) { + if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON) && RSLinkClipboard::empty(RetroShareLink::TYPE_CERTIFICATE)) { action->setDisabled(true); } @@ -473,7 +473,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu() } } else { QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson())); - if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON)) { + if (RSLinkClipboard::empty(RetroShareLink::TYPE_PERSON) && RSLinkClipboard::empty(RetroShareLink::TYPE_CERTIFICATE)) { action->setDisabled(true); } } @@ -1271,6 +1271,7 @@ void FriendList::recommendfriend() void FriendList::pastePerson() { RSLinkClipboard::process(RetroShareLink::TYPE_PERSON); + RSLinkClipboard::process(RetroShareLink::TYPE_CERTIFICATE); } void FriendList::copyFullCertificate() diff --git a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp index aefbb456c..6e04f7358 100755 --- a/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp +++ b/retroshare-gui/src/gui/connect/ConnectFriendWizard.cpp @@ -338,6 +338,7 @@ TextPage::TextPage(QWidget *parent) "certificate into the box below" )) ; friendCertEdit = new QTextEdit; + friendCertEdit->setAcceptRichText(false); //font.setWeight(75); QFont font("Courier New",10,50,false);