merged and fixed conflict with upstream/master

This commit is contained in:
mr-alice 2016-11-04 13:52:11 +01:00
commit 2bb9a87b3b
17 changed files with 245 additions and 161 deletions

View file

@ -584,10 +584,13 @@ void GenCertDialog::genPerson()
QCoreApplication::processEvents();
QAbstractEventDispatcher* ed = QAbstractEventDispatcher::instance();
std::cout << "Waiting ed->processEvents()" << std::endl;
time_t waitEnd = time(NULL) + 10;//Wait no more than 10 sec to processEvents
if (ed->hasPendingEvents())
while(ed->processEvents(QEventLoop::AllEvents));
while(ed->processEvents(QEventLoop::AllEvents) && (time(NULL) < waitEnd));
std::string email_str = "" ;
std::cout << "RsAccounts::GeneratePGPCertificate" << std::endl;
RsAccounts::GeneratePGPCertificate(
ui.name_input->text().toUtf8().constData(),
email_str.c_str(),
@ -609,6 +612,7 @@ void GenCertDialog::genPerson()
std::cerr << "GenCertDialog::genPerson() Generating SSL cert with gpg id : " << PGPId << std::endl;
std::string err;
this->hide();//To show dialog asking password PGP Key.
std::cout << "RsAccounts::GenerateSSLCertificate" << std::endl;
bool okGen = RsAccounts::GenerateSSLCertificate(PGPId, "", genLoc, "", isHiddenLoc, sslPasswd, sslId, err);
if (okGen)

View file

@ -1587,46 +1587,8 @@ void RSLinkClipboard::parseClipboard(QList<RetroShareLink> &links)
{
// parse clipboard for links.
//
links.clear();
QString text = QApplication::clipboard()->text() ;
std::cerr << "Parsing clipboard:" << text.toStdString() << std::endl ;
QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP));
int pos = 0;
while((pos = rx.indexIn(text, pos)) != -1)
{
QString url(text.mid(pos, rx.matchedLength()));
RetroShareLink link(url);
if(link.valid())
{
// check that the link is not already in the list:
bool already = false ;
for (int i = 0; i <links.size(); ++i)
if(links[i] == link)
{
already = true ;
break ;
}
if(!already)
{
links.push_back(link) ;
#ifdef DEBUG_RSLINK
std::cerr << "captured link: " << link.toString().toStdString() << std::endl ;
#endif
}
}
#ifdef DEBUG_RSLINK
else
std::cerr << "invalid link" << std::endl ;
#endif
pos += rx.matchedLength();
}
parseText(text, links);
}
QString RSLinkClipboard::toString()
@ -1690,3 +1652,46 @@ bool RSLinkClipboard::empty(RetroShareLink::enumType type /* = RetroShareLink::T
return RetroShareLink::process(linksToProcess, flag);
}
void RSLinkClipboard::parseText(QString text, QList<RetroShareLink> &links)
{
links.clear();
std::cerr << "Parsing text:" << text.toStdString() << std::endl ;
QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP));
int pos = 0;
while((pos = rx.indexIn(text, pos)) != -1)
{
QString url(text.mid(pos, rx.matchedLength()));
RetroShareLink link(url);
if(link.valid())
{
// check that the link is not already in the list:
bool already = false ;
for (int i = 0; i <links.size(); ++i)
if(links[i] == link)
{
already = true ;
break ;
}
if(!already)
{
links.push_back(link) ;
#ifdef DEBUG_RSLINK
std::cerr << "captured link: " << link.toString().toStdString() << std::endl ;
#endif
}
}
#ifdef DEBUG_RSLINK
else
std::cerr << "invalid link" << std::endl ;
#endif
pos += rx.matchedLength();
}
}

View file

@ -208,6 +208,8 @@ class RSLinkClipboard
//
static int process(RetroShareLink::enumType type = RetroShareLink::TYPE_UNKNOWN, uint flag = RSLINK_PROCESS_NOTIFY_ALL);
static void parseText(QString text, QList<RetroShareLink> &links) ;
private:
static void parseClipboard(QList<RetroShareLink> &links) ;
};

View file

@ -78,6 +78,17 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source)
}
#endif
//insert retroshare links
QList<RetroShareLink> links;
RSLinkClipboard::parseText(source->text(), links);
if(links.size() > 0)
{
for(int i = 0; i < links.size(); ++i)
insertHtml(links[i].toHtml() + "<br>");
return;
}
return RSTextEdit::insertFromMimeData(source);
}

View file

@ -234,6 +234,9 @@ macx {
mac_icon.files = $$files($$PWD/rsMacIcon.icns)
mac_icon.path = Contents/Resources
QMAKE_BUNDLE_DATA += mac_icon
mac_webui.files = $$files($$PWD/../../libresapi/src/webui)
mac_webui.path = Contents/Resources
QMAKE_BUNDLE_DATA += mac_webui
CONFIG += version_detail_bash_script
LIBS += -lssl -lcrypto -lz