[Digikam-devel] [Bug 164442] manage videos just like photos

Gilles Caulier caulier.gilles at gmail.com
Thu Aug 2 15:33:55 BST 2012


https://bugs.kde.org/show_bug.cgi?id=164442

Gilles Caulier <caulier.gilles at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marcel.wiesweg at gmx.de

--- Comment #35 from Gilles Caulier <caulier.gilles at gmail.com> ---
Abhinav,

Adavanced Search tool GUI is located here in reprository :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/show/utilities/searchwindow?rev=development%2F3.0.0

With my previous patch introducing video search fields, i patched :

- SearchGroup::setup() where i add Video Properties section with fields
relevant. Each fields are identified by a string name, as "format" from
"Picture Properties" for exemple. The declaration of fields is simple in
SearchGroup class but require to change another class to have effect on GUI.
- SearchField::createField() implement how a GUI will manage a field for end
user. If you look at "format" properties, it will provide a clickable link to
pop-up a list of possible values to use. Values are passed to a QStringList.
For each value, you set a pair of strings. The first is to query in DB, and
second to display in GUI. There are some other GUI possibility, for ex. to set
a range of values. Look my patch for details.

When GUI is patch you need to implement the way to use this fields in way to
query DB. The Adv Search tool use an XML string to query the DB, through a
dedicated interface located here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/changes/libs/database/searchxml.h?rev=development%2F3.0.0

SearchXML can encode a query from Adv. Search tool GUI to an XML string,
including section, fields, values,  groups, sub-groups, operators, etc... This
XML is string is passed to DB to query really data through SQL. With XML you
can create complex queries, human readable to hack, intead to play with SQL
directly.

Advanced Search tool call SearchXML interface by :

==> 
https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchwindow.cpp?rev=development%2F3.0.0#L130

... When press Ok button from dialog.

==> Which emit searchEdited() with current XML string generated by view this
method :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchview.cpp?rev=development%2F3.0.0#L293

... where SearchXmlWriter is used.

==> signal emitted arrive to this slot :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchtabheader.cpp?rev=development%2F3.0.0#L566

... where xml string is passed to create or update AlbumManager content with
the query to use. Note that XML string is directly stored in DB for future use,
in case of you save search album.

==> AlbumManager pass XML query here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/digikam/album/albummanager.cpp?rev=development%2F3.0.0#L2691

... to the AlbumDB class to query the database of course, through addSearch()
method. This one re-route the query to DatabaseCoreBackend class...

==> The most important part to patch to implement Video Search query, is
ImageQueryBuilder, with is the XML query to SQL translator, especially in
ImageQueryBuilder::buildField() method, where each search fields are
implemented as SQL query. You will find the inverse wrap using same field names
than  SearchField class use...

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/libs/database/imagequerybuilder.cpp?rev=development%2F3.0.0#L779

Gilles Caulier

-- 
You are receiving this mail because:
You are the assignee for the bug.



More information about the Digikam-devel mailing list