diff options
author | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-11-05 16:02:27 (GMT) |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@nokia.com> | 2009-11-05 16:16:54 (GMT) |
commit | 7efc64e6a8dbf670bbc46243664d44df7acc5892 (patch) | |
tree | c2246eae9326f307d570687f78d769e0a22d54b6 /src/gui/kernel/qevent.h | |
parent | 1e964556d61b2f4c7a8a0d251940e17c22790980 (diff) | |
download | Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.zip Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.tar.gz Qt-7efc64e6a8dbf670bbc46243664d44df7acc5892.tar.bz2 |
Add support for GetURL events on Mac OS X
GetURL events are delivered by Launch Services to the application if the
application is registered as the default handler for the given protocol,
and the user for example issues 'open http://foo.com/' in the console or
clicks a link in another application.
The GetURL event is converted to a QFileOpenEvent, which now has both a
QUrl constructor and a url() method. These two new methods work in sync
with the file() method, so a QFileOpenEvent constructed from a QUrl will
return a valid file name from file() if the URL was a local file.
The boolean argument to AEInstallEventHandler decides whether the handler
is to be added to the system event dispatch table or the application's
event dispatch table. Previously we added it to the system table, but
this did not work for the GetURL event. We now use the application event
table, which works for all three of the events we register on Carbon.
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/gui/kernel/qevent.h')
-rw-r--r-- | src/gui/kernel/qevent.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index b9512fa..9839269 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -638,9 +638,11 @@ class Q_GUI_EXPORT QFileOpenEvent : public QEvent { public: QFileOpenEvent(const QString &file); + QFileOpenEvent(const QUrl &url); ~QFileOpenEvent(); inline QString file() const { return f; } + QUrl url() const; private: QString f; }; |