mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-26 07:16:11 -05:00
use of RsCollectionDialog for processing single file links. Only "extra" links still require the older processing system because RsCollections cannot have sources for each entry
This commit is contained in:
parent
b42694165a
commit
6a8bc8baf8
@ -1129,7 +1129,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
links.append(*linkIt);
|
||||
}
|
||||
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ASK) {
|
||||
if (flag & RSLINK_PROCESS_NOTIFY_ASK)
|
||||
{
|
||||
/* ask for some types of link */
|
||||
QStringList fileAdd;
|
||||
QStringList personAdd;
|
||||
@ -1153,12 +1154,9 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
case TYPE_CERTIFICATE:
|
||||
case TYPE_PUBLIC_MSG:
|
||||
case TYPE_PRIVATE_CHAT:
|
||||
// no need to ask
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
case TYPE_EXTRAFILE:
|
||||
fileAdd.append(link.name());
|
||||
// no need to ask
|
||||
break;
|
||||
|
||||
case TYPE_PERSON:
|
||||
@ -1166,30 +1164,6 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
QString content;
|
||||
if (!fileAdd.isEmpty()) {
|
||||
processList(fileAdd, QObject::tr("Add file"), QObject::tr("Add files"), content);
|
||||
}
|
||||
|
||||
//if (personAdd.size()) {
|
||||
// processList(personAdd, QObject::tr("Add friend"), QObject::tr("Add friends"), content);
|
||||
//}
|
||||
|
||||
if (content.isEmpty() == false) {
|
||||
QString question = "<html><body>";
|
||||
if (links.size() == 1) {
|
||||
question += QObject::tr("Do you want to process the link ?");
|
||||
} else {
|
||||
question += QObject::tr("Do you want to process %1 links ?").arg(links.size());
|
||||
}
|
||||
question += "<br><br>" + content + "</body></html>";
|
||||
|
||||
QMessageBox mb(QObject::tr("Confirmation"), question, QMessageBox::Question, QMessageBox::Yes,QMessageBox::No, 0);
|
||||
if (mb.exec() == QMessageBox::No) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int countInvalid = 0;
|
||||
@ -1305,9 +1279,8 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
case TYPE_EXTRAFILE:
|
||||
{
|
||||
{
|
||||
#ifdef DEBUG_RSLINK
|
||||
std::cerr << " RetroShareLink::process FileRequest : fileName : " << link.name().toUtf8().constData() << ". fileHash : " << link.hash().toStdString() << ". fileSize : " << link.size() << std::endl;
|
||||
#endif
|
||||
@ -1388,9 +1361,18 @@ static void processList(const QStringList &list, const QString &textSingular, co
|
||||
} else {
|
||||
if (!bFileOpened) fileExist.append(link.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case TYPE_FILE:
|
||||
{
|
||||
RsCollection col ;
|
||||
col.merge_in(link.name(),link.size(),RsFileHash(link.hash().toStdString())) ;
|
||||
col.downloadFiles();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case TYPE_FILE_TREE:
|
||||
{
|
||||
FileTree *ft = FileTree::create(link.radix().toStdString()) ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user