List Info

Thread: Documents without files?




Documents without files?
user name
2007-10-08 16:20:32
Hi,

I'm currently implementing diff() for the reworked
subversion plugin and
am wondering if KDevelop4 allows to have documents without
an actual
file?

I'm just curious because maybe the widget displaying the
diff could be
based on a kdevelop document and thus be visible in the
editor area,
instead of having either a toolview (probably too small
anyway) or a
standalone dialog with the widget.

So are documents without actual url's possible with the
current
API/Platform?

Andreas

-- 
You are scrupulously honest, frank, and straightforward. 
Therefore you
have few friends.

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Documents without files?
country flaguser name
United States
2007-10-08 18:49:02
On Monday 08 October 2007 04:20:32 pm Andreas Pakulat
wrote:
> Hi,
>
> I'm currently implementing diff() for the reworked
subversion plugin and
> am wondering if KDevelop4 allows to have documents
without an actual
> file?
>
> I'm just curious because maybe the widget displaying
the diff could be
> based on a kdevelop document and thus be visible in the
editor area,
> instead of having either a toolview (probably too small
anyway) or a
> standalone dialog with the widget.
>
> So are documents without actual url's possible with the
current
> API/Platform?
>
> Andreas

I'm not sure, but I want to say "yes".

If it's not already possible, it should be made possible
IMHO. We could want 
to save that diff to somewhere, for example. Or start
editing a file w/o 
creating it first or adding it to the project.
-- 
Matt

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Documents without files?
country flaguser name
Ukraine
2007-10-09 10:02:03
On Tuesday 09 October 2007 00:20, Andreas Pakulat wrote:
> So are documents without actual url's possible with the
current
> API/Platform?

If what you need is a text document shown in kate part
without any url you can 
use create PartDocument with KUrl() just like
UiController::openEmptyDocument 
does:
    PartDocument *doc = new PartDocument(KUrl(),
Core::self());
    Sublime::View *view = doc->createView();
    activeArea()->addView(view);
    activeSublimeWindow()->activateView(view);

If you want your own document (say with your own diff
widget), create your own 
subclass of IDocument that returns KUrl() as url. Docs with
empty urls 
shouldn't break the shell (dunno about plugins that might
rely on urls).

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

Re: Documents without files?
user name
2007-10-09 10:51:37
On 09.10.07 18:02:03, Alexander Dymo wrote:
> On Tuesday 09 October 2007 00:20, Andreas Pakulat
wrote:
> > So are documents without actual url's possible
with the current
> > API/Platform?
> 
> If what you need is a text document shown in kate part
without any url you can 
> use create PartDocument with KUrl() just like
UiController::openEmptyDocument 
> does:
>     PartDocument *doc = new PartDocument(KUrl(),
Core::self());
>     Sublime::View *view = doc->createView();
>     activeArea()->addView(view);
>     activeSublimeWindow()->activateView(view);

That doesn't work, because PartDocument is part of the Shell
and I'm
doing something in a plugin. All I have is the
IDocumentController
interface which only allows to open a document with a url
and looks up
the right document type to create (i.e. the right factory)
using the
mimetype of the document.

Also I think the documentForUrl() will break if I'm using a
non-existing
KUrl.

> If you want your own document (say with your own diff
widget), create your own 
> subclass of IDocument that returns KUrl() as url. Docs
with empty urls 
> shouldn't break the shell (dunno about plugins that
might rely on urls).

See above, the problem is opening such a document as there's
no API to
do that without a url that creates a proper mimetype. 

Andreas

-- 
Try to relax and enjoy the crisis.
		-- Ashleigh Brilliant

_______________________________________________
KDevelop-devel mailing list
KDevelop-develkdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinf
o/kdevelop-devel

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )