[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: New KDE printing system
From:       joerg habenicht <j.habenicht () stud ! uni-hannover ! de>
Date:       2001-02-28 15:59:43
[Download RAW message or body]

On Wed, 28 Feb 2001, Michael Goffioul wrote:

> The problem of deleting is double: the factory doesn't know the object has
> been deleted, and all settings are lost. The first problem can be solved by
> adding code in KPrinter destructor to tell the factory the object is deleted.
> But the most important thing is that user settings are lost: imagine setting
> the same options each time you want to print... Then why not save the

nasty !

> KPrinter state ? Answer: why not keep the KPrinter object ? Qt solves this

right, saving the state looks very useful.

> by having a static QPrintDialog object. I am solving this by having a factory
> (singleton) which is responsible for KPrinter creation and deletion.
> 
> Michael.

after reading the thread furtheron,

how about that solution:
1) 
make Construktor, Destructor and Copyconstruktor protected and generate
everything by a Factory or a private static KPrinter method (or both)


or different from that
2)
give the class a static data pointer
which is implicidly shared between the instances.
the latter has 
the disadvantage of accessing the same data with different tasks and
threads 
and the advantage of looking consistent with QPrinter ;-)



cu,
Joerg

-- 
THE full automatic planets host
:-)                            http://www.planetsserver.com

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GE/CS/IT d- s+:- a- C++ ULS+++>++++ P++ L+++>++++$ 
E W++ N+(+++) !o? !K? w--(---) !O(++) !M !PS !PE !Y? PGP+ 
t-- 5-- X-- tv+ b++ DI+() D-(+) G>+ e++>+++ h+(*) r% y? UF
------END GEEK CODE BLOCK------
"Man sollte das Leben nicht so ernst nehmen, 
 Du überlebt es sowieso nicht."

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic