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

preferencesAboutTextFull
shibakaneki 13 years ago
parent a3af649cba
commit 0898bc5381
  1. 12
      src/board/UBBoardController.cpp
  2. 16
      src/core/UBApplication.cpp
  3. 1
      src/core/UBApplication.h

@ -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:

Loading…
Cancel
Save