Changeset View
Changeset View
Standalone View
Standalone View
plugins/domtreeviewer/domtreewindow.cpp
Show All 27 Lines | |||||
28 | #include <kconfig.h> | 28 | #include <kconfig.h> | ||
29 | #include <khtml_part.h> | 29 | #include <khtml_part.h> | ||
30 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
31 | #include <kmenubar.h> | 31 | #include <kmenubar.h> | ||
32 | #include <kstatusbar.h> | 32 | #include <kstatusbar.h> | ||
33 | #include <kstandarddirs.h> | 33 | #include <kstandarddirs.h> | ||
34 | #include <kstandardguiitem.h> | 34 | #include <kstandardguiitem.h> | ||
35 | #include <ktextedit.h> | 35 | #include <ktextedit.h> | ||
36 | #include <kurl.h> | | |||
37 | #include <kurlrequesterdialog.h> | 36 | #include <kurlrequesterdialog.h> | ||
38 | #include <kxmlguifactory.h> | 37 | #include <kxmlguifactory.h> | ||
39 | #include <kparts/partmanager.h> | 38 | #include <kparts/partmanager.h> | ||
40 | 39 | | |||
41 | #include <kedittoolbar.h> | 40 | #include <kedittoolbar.h> | ||
42 | #include <kactioncollection.h> | 41 | #include <kactioncollection.h> | ||
43 | 42 | | |||
44 | #include <kstandardaction.h> | 43 | #include <kstandardaction.h> | ||
45 | 44 | | |||
46 | #include <qdatetime.h> | 45 | #include <qdatetime.h> | ||
47 | #include <qtimer.h> | 46 | #include <qtimer.h> | ||
48 | #include <QDragEnterEvent> | 47 | #include <QDragEnterEvent> | ||
49 | #include <QMenu> | 48 | #include <QMenu> | ||
50 | #include <QDropEvent> | 49 | #include <QDropEvent> | ||
50 | #include <QMimeData> | ||||
51 | 51 | | |||
52 | //KDELibs4Support | 52 | //KDELibs4Support | ||
53 | #include <kdialog.h> | 53 | #include <kdialog.h> | ||
54 | #include <kdebug.h> | 54 | #include <kdebug.h> | ||
55 | 55 | | |||
56 | 56 | | |||
57 | class MessageDialog : public KDialog, public Ui::MessageDialog | 57 | class MessageDialog : public KDialog, public Ui::MessageDialog | ||
58 | { | 58 | { | ||
▲ Show 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 277 | #if 0 | |||
280 | if (!url.isEmpty()) { | 280 | if (!url.isEmpty()) { | ||
281 | m_view->openUrl(KUrl::fromPathOrUrl(url)); | 281 | m_view->openUrl(KUrl::fromPathOrUrl(url)); | ||
282 | } | 282 | } | ||
283 | #endif | 283 | #endif | ||
284 | } | 284 | } | ||
285 | 285 | | |||
286 | void DOMTreeWindow::dragEnterEvent(QDragEnterEvent * event) { | 286 | void DOMTreeWindow::dragEnterEvent(QDragEnterEvent * event) { | ||
287 | // accept uri drops only | 287 | // accept uri drops only | ||
288 | event->setAccepted(KUrl::List::canDecode(event->mimeData())); | 288 | event->setAccepted(event->mimeData()->hasUrls()); | ||
289 | } | 289 | } | ||
290 | 290 | | |||
291 | void DOMTreeWindow::dropEvent(QDropEvent * event) { | 291 | void DOMTreeWindow::dropEvent(QDropEvent * event) { | ||
292 | // this is a very simplistic implementation of a drop event. we | 292 | // this is a very simplistic implementation of a drop event. we | ||
293 | // will only accept a dropped URL. the Qt dnd code can do *much* | 293 | // will only accept a dropped URL. the Qt dnd code can do *much* | ||
294 | // much more, so please read the docs there | 294 | // much more, so please read the docs there | ||
295 | 295 | | |||
296 | // see if we can decode a URI.. if not, just ignore it | 296 | // see if we can decode a URI.. if not, just ignore it | ||
297 | KUrl::List urls = KUrl::List::fromMimeData(event->mimeData()); | 297 | QList<QUrl> urls = event->mimeData()->urls(); | ||
298 | if (!urls.isEmpty()) { | 298 | if (!urls.isEmpty()) { | ||
299 | // okay, we have a URI.. process it | 299 | // okay, we have a URI.. process it | ||
300 | const KUrl &url = urls.first(); | 300 | const QUrl &url = urls.first(); | ||
301 | #if 0 | 301 | #if 0 | ||
302 | // load in the file | 302 | // load in the file | ||
303 | load(url); | 303 | load(url); | ||
304 | #endif | 304 | #endif | ||
305 | } | 305 | } | ||
306 | } | 306 | } | ||
307 | 307 | | |||
308 | void DOMTreeWindow::addMessage(int msg_id, const QString & msg) { | 308 | void DOMTreeWindow::addMessage(int msg_id, const QString & msg) { | ||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |