mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 23:36:59 -05:00
3 patches from AsamK:
* fixed utf8 in dropping links to channels * fixed pasting cert links in the friend list * added code to allow pasting GPG certificates missing a newline at the end. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5064 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
08a52dc369
commit
0778e8f691
@ -1127,7 +1127,8 @@ static bool splitCert(const std::string &certstr, std::string &cert, std::string
|
|||||||
if (pos != std::string::npos) {
|
if (pos != std::string::npos) {
|
||||||
pos += pgpend.length();
|
pos += pgpend.length();
|
||||||
cert = certstr.substr(0, pos);
|
cert = certstr.substr(0, pos);
|
||||||
peerInfo = certstr.substr(pos + 1);
|
if (pos + 1 < certstr.length())
|
||||||
|
peerInfo = certstr.substr(pos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return !cert.empty();
|
return !cert.empty();
|
||||||
|
@ -1234,7 +1234,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con
|
|||||||
|
|
||||||
drags[details.hash] = details.count;
|
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)
|
if (RemoteMode)
|
||||||
{
|
{
|
||||||
@ -1258,7 +1258,7 @@ QMimeData * RetroshareDirModel::mimeData ( const QModelIndexList & indexes ) con
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QMimeData *data = new QMimeData();
|
QMimeData *data = new QMimeData();
|
||||||
data->setData("application/x-rsfilelist", QByteArray(text.toAscii()));
|
data->setData("application/x-rsfilelist", text.toUtf8());
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
@ -47,20 +47,6 @@
|
|||||||
/* Key for UI Preferences */
|
/* Key for UI Preferences */
|
||||||
#define UI_PREF_ADVANCED_SEARCH "UIOptions/AdvancedSearch"
|
#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 */
|
/* indicies for search summary item columns SS_ = Search Summary */
|
||||||
#define SS_TEXT_COL 0
|
#define SS_TEXT_COL 0
|
||||||
#define SS_COUNT_COL 1
|
#define SS_COUNT_COL 1
|
||||||
|
@ -38,20 +38,26 @@ QMimeData * SearchTreeWidget::mimeData ( const QList<QTreeWidgetItem *> items )
|
|||||||
QString text;
|
QString text;
|
||||||
for(it = items.begin(); it != items.end(); it++)
|
for(it = items.begin(); it != items.end(); it++)
|
||||||
{
|
{
|
||||||
QString line;
|
QString line = QString("%1/%2/%3/").arg((*it)->text(SR_NAME_COL), (*it)->text(SR_HASH_COL), (*it)->text(SR_SIZE_COL));
|
||||||
for(int i = 0; i < (*it)->columnCount(); i++)
|
|
||||||
|
bool isLocal = (*it)->data(SR_DATA_COL, SR_ROLE_LOCAL).toBool();
|
||||||
|
if (isLocal)
|
||||||
{
|
{
|
||||||
line += (*it)->text(i);
|
line += "Local";
|
||||||
line += "/";
|
|
||||||
}
|
}
|
||||||
line += "\n";
|
else
|
||||||
|
{
|
||||||
|
line += "Remote";
|
||||||
|
}
|
||||||
|
line += "/\n";
|
||||||
|
|
||||||
text += line;
|
text += line;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << "Created MimeData:";
|
std::cerr << "Created MimeData:";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
std::string str = text.toStdString();
|
std::string str = text.toUtf8().constData();
|
||||||
std::cerr << str;
|
std::cerr << str;
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
|
|
||||||
|
@ -24,6 +24,19 @@
|
|||||||
|
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
|
/* 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
|
class SearchTreeWidget : public QTreeWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
@ -110,7 +110,7 @@ void CreateChannelMsg::pasteLink()
|
|||||||
|
|
||||||
FileInfo info ;
|
FileInfo info ;
|
||||||
if(rsFiles->alreadyHaveFile( (*it).hash().toStdString(),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
|
else
|
||||||
not_have.push_back( *it ) ;
|
not_have.push_back( *it ) ;
|
||||||
}
|
}
|
||||||
|
@ -363,7 +363,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson()));
|
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);
|
action->setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -473,7 +473,7 @@ void FriendList::peerTreeWidgetCostumPopupMenu()
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QAction *action = contextMnu.addAction(QIcon(IMAGE_PASTELINK), tr("Paste Friend Link"), this, SLOT(pastePerson()));
|
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);
|
action->setDisabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1271,6 +1271,7 @@ void FriendList::recommendfriend()
|
|||||||
void FriendList::pastePerson()
|
void FriendList::pastePerson()
|
||||||
{
|
{
|
||||||
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON);
|
RSLinkClipboard::process(RetroShareLink::TYPE_PERSON);
|
||||||
|
RSLinkClipboard::process(RetroShareLink::TYPE_CERTIFICATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendList::copyFullCertificate()
|
void FriendList::copyFullCertificate()
|
||||||
|
@ -338,6 +338,7 @@ TextPage::TextPage(QWidget *parent)
|
|||||||
"certificate into the box below" )) ;
|
"certificate into the box below" )) ;
|
||||||
|
|
||||||
friendCertEdit = new QTextEdit;
|
friendCertEdit = new QTextEdit;
|
||||||
|
friendCertEdit->setAcceptRichText(false);
|
||||||
|
|
||||||
//font.setWeight(75);
|
//font.setWeight(75);
|
||||||
QFont font("Courier New",10,50,false);
|
QFont font("Courier New",10,50,false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user