mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-18 02:50:47 -04:00
Fixed drag'n'drop of shared files from the SharedFilesDialog to the CreateChannelMsg.
Enabled the usage of remote files. Added some small const& to the code. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3619 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
791d6144dc
commit
fc320cf1a6
5 changed files with 14 additions and 23 deletions
|
@ -152,7 +152,6 @@ void CreateChannelMsg::dropEvent(QDropEvent *event)
|
|||
std::cerr << "CreateChannelMsg::dropEvent() Application/x-rsfilelist";
|
||||
std::cerr << std::endl;
|
||||
|
||||
|
||||
QByteArray data = event->mimeData()->data("application/x-rsfilelist");
|
||||
std::cerr << "Data Len:" << data.length();
|
||||
std::cerr << std::endl;
|
||||
|
@ -162,13 +161,12 @@ void CreateChannelMsg::dropEvent(QDropEvent *event)
|
|||
std::string newattachments(data.data());
|
||||
parseRsFileListAttachments(newattachments);
|
||||
}
|
||||
|
||||
|
||||
event->setDropAction(Qt::CopyAction);
|
||||
event->accept();
|
||||
}
|
||||
|
||||
void CreateChannelMsg::parseRsFileListAttachments(std::string attachList)
|
||||
void CreateChannelMsg::parseRsFileListAttachments(const std::string &attachList)
|
||||
{
|
||||
/* split into lines */
|
||||
QString input = QString::fromStdString(attachList);
|
||||
|
@ -244,7 +242,7 @@ void CreateChannelMsg::parseRsFileListAttachments(std::string attachList)
|
|||
}
|
||||
|
||||
|
||||
void CreateChannelMsg::addAttachment(std::string hash, std::string fname, uint64_t size, bool local, std::string srcId)
|
||||
void CreateChannelMsg::addAttachment(const std::string &hash, const std::string &fname, uint64_t size, bool local, const std::string &srcId)
|
||||
{
|
||||
/* add a SubFileItem to the attachment section */
|
||||
std::cerr << "CreateChannelMsg::addAttachment()";
|
||||
|
@ -260,8 +258,6 @@ void CreateChannelMsg::addAttachment(std::string hash, std::string fname, uint64
|
|||
else
|
||||
{
|
||||
flags |= SFI_STATE_REMOTE;
|
||||
// TMP REMOVED REMOTE ADD FOR DEMONSTRATOR
|
||||
return;
|
||||
}
|
||||
|
||||
SubFileItem *file = new SubFileItem(hash, fname, "", size, flags, srcId); // destroyed when fileFrame (this subfileitem) is destroyed
|
||||
|
@ -296,7 +292,7 @@ void CreateChannelMsg::addExtraFile()
|
|||
}
|
||||
|
||||
|
||||
void CreateChannelMsg::addAttachment(std::string path)
|
||||
void CreateChannelMsg::addAttachment(const std::string &path)
|
||||
{
|
||||
/* add a SubFileItem to the attachment section */
|
||||
std::cerr << "CreateChannelMsg::addAttachment()";
|
||||
|
|
|
@ -37,9 +37,8 @@ public:
|
|||
CreateChannelMsg(std::string cId);
|
||||
/** Default Destructor */
|
||||
|
||||
void addAttachment(std::string path);
|
||||
void addAttachment(std::string hash, std::string fname, uint64_t size,
|
||||
bool local, std::string srcId);
|
||||
void addAttachment(const std::string &path);
|
||||
void addAttachment(const std::string &hash, const std::string &fname, uint64_t size, bool local, const std::string &srcId);
|
||||
|
||||
void newChannelMsg();
|
||||
|
||||
|
@ -60,7 +59,7 @@ private slots:
|
|||
|
||||
private:
|
||||
|
||||
void parseRsFileListAttachments(std::string attachList);
|
||||
void parseRsFileListAttachments(const std::string &attachList);
|
||||
|
||||
void sendMessage(std::wstring subject, std::wstring msg, std::list<FileInfo> &files);
|
||||
|
||||
|
@ -71,7 +70,5 @@ private:
|
|||
bool mCheckAttachment;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue