mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-02 18:44:53 -05:00
fixed compilation
This commit is contained in:
parent
5071656209
commit
5bc071b03c
@ -497,25 +497,23 @@ void SearchDialog::collCreate()
|
|||||||
int selectedCount = selectedItems.size() ;
|
int selectedCount = selectedItems.size() ;
|
||||||
QTreeWidgetItem * item ;
|
QTreeWidgetItem * item ;
|
||||||
|
|
||||||
for (int i = 0; i < selectedCount; ++i) {
|
RsFileTree tree;
|
||||||
|
|
||||||
|
for (int i = 0; i < selectedCount; ++i)
|
||||||
|
{
|
||||||
item = selectedItems.at(i) ;
|
item = selectedItems.at(i) ;
|
||||||
|
|
||||||
if (!item->text(SR_HASH_COL).isEmpty()) {
|
if (!item->text(SR_HASH_COL).isEmpty())
|
||||||
|
{
|
||||||
std::string name = item->text(SR_NAME_COL).toUtf8().constData();
|
std::string name = item->text(SR_NAME_COL).toUtf8().constData();
|
||||||
RsFileHash hash( item->text(SR_HASH_COL).toStdString() );
|
RsFileHash hash( item->text(SR_HASH_COL).toStdString() );
|
||||||
uint64_t count = item->text(SR_SIZE_COL).toULongLong();
|
uint64_t count = item->text(SR_SIZE_COL).toULongLong();
|
||||||
|
|
||||||
DirDetails details;
|
tree.addFile(tree.root(),name,hash,count);
|
||||||
details.name = name;
|
|
||||||
details.hash = hash;
|
|
||||||
details.size = count;
|
|
||||||
details.type = DIR_TYPE_FILE;
|
|
||||||
|
|
||||||
dirVec.push_back(details);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RsCollection(dirVec,RS_FILE_HINTS_LOCAL).openNewColl(this);
|
RsCollectionDialog::openNewCollection(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SearchDialog::collModif()
|
void SearchDialog::collModif()
|
||||||
|
@ -733,8 +733,25 @@ void SharedFilesDialog::sendLinkTo()
|
|||||||
|
|
||||||
void SharedFilesDialog::collCreate()
|
void SharedFilesDialog::collCreate()
|
||||||
{
|
{
|
||||||
|
#ifdef TODO
|
||||||
QModelIndexList lst = getSelected();
|
QModelIndexList lst = getSelected();
|
||||||
model->createCollectionFile(this, lst);
|
|
||||||
|
std::vector <DirDetails> dirVec;
|
||||||
|
model->getDirDetailsFromSelect(lst, dirVec);
|
||||||
|
|
||||||
|
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
|
||||||
|
|
||||||
|
QString dir_name;
|
||||||
|
if(!RemoteMode)
|
||||||
|
{
|
||||||
|
if(!dirVec.empty())
|
||||||
|
{
|
||||||
|
const DirDetails& details = dirVec[0];
|
||||||
|
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RsCollection(dirVec,f).openNewColl(parent,dir_name);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SharedFilesDialog::collModif()
|
void SharedFilesDialog::collModif()
|
||||||
|
@ -1233,31 +1233,6 @@ bool RetroshareDirModel::requestDirDetails(void *ref, bool remote,DirDetails& d)
|
|||||||
return false ;
|
return false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RetroshareDirModel::createCollectionFile(QWidget *parent, const QModelIndexList &list)
|
|
||||||
{
|
|
||||||
/* if(RemoteMode)
|
|
||||||
{
|
|
||||||
std::cerr << "Cannot create a collection file from remote" << std::endl;
|
|
||||||
return ;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
std::vector <DirDetails> dirVec;
|
|
||||||
getDirDetailsFromSelect(list, dirVec);
|
|
||||||
|
|
||||||
FileSearchFlags f = RemoteMode?RS_FILE_HINTS_REMOTE:RS_FILE_HINTS_LOCAL ;
|
|
||||||
|
|
||||||
QString dir_name;
|
|
||||||
if(!RemoteMode)
|
|
||||||
{
|
|
||||||
if(!dirVec.empty())
|
|
||||||
{
|
|
||||||
const DirDetails& details = dirVec[0];
|
|
||||||
dir_name = QDir(QString::fromUtf8(details.name.c_str())).dirName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RsCollection(dirVec,f).openNewColl(parent,dir_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RetroshareDirModel::downloadSelected(const QModelIndexList &list,bool interactive)
|
void RetroshareDirModel::downloadSelected(const QModelIndexList &list,bool interactive)
|
||||||
{
|
{
|
||||||
if (!RemoteMode)
|
if (!RemoteMode)
|
||||||
|
@ -68,8 +68,6 @@ class RetroshareDirModel : public QAbstractItemModel
|
|||||||
|
|
||||||
/* Callback from GUI */
|
/* Callback from GUI */
|
||||||
void downloadSelected(const QModelIndexList &list, bool interactive);
|
void downloadSelected(const QModelIndexList &list, bool interactive);
|
||||||
void createCollectionFile(QWidget *parent, const QModelIndexList &list);
|
|
||||||
|
|
||||||
void getDirDetailsFromSelect (const QModelIndexList &list, std::vector <DirDetails>& dirVec);
|
void getDirDetailsFromSelect (const QModelIndexList &list, std::vector <DirDetails>& dirVec);
|
||||||
|
|
||||||
int getType ( const QModelIndex & index ) const ;
|
int getType ( const QModelIndex & index ) const ;
|
||||||
|
@ -101,9 +101,6 @@ public:
|
|||||||
|
|
||||||
static bool isCollectionFile(const QString& fileName);
|
static bool isCollectionFile(const QString& fileName);
|
||||||
|
|
||||||
private slots:
|
|
||||||
void saveColl(std::vector<ColFileInfo> colFileInfos, const QString& fileName);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool recursExportToXml(QDomDocument& doc,QDomElement& e,const RsFileTree::DirData& dd) const;
|
bool recursExportToXml(QDomDocument& doc,QDomElement& e,const RsFileTree::DirData& dd) const;
|
||||||
|
@ -1411,8 +1411,9 @@ void RsCollectionDialog::save()
|
|||||||
QTreeWidgetItem* root = getRootItem();
|
QTreeWidgetItem* root = getRootItem();
|
||||||
if (root) {
|
if (root) {
|
||||||
saveChild(root);
|
saveChild(root);
|
||||||
|
#ifdef TODO_COLLECTION
|
||||||
emit saveColl(_newColFileInfos, _fileName);
|
emit saveColl(_newColFileInfos, _fileName);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user