mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Fixed utf8 issues (Patch from Asamk #3393353)
SearchDialog: enable search for strings containing utf8 characters, I assume that filenames are always stored as utf8 on all platforms ConnectFriendWizard: adding friends with gpg key or from file, now sets location name correctly notifyqt: setting status message in chatwindow works correctly now, when a friend changes his message while the chat window is open git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4635 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e3798dafe9
commit
7e3a342a9a
@ -338,7 +338,7 @@ void SearchDialog::download()
|
||||
std::string hash = item->text(SR_HASH_COL).toStdString();
|
||||
getSourceFriendsForHash(hash,srcIds) ;
|
||||
|
||||
if(!rsFiles -> FileRequest((item->text(SR_NAME_COL)).toStdString(), hash, (item->text(SR_SIZE_COL)).toULongLong(), "", RS_FILE_HINTS_NETWORK_WIDE, srcIds))
|
||||
if(!rsFiles -> FileRequest((item->text(SR_NAME_COL)).toUtf8().constData(), hash, (item->text(SR_SIZE_COL)).toULongLong(), "", RS_FILE_HINTS_NETWORK_WIDE, srcIds))
|
||||
attemptDownloadLocal = true ;
|
||||
else
|
||||
{
|
||||
@ -366,10 +366,10 @@ void SearchDialog::downloadDirectory(const QTreeWidgetItem *item, const QString
|
||||
|
||||
getSourceFriendsForHash(hash,srcIds) ;
|
||||
|
||||
rsFiles->FileRequest(item->text(SR_NAME_COL).toStdString(),
|
||||
rsFiles->FileRequest(item->text(SR_NAME_COL).toUtf8().constData(),
|
||||
hash,
|
||||
item->text(SR_SIZE_COL).toULongLong(),
|
||||
cleanPath.toStdString(),RS_FILE_HINTS_NETWORK_WIDE, srcIds);
|
||||
cleanPath.toUtf8().constData(),RS_FILE_HINTS_NETWORK_WIDE, srcIds);
|
||||
|
||||
std::cout << "SearchDialog::downloadDirectory(): "\
|
||||
"issuing file request from search dialog: -"
|
||||
|
@ -271,7 +271,7 @@ void MessageWidget::getcurrentrecommended()
|
||||
|
||||
switch (it->column()) {
|
||||
case COLUMN_FILE_NAME:
|
||||
fi.fname = it->data().toString().toStdString() ;
|
||||
fi.fname = it->data().toString().toUtf8().constData();
|
||||
break ;
|
||||
case COLUMN_FILE_SIZE:
|
||||
fi.size = it->data().toULongLong() ;
|
||||
@ -287,7 +287,7 @@ void MessageWidget::getcurrentrecommended()
|
||||
std::cout << "Requesting file " << fi.fname << ", size=" << fi.size << ", hash=" << fi.hash << std::endl ;
|
||||
|
||||
if (rsFiles->FileRequest(fi.fname, fi.hash, fi.size, "", RS_FILE_HINTS_NETWORK_WIDE, srcIds) == false) {
|
||||
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The following has not been added to your download list, because you already have it:\n ") + QString::fromStdString(fi.fname), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
|
||||
QMessageBox mb(QObject::tr("File Request canceled"), QObject::tr("The following has not been added to your download list, because you already have it:\n ") + QString::fromUtf8(fi.fname.c_str()), QMessageBox::Critical, QMessageBox::Ok, 0, 0);
|
||||
mb.setWindowIcon(QIcon(QString::fromUtf8(":/images/rstray3.png")));
|
||||
mb.exec();
|
||||
}
|
||||
@ -436,7 +436,7 @@ void MessageWidget::fill(const std::string &msgId)
|
||||
QList<QTreeWidgetItem*> items;
|
||||
for (it = recList.begin(); it != recList.end(); it++) {
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||
item->setText(COLUMN_FILE_NAME, QString::fromStdString(it->fname));
|
||||
item->setText(COLUMN_FILE_NAME, QString::fromUtf8(it->fname.c_str()));
|
||||
item->setText(COLUMN_FILE_SIZE, QString::number(it->size));
|
||||
item->setText(COLUMN_FILE_HASH, QString::fromStdString(it->hash));
|
||||
|
||||
|
@ -225,7 +225,7 @@ void NotifyQt::notifyCustomState(const std::string& peer_id, const std::string&
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "notifyQt: Received custom status string notification" << std::endl ;
|
||||
#endif
|
||||
emit peerHasNewCustomStateString(QString::fromStdString(peer_id), QString::fromStdString(status_string)) ;
|
||||
emit peerHasNewCustomStateString(QString::fromStdString(peer_id), QString::fromUtf8(status_string.c_str())) ;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyChatStatus(const std::string& peer_id,const std::string& status_string,bool is_private)
|
||||
@ -233,7 +233,7 @@ void NotifyQt::notifyChatStatus(const std::string& peer_id,const std::string& st
|
||||
#ifdef NOTIFY_DEBUG
|
||||
std::cerr << "notifyQt: Received chat status string: " << status_string << std::endl ;
|
||||
#endif
|
||||
emit chatStatusChanged(QString::fromStdString(peer_id),QString::fromStdString(status_string),is_private) ;
|
||||
emit chatStatusChanged(QString::fromStdString(peer_id),QString::fromUtf8(status_string.c_str()),is_private) ;
|
||||
}
|
||||
|
||||
void NotifyQt::notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files)
|
||||
|
Loading…
Reference in New Issue
Block a user