Commit 0898bc53 authored by shibakaneki's avatar shibakaneki

Support for the drop fom Firefox & Chrome to the Board added

parent a3af649c
......@@ -1841,6 +1841,18 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
}
}
if(pMimeData->hasHtml())
{
QString qsHtml = pMimeData->html();
QString url = UBApplication::urlFromHtml(qsHtml);
if(!("" == url))
{
downloadURL(url, pPos);
return;
}
}
if (pMimeData->hasUrls())
{
QList<QUrl> urls = pMimeData->urls();
......
......@@ -17,6 +17,7 @@
#include <QtGui>
#include <QtWebKit>
#include <QtXml>
#if defined(Q_WS_MACX)
#include <Carbon/Carbon.h>
......@@ -629,3 +630,18 @@ QString UBApplication::globalStyleSheet()
return style;
}
QString UBApplication::urlFromHtml(QString html)
{
QString url;
QDomDocument domDoc;
domDoc.setContent(html);
QDomElement rootElem = domDoc.documentElement();
url = rootElem.attribute("src");
qDebug() << url;
return url;
}
......@@ -88,6 +88,7 @@ class UBApplication : public QtSingleApplication
bool isVerbose() { return mIsVerbose;}
void setVerbose(bool verbose){mIsVerbose = verbose;}
static QString urlFromHtml(QString html);
signals:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment