discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RSS/RDF Aggregator


From: Chris B. Vetter
Subject: Re: RSS/RDF Aggregator
Date: Mon, 20 Oct 2003 15:41:35 -0700

On Tue, 21 Oct 2003 00:07:14 +0200
Marcus Müller <address@hidden> wrote:
> On Montag, Oktober 20, 2003, at 07:17  Uhr, Chris B. Vetter wrote:
> > On Sat, 18 Oct 2003 10:10:11 -0700
> > Alex Perez <address@hidden> wrote:
> >> On Oct 18, 2003, at 9:56 AM, Marcus Müller wrote:
> >>> [snip]
> >>>  However, as I said, NSWorkspace (in GNUstep) doesn't implement
> >>> opening of NSURLs. So, don't expect to see anything more besides
> >the>> headlines - that is, until someone implements this
> >functionality.> Would anyone be willing to implement this properly
> >under GNUstep?
> > This isn't entirely correct (but isn't entirely wrong either).
> > NSWorkspace -openURL: checks whether the given argument is a file,
> > and if it is, tries to open it (or notifies the appropriate
> > application to open it). If it is a url, it returns NO.
> LOL, this isn't correct either: if it's not a file scheme, it doesn't 
> work (just returns NO). Now that was some great smartassing. :-)

Heh, yes, but you take the first sentence out of context, because, as I
say below, the example services WILL kick in, trying to launch mozilla
(by default) or look at NSWebBrowser and start the browser specified
there.

Not that this is correct (or sane or whatever) but it works.

> > In this case, the example services should kick in, which try to
> > launch'mozilla', which isn't necessarily installed. However, the
> > example services will check whether 'NSWebBrowser' is set and use
> > the specified web browser instead of 'mozilla'.
> > In most cases this should work fine, though I'm not entirely
> > convinced that this is the way it should be implemented.
> Nah, that shouldn't be the way to do it. Back in the OPENSTEP days
> when NSWorkspace didn't have an openURL: method, one used to call
> OmniWeb's Open URL service, which is somewhat similar to the
> simplistic NSWebBrowser default approach. Nowadays the correct thing
> to do would be to resemble an approach that OS X or KDE (probably
> GNOME, too) implement, which is to refer to something like the
> InternetConfig (buried in OS X's CoreServices) and let this handle the
> appropriate scheme (if it can handle it). After all, these schemes can
> be a variety of protocols, most likeley HTTP but also FTP and NEWS.
> 'NSWebBrowser' is probably too simplistic. Whether this configuration
> is in the scope of Preferences.app or GWorkspace.app I'm not sure (I
> tend to think the latter).
> Then again, on non-Unixes (Win32) it's probably not clear whether the 
> underlying infrastructure (Probably some Registry keys) would have to 
> be used.
> Just my thoughts, still no solutions, duh.

I admit, I do not know how OSX does it (since I don't have a Mac), but
the following might be an idea:

  if the argument is a file
  {
    call -openFile:
  }
  else // this is a replacement for current the 'return NO'
  {
    look for NSWebBrowser

    ask NSPasteboard for NSURLServicePasteboard
    add the argument to it

    if NSWebBrowser is not set
    {
      look for NSURLService

      if NSURLService doesn't exist
      {
        assume "Open URL"
      }

      NSPerformService(NSURLService, NSURLServicePasteboard)
     }
     else // NSWebBrowser is set
     {
       add the argument
       fire up NSWebBrowser
     }
  }

I played with an implementation of it. If there's an application
implementing NSURLService (or "Open URL") the respective application is
started, otherwise it will launch the specified browser (if there is
one). The worst that will happen is a message like "gnustep doesn't know
what to do with your request". Oh well...

But since WebCore is almost completely ported, there's hope ;-)

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]