Re: Runtime error "you need to call Settings::instance before using"

2023-02-26 Thread Martin Schnitkemper
Am Samstag, 25. Februar 2023, 11:41:42 CET schrieb Albert Astals Cid:

> Why are you adding PDF only options to the general config file and general
> config dialog instead of to the PDF generator config file and PDF generator
> config dialog/page?

Moved the configuration to the Backend Configuration, looks now like this:
https://invent.kde.org/martin-de/okular/uploads/82757d49a7fe7daa4ffa872f5f6ca4b6/Screenshot_20230225_144426.png

It seems to work now: the configuration is saved and can be retrieved and set
as default before printing, and the print dialog no longer crashes after
invoking it.

Should I create a merge request now?

Cheers,
Martin





Re: Runtime error "you need to call Settings::instance before using"

2023-02-25 Thread Albert Astals Cid
El divendres, 24 de febrer de 2023, a les 12:34:59 (CET), Martin Schnitkemper 
va escriure:
> Am Donnerstag, 23. Februar 2023, 23:32:15 CET schrieben Sie:
> 
> Hello Albert,
> 
> > Please push your code as a Merge Request so we can see it, much easier to
> > comment on code when we can see it :)
> 
> Thank you for your response.

Please keep the list on copy :)

> 
> I forked the project and created a branch:
> https://invent.kde.org/martin-de/okular/-/tree/wish%23463732
> 
> There you are able to review the code, these are the changes:
> https://invent.kde.org/martin-de/okular/-/commit/1df9d5a500241b0cfae860b1e1b
> d1d604dde7439

Why are you adding PDF only options to the general config file and general 
config 
dialog instead of to the PDF generator config file and PDF generator config 
dialog/page?

> 
> I opend also an issue where I described the problem more detailed:
> https://invent.kde.org/martin-de/okular/-/issues/1
> 
> You can leave your comments there, since I dropped myself from the
> mailinglist due to the traffic.

Which trafic? the bug emails? You need to learn about email filtering :)

Cheers,
  Albert

> 
> Cheers,
> Martin






Re: Runtime error "you need to call Settings::instance before using"

2023-02-23 Thread Albert Astals Cid
El dijous, 19 de gener de 2023, a les 9:43:30 (CET), Martin Schnitkemper va 
escriure:
> Hello,
> 
> I tried to extend okular to save PDF-Print-Options (wish #463732).  All
> works well so far, I added a new item in the configuration dialog and the
> new variable "PageScaleMode" is written to and read from "okularpartrc",
> but I am not able to assign the value of "Okular::Settings::pageScaleMode"
> to "m_scaleMode->setCurrentIndex" in module "generator_pdf.cpp".
> 
> Compilation is successful, but it crashes on runtime after opening the print
> dialog. Message on terminal is "you need to call Settings::instance before
> using".
> 
> I am not too familiar with C++ coding and it is my first try to extend an
> application.  I inspected already the other modules of the project where the
> developers used "Okular::Settings::" in a similar & working way, but I
> could not find out so far, where the instance has been set for a proper
> usage.
> 
> Can anyone tell me what I missed, or guide me to a code example of the
> okular project where I can see how to get right access to the
> "Okular::Settings::"?

Please push your code as a Merge Request so we can see it, much easier to 
comment on code when we can see it :)

Cheers,
  Albert

> 
> Thank you in advance for your support,
> Martin