[KPhotoAlbum] KPhotoAlbum - mailing list and export suggestion with code

Johannes Zarl-Zierl johannes at zarl-zierl.at
Sun Jan 21 22:26:54 GMT 2018


Hello Samuel,

On Sonntag, 21. Jänner 2018 22:25:43 CET Samuel Kay wrote:
>   * How do I easily see the logs produced by KPhotoAlbum. (I have adjust
>     the log level to QtDebugMsg for kphotoalbum.HTMLGenerator in
>     HTMLGenerator/HTMLGenerator) Do you use a grep command?

The easiest way is to set the environment variable QT_LOGGING_RULES:

export QT_LOGGING_RULES="kphotoalbum.HTMLGenerator=true"
kphotoalbum

Alternatively, you can also write a logging configuration file, but that's 
usually not what you want. The details are explained in the api documentation 
for QLoggingCategory[1]

For finding out the possible logging categories, take a look into the 
Logging.cpp files in each source directory of kphotoalbum.

[1]: https://doc.qt.io/qt-5/qloggingcategory.html#configuring-categories

>   * I don't understand from where the export function get its data. I
>     need the same input data. Where is the database on this line
>     Generator.cpp:80
> 
>       ImportExport::Export exp( m_setup.imageList(), kimFileName( false ),
> 
>                                    false, -1, ImportExport::ManualCopy,
> 
>                                    destURL + QDir::separator() +
> m_setup.outputDir(), true, &ok);
> 
> Otherwise, I will use the files in theme/*/kphotoalbum.theme to put some
> more data, and tell if the JS database, the HTML index file or the  HTML
> image file should be generated (this part is nearly working).

The steps for the current HTML export are as follows:
1) The HTMLDialog is shown and fills the fields of a Setup object.
→ the dialog gets a list of selected images

2) Upon clicking "OK", the HTMLDialog calls Generator::generate with the setup 
object and the image list

The ideal place to add your code is IMO the Generator class or a new class 
like it. You could add a new class based on the Generator class and call that 
one from HTMLGenerator::slotOk() instead of the current Generator class.

That way we can easily add an option to choose between the old and the new 
export code, and the new Generator is not pushed into the corset of the old 
Generator.


What is interesting for integrating your work:
 - Does the current html export dialog / the Setup class contain all the 
information that you need?
 - Are there any fields that you don't need?


I hope that I could clear things up for you. Further questions are always 
welcome btw. ;-)

Cheers,
  Johannes




More information about the Kphotoalbum mailing list