Digikam/CodingSprint2014: Difference between revisions

From KDE Community Wiki
(Created page with "== KDE Graphics Coding Sprint 2011 == The KDE Graphics coding sprint 2011 will take place at [http://www.genova-turismo.it/spip.php?lang=en Genoa, Italia], from January 13h ...")
 
m (395 revisions imported)
 
(394 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== KDE Graphics Coding Sprint 2011 ==
== KDE Framework Port ==


The KDE Graphics coding sprint 2011 will take place at [http://www.genova-turismo.it/spip.php?lang=en Genoa, Italia], from January 13h to 15th 2012. It's organized by Gilles Caulier and Angelo Naseli.
=== Branches Creation ===


=== Location  ===
All port code must be stored in dedicated "frameworks" git branch for each project. Branch must be created from master.


==== Hotel  ====
<source lang="bash">
$>git checkout master
$>git pull --rebase
$>git checkout -b frameworks
$>git push origin frameworks:frameworks
$>git branch -a
* frameworks
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/frameworks
  remotes/origin/master
</source>


*HOTEL HELVETIA - P.ZZA DELLA NUNZIATA ,1 - 16124 GENOVA - TEL. 010.2465468 - FAX 010.2470627
*Prize for one night for one single room : 50,00 €
*See [http://www.hotelhelvetiagenova.it/ this url] for details about this hotel.
*There is a [http://maps.google.com/maps?q=hotelhelvetiagenova&hl=it&ll=44.41585,8.926177&spn=0.01922,0.052314&sll=37.0625,-95.677068&sspn=43.443045,107.138672&vpsrc=6&hq=hotelhelvetiagenova&radius=15000&t=m&z=15 Street-View link there] to see the front of Hotel.
*The hotel is quite near Piazza Principe rail station, has a garage but it's better to use public transportation


==== Moving in Genova ====
KF5 Repositories list is given below :


*We are working on having a little bus to go.
* [https://projects.kde.org/projects/kde/kdegraphics/libs/libkexiv2/repository/show?rev=frameworks Libkexiv2]
* [https://projects.kde.org/projects/kde/kdegraphics/libs/libkdcraw/repository/show?rev=frameworks Libkdcraw]
* [https://projects.kde.org/projects/kde/kdegraphics/libs/libkipi/repository/show?rev=frameworks Libkipi]
* [https://projects.kde.org/projects/kde/kdegraphics/libs/libkface/repository/show?rev=frameworks Libkface]
* [https://projects.kde.org/projects/extragear/libs/libkgeomap/repository/show?rev=frameworks Libkgeomap]
* [https://projects.kde.org/projects/extragear/graphics/digikam/digikam-software-compilation/repository/show?rev=frameworks digiKam Software Compilation]
* [https://projects.kde.org/projects/extragear/graphics/kipi-plugins/repository/show?rev=frameworks Kipi-plugins]
* [https://projects.kde.org/projects/extragear/graphics/digikam/repository/show?rev=frameworks digiKam]


==== Coding Place  ====
=== Kipi-plugins Refactoring ===


*[http://www.alid.it Alid Association, Via Torti 35, 16143 Genova, Italia]
A lots of tools are not maintained since a while, other one have been never finalized. See the list of plugins which will be ported or not :


*There is a [http://maps.google.it/maps?q=Via+Giovanni+Torti,+35,+16143+Genova+Genova,+Liguria,+Italia&hl=en&ll=44.407052,8.964179&spn=0.006124,0.009645&sll=44.406971,8.964429&sspn=0.006295,0.006295&layer=c&cbp=13,156.48,,0,-10.38&cbll=44.407077,8.964049&hnear=Via+Giovanni+Torti,+35,+16143+Genova,+Liguria&t=m&z=17&vpsrc=0&panoid=rIU63D6KwlPSuS6he-Qg9A Street-View link here] to see the front of Alid Association.
* Tools which can be ported as well :
** panorama
** expoblending
** gpssync
** sendimages
** timeadjust
** metadataedit
** videoslideshow
** advancedslideshow
** flashexport
** kmlexport
** acquireimages
** calendar
** dngconverter
** printimages
** imageviewer


*Look at [http://www.genova-turismo.it/spip.php?rubrique12 Genoa Tourism desk web site] to see all details and maps to acces on the city.
* Tools in pending stage :
** dlnaexport              <=== Needs HUpnp lib Qt5 port
** htmlexport              <=== Nobody maintain this code since a while, but tool still used.
** photolayoutseditor  <=== A complex but powerful tool. Will be complex to port.
** removeredeyes      <=== We can share red eyes removal core implementation in libkface in way to share with other KDE applications and replace digiKam Image Editor tool by this code. A new digiKam BQM tool must be created. A GSoC 2015 project can be planned about this topic.


=== Participants ===
* Web export tools which must be factored (same settings widgets, common dialog, common high level interface to process import/export). Another GSoC 2015 project can be planned about this topic.
** facebook
** picasawebexport
** rajceexport
** shwup
** debianscreenshots
** dropbox
** googledrive
** imageshackexport
** kioexportimport
** piwigoexport
** smug
** flickrexport
** yandexfotki
** mediawiki                <=== need to port libmediawiki from extragear/libs/.
** vkontakte                  <=== require libkvkontakte from extragear/libs/.
 
* Tools never finalized (can be moved to attic for the moment) :
** imgurexport            <=== require libqtkoauth from SF.net
** photivointegration
** jalbumexport
** wallpaper
 
* Tools obsolete  (can be moved to attic for the moment) :
** batchprocessimages <=== replaced by digiKam BQM
** rawconverter            <=== replaced by digiKam BQM
** jpeglossless              <=== replaced by new digiKam core tool
** kopete                      <=== KF5 will use new API
** ipodexport                <=== work only with very old Apple devices.
** galleryexport            <=== Gallery web service is not maintained since a while. Gallery project is dead.
 
=== KF5/Qt5 Port Status ===
 
==== Libkexiv2 ====


{| border="1" class="wikitable"
{| border="1" class="wikitable"
|-
|-
! Name
! Component
! Project
! Cmake port
! E-mail
! pure Qt5 port
! Phone
! pure KF5 port
! Arrival
! compile
! Departure
! warnings
! Travel Arrangements
! Who
! Travel Costs
! Remarks
! Hotel Arrangements and Costs
! Total Costs
! Room no.
|-
|-
| '''libkexiv2/src'''
| done
| done
| done
| yes
| no
| Gilles, Laurent
|
* C++ auto_ptr warnings from Exiv2 API disabled.
* Library depend of :
** KF5::I18n (translations)
** KF5::TextWidgets (MsgTextEdit is based on KTextEdit)
|-
| '''libkexiv2/tests'''
| done
| done
| done
| yes
| no
| Gilles, Laurent
|Code do not depend of KF5
|}


==== Libkdcraw ====


| [http://www.linux.it/~sc/italiano/blog/?page_id=179 Stefano Canepa]
{| border="1" class="wikitable"
| the man who is taking care of logistics
|-
| sc at linux_dot_it
! Component
| (+39).34.77.68.01.55
! Cmake port
| -
! pure Qt5 port
| -
! pure KF5 port
| -
! compile
| -
! warnings
| -
! Who
| -
! Remarks
| -
|-
 
| '''libkdcraw/src'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Veaceslav
|
* C++ auto_ptr warnings from Libraw API disabled.
* ThreadWeaver and Solid dependencies removed.
* RActionThreadBase is ported to QThreadPool + QRunnable API instead ThreadWeaver.
* KIntNumInput and KDoubleNumInput are deprecated and removed as dependencies. We use Krita Int and Double input widgets instead. See [https://bugs.kde.org/show_bug.cgi?id=284216 bug #284216] for details.
* Library depend of:
** KF5::I18n (translations).
** KF5::ConfigCore (KConfigGroup used in widgets).
|-
|-
| '''libkdcraw/tests'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Veaceslav
|
* Code do not depend of KF5
*Multithreaded RAW to PNG GUI test program now use DCrawSettingsWidget to tune Raw decoding settings, and is ported to RActionThreadBase to process conversions on all core CPU.
|}


| [https://plus.google.com/109802167766760530845/about Angelo Naseli]
==== Libkipi ====
| Developer, hosting event
| anaselli at linux_dot_it
| (+39).34.73.57.65.18
| -
| -
| -
| -
| -
| -
| -


{| border="1" class="wikitable"
|-
|-
! Component
! Cmake port
! pure Qt5 port
! pure KF5 port
! compile
! warnings
! Who
! Remarks
|-
| '''libkipi/src'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Mohamed
|
* libkipi/version.h file renamed as libkipi_config.h to host only SO version ID shared with kipi plugins.
* API changes a little bit : path() => url().
*Library depend of :
** KF5::I18n (translations)
** KF5::Config (KConfigGroup and KSharedConfig)
** KF5::XmlGui (plugins based on KXMLGuiCLient)
** KF5::Service (plugins use KService)
|-
| '''libkipi/test'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Mohamed
|
* moc header must be placed at end of plugin implementation. See all plugin_helloworld.cpp comments for details.
* K_PLUGIN_EXPORT macro at start of plugin implementation can be dropped.
* '''kbuildsycoca5 --noincremental''' must be run to found new plugin installed on the system if KF5 is not the current active desktop.
|}


| [http://www.digikam.org/drupal/blog/3 Gilles Caulier]
==== Libkface ====
| Lead developer, Student mentoring
| caulier_dot_gilles at gmail_dot_com
| (+33).06.88.12.20.48
| 12 january (22:00 at Genoa airport)
| 15 january (13:00 at Genoa airport)
| Plane from Marseille France, to Genoa Italia, via Paris
| 330€
| 1 room, 1 person, 3 nights (12/13/14), cost 150€
| 480€
| 226


{| border="1" class="wikitable"
|-
! Component
! Cmake port
! pure Qt5 port
! pure KF5 port
! compile
! warnings
! Who
! Remarks
|-
|-
| '''libkface/src'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|Library only depend of KF5::I18n
|-
| '''libkface/tests'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
| Code do not depend of KF5
|}


| [http://www.digikam.org/drupal/blog/8 Marcel Wiesweg]
==== Libkgeomap ====
| Lead developer, Student mentoring
| marcel_dot_wiesweg at gmx_dot_de
| (+49).17.12.08.69.33
| 12 january (11:20 at Genoa airport)
| 15 january (11:55 at Genoa airport)
| Plane from Düsseldorf Germany, to Genoa Italia
| 214€
| 1 room, 1 person, 3 nights (12/13/14), cost 150€
| 364€
| 553


{| border="1" class="wikitable"
|-
|-
! Component
! Cmake port
! pure Qt5 port
! pure KF5 port
! compile
! warnings
! Who
! Remarks
|-
| '''libkgeomap/src'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu, Mohamed
|
* Library depend of:
** KF5::I18n (translations).
** KF5::Config (KConfigGroup used in widgets).
* Needs Marble code from [https://projects.kde.org/projects/kde/kdeedu/marble/repository/show?rev=master master git branch] compiled with cmake option '''-DQT5BUILD=ON'''.
* <span style="background:salmon">TODO</span> We need to detect the Marble version somehow, to avoid linking KF5 build against Qt4 version of Marble. We still use FindMarble cmake script from KDE4. Marble need to be ported as pure KF5 frameworks component.
* <span style="background:lightgreen">DONE</span> KHTML based class HTMLWidget must be ported to Qt5::Webkit.
|-
| '''libkgeomap/tests'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|
|-
| '''libkgeomap/calibrator'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|
|-
| '''libkgeomap/demo'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|
* Needs libkexiv2 from KF5 to compile (optional).
|}


| [https://plus.google.com/113237307210359236747/about Francesco Riosa]
==== Kipi-plugins ====
| Lead developer, working on digiKam database interface improvement, especially Mysql support.
| francesco at pnpitalia_dot_it
| (+39).39.20.78.48.22
| 13 january
| 15 january
| Car/bus from Torino to Genoa, Italia
| 50€
| 1 room, 1 person, 2 nights (13/14), cost 100€
| 150€
| -


{| border="1" class="wikitable"
|-
! Component
! Cmake port
! pure Qt5 port
! pure KF5 port
! compile
! warnings
! Who
! Remarks
|-
| '''Kipi-plugins/common'''
| done
| uncomplete
| uncomplete
| yes
| yes
|Gilles, Laurent
|
* New MacroLocalLibs.cmake wrapper added to handle local or system wide shared libraries.
* Plugins must be linked at least with:
**KF5::Parts
**KF5::KDELibs4Support
**${KF5Kipi_LIBRARIES}
**${KF5KExiv2_LIBRARIES}
**${KF5KDcraw_LIBRARIES}
**KF5kipiplugins
* Use '''kipiplugins_debug.h''' header in plugins to handle debug space.
* ${KF5*_LIBRARIES} are populated by MacroLocalLibs.cmake
* Add a new common class to process images resizement based SendImage::ImageResize
|-
| '''Kipi-plugins/tests'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
|
|-
| '''Kipi-plugins Documentation'''
| done
| not applicable
| not applicable
| yes
| no
| Gilles
|
|-
| '''Kipi-plugins/timeadjust'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
|
|-
| '''Kipi-plugins/sendimages'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
|
|-
| '''Kipi-plugins/kmlexport'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
|
|-
| '''Kipi-plugins/printimages'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
| Postscript support have been removed from QPrinter. Option is now removed from assistant.
|-
|-
| '''Kipi-plugins/flashexport'''
| done
| uncomplete
| uncomplete
| yes
| no
|Gilles, Laurent
|
|}


| [https://plus.google.com/109282675370620103497/about Benjamin Girault]
==== digiKam Software Compilation ====
| GoSC - Kipi-plugin Panorama tool
| benjamin_dot_girault at gmail_dot_com
| (+33).0X.XX.XX.XX.XX
| 12 january (22:00 at Genoa Airport)
| 16 january (13:30 at Genoa Airport)
| Plane from Paris France, to Genoa Italia
| 138€
| 1 room, 1 person, 4 nights (12/13/14/15), cost 200€
| 338€
| 222


{| border="1" class="wikitable"
|-
! Component
! Cmake port
! pure Qt5 port
! pure KF5 port
! compile
! warnings
! Who
! Remarks
|-
|-
| '''digiKam Software Compilation'''
| done
| not applicable
| not applicable
| not applicable
| not applicable
| Gilles
|
* 2 new Cmake options have been add to enable/disable digiKam core and Kipi-plugins compilation (digiKam still disabled by default for the moment).
* List of checkout repositories managed by "download-repos" scripts is reduced to current sub projects already ready to support KF5. "frameworks" branches are automatically switched. See ".gitslaves" for details.
* New MacroLocalLibs.cmake must be used in Kipi-plugins and digiKam Core to wrap local or system libraries (libkipi, likdcraw, libkexiv2, etc) when compilation is done under SC or not.
|-
| '''digiKam Documentation'''
| done
| not applicable
| not applicable
| yes
| no
| Gilles
|
|}


| [https://plus.google.com/112704180165376149546/about Łukasz Spas]
==== digiKam Core ====
| SoK - Photo Layouts Editor
| lukasz_dot_spas at gmail_dot_com
| (+48).725.972.566
| 12 January (11:20 at Genoa Airport)
| 15 January (11:55 at Genoa Airport)
| Plane from Cracow Poland to Genoa Italia via Monachium
| 300€
| 1 room, 1 person, 3 nights (12/13/14), cost 150€
| 450€
| 223


{| border="1" class="wikitable"
|-
|-
 
! Component
| [https://plus.google.com/102278849478968549402/about Dhruvkumar Patel]
! Cmake port
| SoK - digiKam Presentation mode
! pure Qt5 port
| dhruvkumarr_dot_patel51 at gmail_dot_com
! pure KF5 port
| (+91).88.66.22.29.81
! compile
| 12 January (19:20 at Genoa Airport)
! warnings
| 16 January (9:45 at Genoa Airport)
! Who
| Plane from Ahmedabad India to Genoa Italy via New Delhi India and Rome Italy
! Remarks
| 800€ (including European Visa)
|-
| 1 room, 1 person, 4 nights (12/13/14/15), cost 200€
| '''digiKam/data'''
| 1000€
| done
| 447
| not applicable
 
| not applicable
| yes
| no
| Gilles, Laurent
|
|-
| '''digiKam/libs'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu, Alin, Veaceslav
|
* <span style="background:salmon">TODO</span> ProxyLineEdit is based on KLineEdit and must be ported to QLineEdit, but it use KLineEdit::clearButtonUsedSize() which do not exist with QLineEdit.
* <span style="background:orange">UNCOMPLETE</span> SearchTextBar is based on KLineEdit and must be ported to QLineEdit, but it use completion model class ModelCompletion  based on KCompletion Which must be ported to QCompleter.
* <span style="background:lightgreen">DONE</span> ICCSettings : Q_WS__X11 have been removed with Qt5. X11 detection is performed by CMake and rules are set as definition into digikam_config.h
* <span style="background:salmon">TODO</span> Port LoadingCache from KDirWatch to QFileSystemWatcher.
* <span style="background:salmon">TODO</span> When QFileSystemWtyacher port is complete, check if KInotify still mandatory.
|-
| '''digiKam/app'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu, Alin
|
* <span style="background:orange">UNCOMPLETE</span> AddTagsLineEdit is based on KLineEdit and must be ported to QLineEdit, but it use completion model class ModelCompletion based on KCompletion Which must be ported to QCompleter.
* <span style="background:lightgreen">DONE</span> WelcomePageView ported from KHTMLPart to QWebView. KParts and KHtml dependencies removed from digiKam.
* <span style="background:lightgreen">DONE</span> WelcomePageView HTML rendering is completly broken. Check if CSS and HTML code are conform. Note : this is not due to Qt5 port as KHTML done the same result. New layout introduced to host best users photo as background image. [https://www.flickr.com/photos/digikam/16628134940/ See example here for details].
* <span style="background:lightgreen">DONE</span> MediaPlayerView ported from Phonon to QMediaPlayer. Phonon dependency removed from digiKam. New CMake option add to enable/disable QMediaPlayer support.
* <span style="background:salmon">TODO</span> Port AlbumWatch from KDirWatch to QFileSystemWatcher
|-
| '''digiKam/utilities'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu, Alin, Mohamed
|
* <span style="background:salmon">TODO</span> CameraController use KProcess and KMacroExpander and need to be ported to QProcess.
|-
| '''digiKam/imageplugins'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|
* <span style="background:salmon">TODO</span> Remove editor plugins interface and move tools directly to editor implementation.
|-
|-
 
| '''digiKam/kioslave'''
| [http://martys.typepad.com Martin Klapetek]
| done
| Nepomuk Persons integration with face recognition
| done
| martin dot klapetek at gmail dot com
| done
| +(42).07.37.82.19.62
| yes
| 12 January (around 15:00 at Genoa main station)
| no
| 15 January (around 16:00 from Genoa main station)
| Gilles, Laurent, Teemu
| Plane from Berlin, Germany to Milan, Italy and then train, back to Czech republic
|
| ~100€ (tbd exactly)
* <span style="background:salmon">TODO</span> Remove KIO-Slaves and move code to database core using multithreading. See this [https://community.kde.org/GSoC/2015/Ideas#Project:_Re-write_database_KIO-slaves_as_pure_Qt5_using_multithreading GoSC 2015 project for details].
| 1 room, 1 person, 4 nights (12/13/14), cost 150€
| 250€
| -
 
|-
|-
 
| '''digiKam/showfoto'''
| [http://blogs.fsfe.org/drdanz/ Daniele E. Domenichelli]
| done
| Nepomuk Persons integration with face recognition, KIPI Plugin for Telepathy
| done
| daniele dot domenichelli at gmail dot com
| done
| +(39).349.320.49.81
| yes
| -
| no
| -
| Gilles, Laurent, Teemu
| -
|
| -
| -
| -
| -
 
<!--
 
|-
|-
 
| '''digiKam/databaseserver'''
| [https://plus.google.com/106373262168025221888/about Zhang Jie]
| done
| GoSC - digiKam Clone tool
| done
| zhangjiehangyuan2005 at gmail_dot_com
| done
| (+86).15.268.566.953
| yes
| 12 january
| no
| 16 january
| Gilles, Laurent, Teemu
| Plane from ShangHai China to to Milan Italy
|
| 950€
| 1 room, 1 person, 4 nights (12/13/14/15), cost 160€
| 1110€
| -
 
|-
|-
| '''digiKam/tests'''
| done
| done
| done
| yes
| no
| Gilles, Laurent, Teemu
|
* <span style="background:salmon">TODO</span> 2 test tools do not link yet and are disable from compilation rules
|}


| [https://plus.google.com/108817970507534438439/about Amey Dharwadker]
=== Recommendations ===
| SoK - Face Recognition
| ameydhar at gmail_dot_com
| (+91).98.86.38.67.18
| 12 January
| 15 January
| Plane from Goa India, to Genoa Italy
| 980€ including European Visa (*)
| 1 room, 1 person, 4 nights (12/13/14/15), cost 160€
| 1140€
| -


-->
Porting to KF5 is divided in 4 stages:


|}
1/ Change CMake files. Some Laurent scripts do this stuff. We use now
ECM scripts collection from KDE core to manage dependencies and report on the
console. Some macros disappear, and are replaced by new ones. For this
job, it's recommended to look well all done in CMake files from libkexiv2
and libkdcraw already ported and polished.


2/ Port C++ code using KDE4Support. This include older classes from Qt4
and KDE4 to make transition faster. This will help to have quickly a
code compilable, but this will generate a lots of deprecated warnings.
First regression tests must be done at this stage to see if nothing is broken.


TOTAL COST : 3972 €
3/ Port C++ code to pure KF5. The goal of KF5 is to reduce KDELibs
fingerprint everywhere, when it's possible. Qt API will be used in
priority against KF5 API. But sometime, this will be not possible as
well, without big changes. A lot of KDE API have migrated to Qt5
(as for ex : KUrl -> QUrl and kDebug ->qDebug). It's sound like KDELibs
will become an incubator for new implementations which will move later
to Qt. Also, to have the most of code using pure Qt5 will simplify
future transitions more easy to do. Removing KDE4Support dependency
will force to use non-deprecated KF5 API.


=== Preparation ===
4/ Port C++ code to pure Qt5. Porting most of KF5 Api to use Qt5 instead is
prefered, when it's possible. Another important change in Qt5 is the non-support
of char pointer with QString.


==== To bring  ====
In first stage we must use '''remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)'''
in CMake script to compile code. These definitions force to not use deprecated QString methods.


*Wifi will be available at Alid Association. For non-wifi computers plan a Network gateway and ethernet cables.
Another definition to add while Qt5 porting is '''add_definitions(-DQT_NO_URL_CAST_FROM_STRING)''' about cast between QString and QUrl.
*Plan a video-projector.
*Digital Still Camera (of course).
*Tea and coffee for working hours.


==== To book  ====
In last stage we must use '''remove_definition(-DQT_DEPRECATED_SINCE(5,0))''' in CMake script to compile code. These definitions force to disable deprecated methods in Qt API.


*Food for Mid-day lunch.
=== Common changes to port code ===
*Restaurant for 14 january, Saturday evening.


=== Common Topics for Discussion and Coding  ===
{| border="1" class="wikitable"
|-
! Original Code
! Ported Code
! Remarks
|-
| ...section of code not yet ported...
|
<source lang="cpp-qt">
#pragma message("PORT QT5")
/*
...section of code not yet ported...
*/
</source>
| Not yet ported code sections must be commented with compiler warnings printed on the console
|-
| KDE4_BUILD_TESTS=ON
| '''BUILD_TESTING=ON'''
| CMake flag  to build tests sub-dir.
|-
| CMAKE_BUILD_TYPE=debugfull
| '''CMAKE_BUILD_TYPE=debug'''
| CMake flag  to build code with debug symbols.
|-
| kDebug() / kWarning() / kError()
| '''qCDebug(FOO_LOG) / qCWarning(FOO_LOG) / qCCritical(FOO_LOG)'''
|
* New "foo_debug.h" and "foo_debug.cpp" files must be created to declare debug space.
* "foo_debug.h" is not shared. For shared a library, this header must be placed as private in implementation files, not header files.
|-
|
<source lang="cpp-qt">
#include "foo.moc"
</source>
|
<source lang="cpp-qt">
#include "foo.h"
</source>
|
* To prevent compilation errors with Qt5. Qt will generate moc_foo.h files instead. Header file of a class declaration must be placed on top of included header files list from implementation file.
* Special case : KF5 plugin factory needs moc header file included at end of plugin implementation to prevent broken linking.
|-
|
<source lang="cpp-qt">
KUrl::directory()
</source>
|
<source lang="cpp-qt">
QUrl::adjusted(QUrl::RemoveFilename).path()
</source>
|
|-
|
<source lang="cpp-qt">
KDiskFreeSpaceInfo
</source>
|
<source lang="cpp-qt">
QStorageInfo
</source>
|
|-
|
<source lang="cpp-qt">
KUrl::setFileName(newFileName)
</source>
|
<source lang="cpp-qt">
QUrl::setPath(QUrl::path() + newFileName)
</source>
|
|-
|
<source lang="cpp-qt">
KUrl url;
url.adjustPath(KUrl::AddTrailingSlash);
</source>
|
<source lang="cpp-qt">
QUrl url;
url.setPath(url.path() + '/');
</source>
|
|-
|
<source lang="cpp-qt">
KDialog::spacingHint()
</source>
|
<source lang="cpp-qt">
QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)
</source>
|
|-
|
<source lang="cpp-qt">
KDialog::marginHint()
</source>
|
<source lang="cpp-qt">
QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin)
</source>
|
|-
|
<source lang="cpp-qt">
KComponentData::mainComponent().componentName()
</source>
|
<source lang="cpp-qt">
QApplication::applicationName()
</source>
|
|-
|
<source lang="cpp-qt">
KComponentData::mainComponent().aboutData()->homepage()
</source>
|
<source lang="cpp-qt">
KAboutData::applicationData().homepage()
</source>
|
|-
|
<source lang="cpp-qt">
KIconLoader::SmallIcon("icon_name", size)
</source>
or
<source lang="cpp-qt">
KIconLoader::global()->loadIcon("icon_name", size)
</source>
|
<source lang="cpp-qt">
QIcon::fromTheme("icon_name").pixmap(size)
</source>
|
*Adjust size value :
**Small = 16 (default from KIconLoader::SmallIcon()),
**SmallMedium = 22,
**Medium = 32,
**Large = 48,
**Huge = 64,
**Enormous = 128
* Icon must be installed with desktop theme icons.
|-
|
<source lang="cpp-qt">
KStandardDirs::installPath("data") + QString("filename")
</source>
|
<source lang="cpp-qt">
QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QString("filename"))
</source>
| File to open in read-only. File already exist.


*Model / View (Gilles, Marcel)
|-
**CameraGui icon-view port.
|
**Preview and Image Editor canvas factoring.
<source lang="cpp-qt">
**Complete Qt4 port everywhere. Remove Qt3 transition classes.
KStandardDirs::installPath("xdgdata-apps") + QString("filename")
</source>
|
<source lang="cpp-qt">
QStandardPaths::locate(QStandardPaths::ApplicationsLocation,
QString("filename"))
</source>
| File to open in read-only. File already exist.
|-
|
<source lang="cpp-qt">
KStandardDirs::locateLocal("data", QString("filename"))
</source>
|
<source lang="cpp-qt">
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ '/' + QString("filename")
</source>
| File to open in read-only. File already exist.
|-
|
<source lang="cpp-qt">
QString dir = KStandardDirs::locateLocal("data",
                      QString("dirname"), true)
</source>
|
<source lang="cpp-qt">
QString dir =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ '/' + QString("dirname");
QDir().mkpath(dir);
</source>
| Dir to open in read-write. Create dir if it do not exist.
|-
|
<source lang="cpp-qt">
KUrlLabel
</source>
|
<source lang="cpp-qt">
KDcrawIface::RActiveLabel
</source>
|
* Slot used to process url can be dropped.
|-
|
<source lang="cpp-qt">
KSeparator
</source>
|
<source lang="cpp-qt">
KDcrawIface::RLineWidget
</source>
|
|-
|
<source lang="cpp-qt">
KXmlGuiWindow::restoreWindowSize(group);


<!--
KDialog::restoreDialogSize(group);
*Clone Tool for Image Editor (Gilles, Marcel, Jie)
</source>
**To have a compilable, distributable, and ready to use code.
and
**Complete all production tests of tool.
<source lang="cpp-qt">
**Plan to integrate tool in git/master ([https://bugs.kde.org/show_bug.cgi?id=132483 BKO #132483]).
KXmlGuiWindow::saveWindowSize(group);
-->
<!--
*Face recognition (Marcel, Amey)
**Implementation in libface, feasibility of task.
**libkface interface.
**UI drafts for integration.
-->
*Panorama Tool (Gilles, Benjamin)
**First users feedback analysis.
**Find right solution to fix Hugin tools detection ([https://bugs.kde.org/show_bug.cgi?id=283650 BKO #283650]).


*Database (Marcel, Francesco, Gilles)
KDialog::saveDialogSize(group);
**Improving current implementation of MySQL interface.
</source>
**Talk about the future&nbsp;: Postgresql support ([https://bugs.kde.org/show_bug.cgi?id=127321 BKO #127321]).
|
**Removing old SQlite2 source code from digiKam core ([https://bugs.kde.org/show_bug.cgi?id=237037 BKO #237037]).
<source lang="cpp-qt">
**Fix Database schema upgrading v4 to v5 or v5 to v6 ([https://bugs.kde.org/show_bug.cgi?id=277928 BKO #277928] and [https://bugs.kde.org/show_bug.cgi?id=283502 BKO #283502]).
KWindowConfig::restoreWindowSize(windowHandle(), group);
**Fix thumbnail database ([https://bugs.kde.org/show_bug.cgi?id=277242 BKO #277242])
</source>
**Fix MySql user privilege ([https://bugs.kde.org/show_bug.cgi?id=262321 BKO 262321])
and
**Fix versioning bugs ([https://bugs.kde.org/show_bug.cgi?id=278927 BKO 278927] and [https://bugs.kde.org/show_bug.cgi?id=287772 BKO 287772])
<source lang="cpp-qt">
KWindowConfig::saveWindowSize(windowHandle(), group);
</source>
|
|-
|
<source lang="cpp-qt">
KVBox* const vbox = new KVBox(this);
</source>
|
<source lang="cpp-qt">
KDcrawIface::RVBox* const vbox = new KDcrawIface::RVBox(this);
</source>
|
|-
|
<source lang="cpp-qt">
KHBox* const hbox = new KHBox(this);
</source>
|
<source lang="cpp-qt">
KDcrawIface::RHBox* const hbox = new KDcrawIface::RHBox(this);
</source>
|
|-
|
<source lang="cpp-qt">
KIO::NetAccess::del(url, QApplication::activeWindow());


*Metadata (Gilles, Marcel)
KIO::NetAccess::mkdir(url, QApplication::activeWindow());
**Completing XMP sidecar support for read only files. ([https://bugs.kde.org/show_bug.cgi?id=220545 BKO #220545]).
**Background processing in digiKam ([https://bugs.kde.org/show_bug.cgi?id=173632 BKO #173632], [https://bugs.kde.org/show_bug.cgi?id=227814 BKO #227814], [https://bugs.kde.org/show_bug.cgi?id=222401 BKO #222401]).


*Photo Layout Editor (Gilles, Łukasz)
KIO::NetAccess::dircopy(srcUrl, dstUrl, QApplication::activeWindow())
**First users feedback analysis ([https://bugs.kde.org/show_bug.cgi?id=283321 BKO #283321]).
</source>
**Talk about future functionalities ([https://bugs.kde.org/show_bug.cgi?id=149936 BKO #149936]), and [https://bugs.kde.org/buglist.cgi?query_format=advanced&short_desc_type=allwordssubstr&short_desc=&product=digikamimageplugins&component=Super-Impose&long_desc_type=substring&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= Superimpose tool integration].
|
<source lang="cpp-qt">
auto deleteJob = KIO::file_delete(url);
KJobWidgets::setWindow(deleteJob, QApplication::activeWindow());
deleteJob->exec();


*Presentation Mode for Album-View (Marcel, Patel)
auto mkdirJob = KIO::mkdir(url);
**To have a compilable, distributable, and ready to use code.
KJobWidgets::setWindow(mkdirJob, QApplication::activeWindow());
**Complete all production tests of mode.
mkdirJob->exec();
**Plan to integrate tool in git/master.


*Nepomuk PIMO:Person integration (Martin, Marcel, Daniele, anyone)
auto dircopyJob = KIO::copy(srcUrl, dstUrl);
**Integrate PIMO:Persons with DigiKam's face recognition and add semantic capabilities around that
KJobWidgets::setWindow(dircopyJob, QApplication::activeWindow());
**Related [https://bugs.kde.org/show_bug.cgi?id=279404 bug 279404]
dircopyJob->exec();
</source>
|
|-
|
<source lang="cpp-qt">
KD::rename(src, dst)
</source>
|
<source lang="cpp-qt">
QFile::rename(src, dst)
</source>
|
|-
|
<source lang="cpp-qt">
KToolInvocation::invokeBrowser(url)
</source>
|
<source lang="cpp-qt">
QDesktopServices::openUrl(url)
</source>
|
|-
|
<source lang="cpp-qt">
KGlobalSettings::singleClick()
</source>
|
<source lang="cpp-qt">
qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)
</source>
|
|-
|
<source lang="cpp-qt">
KUrl::directory(KUrl::ObeyTrailingSlash)
</source>
|
<source lang="cpp-qt">
QUrl url = adjusted(QUrl::RemoveFilename);
url.adjusted(QUrl::StripTrailingSlash).path()
</source>
|
|-
|
<source lang="cpp-qt">
KImageIO::typeForMime(str)
</source>
|
<source lang="cpp-qt">
QMimeDatabase().mimeTypeForName(str)
</source>
|
|-
|
<source lang="cpp-qt">
KTemporaryFile temp;
temp.setPrefix(prefixStr);
temp.setSuffix(suffixStr);
</source>
|
<source lang="cpp-qt">
QTemporaryFile temp;
temp.setFileTemplate(prefixStr + QLatin1String("XXXXXX") + suffixStr);
</source>
|
|-
|
<source lang="cpp-qt">
K_GLOBAL_STATIC
</source>
|
<source lang="cpp-qt">
Q_GLOBAL_STATIC
</source>
|
|-
|
<source lang="cpp-qt">
KMenu::addTitle()
</source>
|
<source lang="cpp-qt">
QMenu::addSection()
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::locate("data", "file")
</source>
|
<source lang="cpp-qt">
QStandardPaths::locate(QStandardPaths::GenericDataLocation, "file")
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::locateLocal("data", "file")
</source>
|
<source lang="cpp-qt">
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QChar('/') + QString("file")
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::locateLocal("appdata", "file")
</source>
|
<source lang="cpp-qt">
QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+ QChar('/') + QString("file")
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::locateLocal("cache", "file")
</source>
|
<source lang="cpp-qt">
QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)
+ QChar('/') + QString("file")
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::locateLocal("tmp", "file")
</source>
|
<source lang="cpp-qt">
QDir::tempPath() + QChar('/') + QString("file")
</source>
|
|-
|
<source lang="cpp-qt">
KStandardDirs::makeDir(path, permission);
</source>
|
<source lang="cpp-qt">
if (!QDir(path).exists())
{
    if (QDir().mkpath(path))
    {
        QFile f(path);
        f.setPermissions(permission);
    }
}
</source>
|
permission = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser = 0700
|-
|
<source lang="cpp-qt">
KUrlRequester
</source>
|
<source lang="cpp-qt">
KDcrawIface::RFileSelector
</source>
|
To select local only file or path, no need KUrlRequester.
|-
|
<source lang="cpp-qt">
KActionMenu
</source>
|
<source lang="cpp-qt">
QMenu
</source>
|
Use QMenu::menuAction() to get Action instance of menu to plug in action collection.
|-
|
<source lang="cpp-qt">
KToggleAction
</source>
|
<source lang="cpp-qt">
QAction
</source>
|
Use QAction::setCheckable(true) to switch Action as toggle state.
|-
|
<source lang="cpp-qt">
QUrl url;
url.addQueryItem(key, value);
</source>
|
<source lang="cpp-qt">
QUrl url;
QUrlQuery q(url);
q.addQueryItem(key, value);
url.setQuery(q);
</source>
|
|-
|
<source lang="cpp-qt">
QPixmap pix, alphaMask;
pix.setAlphaChannel(mask);
</source>
|
<source lang="cpp-qt">
QPixmap pix, alphaMask;
QPainter p(&pix);
p.setOpacity(0.2);
p.drawPixmap(0, 0, alphaMask);
p.end();
</source>
|
|}


*Telepathy KIPI Plugin (Daniele)
=== Link to documentation to port code ===
**Write a KIPI Plugin to send images to Telepathy contacts


=== Food  ===
* [https://community.kde.org/Frameworks/Porting_Notes KDE4 to KF5 porting guide]


My suggestions:
* [http://api.kde.org/frameworks-api/frameworks5-apidocs/kdelibs4support/html/deprecated.html KDE4 deprecated list]


*There is many possibilities in Genoa town (pizza, baggels, sushi, sandwich, etc.)
* [http://api.kde.org/frameworks-api/frameworks5-apidocs/kdelibs4support/html/classKCalendarSystem.html#a6853ea0521ea23923d3a104b1a178782 KCalendarSystem format strings] to port to [http://doc.qt.io/qt-5/qdate.html#toString QDate format strings] and [http://doc.qt.io/qt-5/qtime.html#toString QTime format strings]


*Last year in France we went to a restaurant for dinner Saturday evening, I enjoyed that quite much. I would suggest us we continue in this tradition this year as well. We need to find a not too expensive restaurants in Genoa city center.
* [https://community.kde.org/Frameworks/Porting_Notes/KStandardDirs KStandardDirs to Qt5 porting guide]


*Anyway, let's me hear your food preferences below:
* [http://api.kde.org/frameworks-api/frameworks5-apidocs/index.html KF5 API]


* [http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5 Qt4 to Qt5 porting guide]


{| border="1" class="wikitable"
* [http://qt-project.org/doc/qt-5/classes.html Qt5 API]
|-
! Name
! Food Preference
|-


| Gilles Caulier
* [https://projects.kde.org/projects/qt5?jump=repository Qt5 project]
| None


|-
* [http://api.kde.org/ecm/index.html ECM - Documentation]


| Dhruv Patel
* [https://techbase.kde.org/Development/ECM_SourceIncompatChanges ECM - KDELibs4 macro port]
| Vegetarian Food


|-
* [https://projects.kde.org/projects/kdesupport/extra-cmake-modules ECM - Extra CMake Module project]


| Francesco Riosa
=== Scripts to port code  ===
| Local Food


|}
Laurent Montel has written scripts to port CMake and C++ code to KF5/Qt5 and remove kdelibs4support dependency. There are available [https://projects.kde.org/projects/kde/kdesdk/kde-dev-scripts/repository/revisions/master/show/kf5 in this repository] (see kf5 sub-dir).


=== Reimbursements  ===
Scripts must be applied in this order, with a test compilation between each one :


*Only travel costs and hotels can be reimbursed, through KDE-ev sponsorship. Take a look on [http://ev.kde.org/rules/reimbursement_policy.php this page to know the policy].
* Full safe scripts :
*The form to be reimbursed after the event can be [http://ev.kde.org/resources/expense_report.pdf downloaded there].
** convert-to-k4aboutdata.pl (first one to apply, this help to compile)
*Sent filled form plus all bills by post to [http://ev.kde.org/contact.php Kde-ev office].
** adapt_cmakelists_file.pl (to convert CMake scripts, but code must don't be capititalized)
** remove-kde4support.pl
** convert-kicon.pl
** convert-kmenu.pl
** convert-kshortcut.pl
** convert-kcolordialog.pl
** convert-klistwidget.pl
** convert-kmd5.pl
** convert-kmenubar.pl
** convert-ksplashscreen.pl
** convert-kdebug.pl


=== Sponsorship  ===
* Less safe scripts :
** convert-kintnuminput.pl
** convert-kintspinbox.pl
** convert-ktextbrowser.pl
** convert-kfontcombobox.pl


*http://www.digikam.org/files/images/ev_large.thumbnail.png The event will be sponsored be [http://ev.kde.org KDE-ev].
* Scripts which need to check in-deep all changes :
** convert-kvbox.pl
** convert-kdialog.pl
** convert-kcmdlineargs.pl
** convert-kdebug-with-argument.sh (this one change kDebug(1556) en qCDebug with some info after to convert)
** convert-kmimetype.pl


*To become a sponsor, please make a donation following [http://www.digikam.org/drupal/donation this page...]
* Last scripts to apply :
** clean-forward-declaration.sh (remove forward declaration, to do when all compile fine)
** clean-includes.sh (try to remove not used includes, not safe to 100%)
** port_to_autogenerate_export_header.sh (convert to new signal/slot API, not safe to 100%)

Latest revision as of 17:45, 18 March 2016

KDE Framework Port

Branches Creation

All port code must be stored in dedicated "frameworks" git branch for each project. Branch must be created from master.

$>git checkout master
$>git pull --rebase
$>git checkout -b frameworks
$>git push origin frameworks:frameworks
$>git branch -a
* frameworks
  master
  remotes/origin/HEAD -> origin/master
  remotes/origin/frameworks
  remotes/origin/master


KF5 Repositories list is given below :

Kipi-plugins Refactoring

A lots of tools are not maintained since a while, other one have been never finalized. See the list of plugins which will be ported or not :

  • Tools which can be ported as well :
    • panorama
    • expoblending
    • gpssync
    • sendimages
    • timeadjust
    • metadataedit
    • videoslideshow
    • advancedslideshow
    • flashexport
    • kmlexport
    • acquireimages
    • calendar
    • dngconverter
    • printimages
    • imageviewer
  • Tools in pending stage :
    • dlnaexport <=== Needs HUpnp lib Qt5 port
    • htmlexport <=== Nobody maintain this code since a while, but tool still used.
    • photolayoutseditor <=== A complex but powerful tool. Will be complex to port.
    • removeredeyes <=== We can share red eyes removal core implementation in libkface in way to share with other KDE applications and replace digiKam Image Editor tool by this code. A new digiKam BQM tool must be created. A GSoC 2015 project can be planned about this topic.
  • Web export tools which must be factored (same settings widgets, common dialog, common high level interface to process import/export). Another GSoC 2015 project can be planned about this topic.
    • facebook
    • picasawebexport
    • rajceexport
    • shwup
    • debianscreenshots
    • dropbox
    • googledrive
    • imageshackexport
    • kioexportimport
    • piwigoexport
    • smug
    • flickrexport
    • yandexfotki
    • mediawiki <=== need to port libmediawiki from extragear/libs/.
    • vkontakte <=== require libkvkontakte from extragear/libs/.
  • Tools never finalized (can be moved to attic for the moment) :
    • imgurexport <=== require libqtkoauth from SF.net
    • photivointegration
    • jalbumexport
    • wallpaper
  • Tools obsolete (can be moved to attic for the moment) :
    • batchprocessimages <=== replaced by digiKam BQM
    • rawconverter <=== replaced by digiKam BQM
    • jpeglossless <=== replaced by new digiKam core tool
    • kopete <=== KF5 will use new API
    • ipodexport <=== work only with very old Apple devices.
    • galleryexport <=== Gallery web service is not maintained since a while. Gallery project is dead.

KF5/Qt5 Port Status

Libkexiv2

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkexiv2/src done done done yes no Gilles, Laurent
  • C++ auto_ptr warnings from Exiv2 API disabled.
  • Library depend of :
    • KF5::I18n (translations)
    • KF5::TextWidgets (MsgTextEdit is based on KTextEdit)
libkexiv2/tests done done done yes no Gilles, Laurent Code do not depend of KF5

Libkdcraw

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkdcraw/src done done done yes no Gilles, Laurent, Veaceslav
  • C++ auto_ptr warnings from Libraw API disabled.
  • ThreadWeaver and Solid dependencies removed.
  • RActionThreadBase is ported to QThreadPool + QRunnable API instead ThreadWeaver.
  • KIntNumInput and KDoubleNumInput are deprecated and removed as dependencies. We use Krita Int and Double input widgets instead. See bug #284216 for details.
  • Library depend of:
    • KF5::I18n (translations).
    • KF5::ConfigCore (KConfigGroup used in widgets).
libkdcraw/tests done done done yes no Gilles, Laurent, Veaceslav
  • Code do not depend of KF5
  • Multithreaded RAW to PNG GUI test program now use DCrawSettingsWidget to tune Raw decoding settings, and is ported to RActionThreadBase to process conversions on all core CPU.

Libkipi

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkipi/src done done done yes no Gilles, Laurent, Mohamed
  • libkipi/version.h file renamed as libkipi_config.h to host only SO version ID shared with kipi plugins.
  • API changes a little bit : path() => url().
  • Library depend of :
    • KF5::I18n (translations)
    • KF5::Config (KConfigGroup and KSharedConfig)
    • KF5::XmlGui (plugins based on KXMLGuiCLient)
    • KF5::Service (plugins use KService)
libkipi/test done done done yes no Gilles, Laurent, Mohamed
  • moc header must be placed at end of plugin implementation. See all plugin_helloworld.cpp comments for details.
  • K_PLUGIN_EXPORT macro at start of plugin implementation can be dropped.
  • kbuildsycoca5 --noincremental must be run to found new plugin installed on the system if KF5 is not the current active desktop.

Libkface

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkface/src done done done yes no Gilles, Laurent, Teemu Library only depend of KF5::I18n
libkface/tests done done done yes no Gilles, Laurent, Teemu Code do not depend of KF5

Libkgeomap

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkgeomap/src done done done yes no Gilles, Laurent, Teemu, Mohamed
  • Library depend of:
    • KF5::I18n (translations).
    • KF5::Config (KConfigGroup used in widgets).
  • Needs Marble code from master git branch compiled with cmake option -DQT5BUILD=ON.
  • TODO We need to detect the Marble version somehow, to avoid linking KF5 build against Qt4 version of Marble. We still use FindMarble cmake script from KDE4. Marble need to be ported as pure KF5 frameworks component.
  • DONE KHTML based class HTMLWidget must be ported to Qt5::Webkit.
libkgeomap/tests done done done yes no Gilles, Laurent, Teemu
libkgeomap/calibrator done done done yes no Gilles, Laurent, Teemu
libkgeomap/demo done done done yes no Gilles, Laurent, Teemu
  • Needs libkexiv2 from KF5 to compile (optional).

Kipi-plugins

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
Kipi-plugins/common done uncomplete uncomplete yes yes Gilles, Laurent
  • New MacroLocalLibs.cmake wrapper added to handle local or system wide shared libraries.
  • Plugins must be linked at least with:
    • KF5::Parts
    • KF5::KDELibs4Support
    • ${KF5Kipi_LIBRARIES}
    • ${KF5KExiv2_LIBRARIES}
    • ${KF5KDcraw_LIBRARIES}
    • KF5kipiplugins
  • Use kipiplugins_debug.h header in plugins to handle debug space.
  • ${KF5*_LIBRARIES} are populated by MacroLocalLibs.cmake
  • Add a new common class to process images resizement based SendImage::ImageResize
Kipi-plugins/tests done uncomplete uncomplete yes no Gilles, Laurent
Kipi-plugins Documentation done not applicable not applicable yes no Gilles
Kipi-plugins/timeadjust done uncomplete uncomplete yes no Gilles, Laurent
Kipi-plugins/sendimages done uncomplete uncomplete yes no Gilles, Laurent
Kipi-plugins/kmlexport done uncomplete uncomplete yes no Gilles, Laurent
Kipi-plugins/printimages done uncomplete uncomplete yes no Gilles, Laurent Postscript support have been removed from QPrinter. Option is now removed from assistant.
Kipi-plugins/flashexport done uncomplete uncomplete yes no Gilles, Laurent

digiKam Software Compilation

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
digiKam Software Compilation done not applicable not applicable not applicable not applicable Gilles
  • 2 new Cmake options have been add to enable/disable digiKam core and Kipi-plugins compilation (digiKam still disabled by default for the moment).
  • List of checkout repositories managed by "download-repos" scripts is reduced to current sub projects already ready to support KF5. "frameworks" branches are automatically switched. See ".gitslaves" for details.
  • New MacroLocalLibs.cmake must be used in Kipi-plugins and digiKam Core to wrap local or system libraries (libkipi, likdcraw, libkexiv2, etc) when compilation is done under SC or not.
digiKam Documentation done not applicable not applicable yes no Gilles

digiKam Core

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
digiKam/data done not applicable not applicable yes no Gilles, Laurent
digiKam/libs done done done yes no Gilles, Laurent, Teemu, Alin, Veaceslav
  • TODO ProxyLineEdit is based on KLineEdit and must be ported to QLineEdit, but it use KLineEdit::clearButtonUsedSize() which do not exist with QLineEdit.
  • UNCOMPLETE SearchTextBar is based on KLineEdit and must be ported to QLineEdit, but it use completion model class ModelCompletion based on KCompletion Which must be ported to QCompleter.
  • DONE ICCSettings : Q_WS__X11 have been removed with Qt5. X11 detection is performed by CMake and rules are set as definition into digikam_config.h
  • TODO Port LoadingCache from KDirWatch to QFileSystemWatcher.
  • TODO When QFileSystemWtyacher port is complete, check if KInotify still mandatory.
digiKam/app done done done yes no Gilles, Laurent, Teemu, Alin
  • UNCOMPLETE AddTagsLineEdit is based on KLineEdit and must be ported to QLineEdit, but it use completion model class ModelCompletion based on KCompletion Which must be ported to QCompleter.
  • DONE WelcomePageView ported from KHTMLPart to QWebView. KParts and KHtml dependencies removed from digiKam.
  • DONE WelcomePageView HTML rendering is completly broken. Check if CSS and HTML code are conform. Note : this is not due to Qt5 port as KHTML done the same result. New layout introduced to host best users photo as background image. See example here for details.
  • DONE MediaPlayerView ported from Phonon to QMediaPlayer. Phonon dependency removed from digiKam. New CMake option add to enable/disable QMediaPlayer support.
  • TODO Port AlbumWatch from KDirWatch to QFileSystemWatcher
digiKam/utilities done done done yes no Gilles, Laurent, Teemu, Alin, Mohamed
  • TODO CameraController use KProcess and KMacroExpander and need to be ported to QProcess.
digiKam/imageplugins done done done yes no Gilles, Laurent, Teemu
  • TODO Remove editor plugins interface and move tools directly to editor implementation.
digiKam/kioslave done done done yes no Gilles, Laurent, Teemu
digiKam/showfoto done done done yes no Gilles, Laurent, Teemu
digiKam/databaseserver done done done yes no Gilles, Laurent, Teemu
digiKam/tests done done done yes no Gilles, Laurent, Teemu
  • TODO 2 test tools do not link yet and are disable from compilation rules

Recommendations

Porting to KF5 is divided in 4 stages:

1/ Change CMake files. Some Laurent scripts do this stuff. We use now ECM scripts collection from KDE core to manage dependencies and report on the console. Some macros disappear, and are replaced by new ones. For this job, it's recommended to look well all done in CMake files from libkexiv2 and libkdcraw already ported and polished.

2/ Port C++ code using KDE4Support. This include older classes from Qt4 and KDE4 to make transition faster. This will help to have quickly a code compilable, but this will generate a lots of deprecated warnings. First regression tests must be done at this stage to see if nothing is broken.

3/ Port C++ code to pure KF5. The goal of KF5 is to reduce KDELibs fingerprint everywhere, when it's possible. Qt API will be used in priority against KF5 API. But sometime, this will be not possible as well, without big changes. A lot of KDE API have migrated to Qt5 (as for ex : KUrl -> QUrl and kDebug ->qDebug). It's sound like KDELibs will become an incubator for new implementations which will move later to Qt. Also, to have the most of code using pure Qt5 will simplify future transitions more easy to do. Removing KDE4Support dependency will force to use non-deprecated KF5 API.

4/ Port C++ code to pure Qt5. Porting most of KF5 Api to use Qt5 instead is prefered, when it's possible. Another important change in Qt5 is the non-support of char pointer with QString.

In first stage we must use remove_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII) in CMake script to compile code. These definitions force to not use deprecated QString methods.

Another definition to add while Qt5 porting is add_definitions(-DQT_NO_URL_CAST_FROM_STRING) about cast between QString and QUrl.

In last stage we must use remove_definition(-DQT_DEPRECATED_SINCE(5,0)) in CMake script to compile code. These definitions force to disable deprecated methods in Qt API.

Common changes to port code

Original Code Ported Code Remarks
...section of code not yet ported...
#pragma message("PORT QT5")
/*
...section of code not yet ported...
*/
Not yet ported code sections must be commented with compiler warnings printed on the console
KDE4_BUILD_TESTS=ON BUILD_TESTING=ON CMake flag to build tests sub-dir.
CMAKE_BUILD_TYPE=debugfull CMAKE_BUILD_TYPE=debug CMake flag to build code with debug symbols.
kDebug() / kWarning() / kError() qCDebug(FOO_LOG) / qCWarning(FOO_LOG) / qCCritical(FOO_LOG)
  • New "foo_debug.h" and "foo_debug.cpp" files must be created to declare debug space.
  • "foo_debug.h" is not shared. For shared a library, this header must be placed as private in implementation files, not header files.
#include "foo.moc"
#include "foo.h"
  • To prevent compilation errors with Qt5. Qt will generate moc_foo.h files instead. Header file of a class declaration must be placed on top of included header files list from implementation file.
  • Special case : KF5 plugin factory needs moc header file included at end of plugin implementation to prevent broken linking.
KUrl::directory()
QUrl::adjusted(QUrl::RemoveFilename).path()
KDiskFreeSpaceInfo
QStorageInfo
KUrl::setFileName(newFileName)
QUrl::setPath(QUrl::path() + newFileName)
KUrl url;
url.adjustPath(KUrl::AddTrailingSlash);
QUrl url;
url.setPath(url.path() + '/');
KDialog::spacingHint()
QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)
KDialog::marginHint()
QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin)
KComponentData::mainComponent().componentName()
QApplication::applicationName()
KComponentData::mainComponent().aboutData()->homepage()
KAboutData::applicationData().homepage()
KIconLoader::SmallIcon("icon_name", size)

or

KIconLoader::global()->loadIcon("icon_name", size)
QIcon::fromTheme("icon_name").pixmap(size)
  • Adjust size value :
    • Small = 16 (default from KIconLoader::SmallIcon()),
    • SmallMedium = 22,
    • Medium = 32,
    • Large = 48,
    • Huge = 64,
    • Enormous = 128
  • Icon must be installed with desktop theme icons.
KStandardDirs::installPath("data") + QString("filename")
QStandardPaths::locate(QStandardPaths::GenericDataLocation,
QString("filename"))
File to open in read-only. File already exist.
KStandardDirs::installPath("xdgdata-apps") + QString("filename")
QStandardPaths::locate(QStandardPaths::ApplicationsLocation,
QString("filename"))
File to open in read-only. File already exist.
KStandardDirs::locateLocal("data", QString("filename"))
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ '/' + QString("filename")
File to open in read-only. File already exist.
QString dir = KStandardDirs::locateLocal("data",
                       QString("dirname"), true)
QString dir =
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ '/' + QString("dirname");
QDir().mkpath(dir);
Dir to open in read-write. Create dir if it do not exist.
KUrlLabel
KDcrawIface::RActiveLabel
  • Slot used to process url can be dropped.
KSeparator
KDcrawIface::RLineWidget
KXmlGuiWindow::restoreWindowSize(group);

KDialog::restoreDialogSize(group);

and

KXmlGuiWindow::saveWindowSize(group);

KDialog::saveDialogSize(group);
KWindowConfig::restoreWindowSize(windowHandle(), group);

and

KWindowConfig::saveWindowSize(windowHandle(), group);
KVBox* const vbox = new KVBox(this);
KDcrawIface::RVBox* const vbox = new KDcrawIface::RVBox(this);
KHBox* const hbox = new KHBox(this);
KDcrawIface::RHBox* const hbox = new KDcrawIface::RHBox(this);
KIO::NetAccess::del(url, QApplication::activeWindow());

KIO::NetAccess::mkdir(url, QApplication::activeWindow());

KIO::NetAccess::dircopy(srcUrl, dstUrl, QApplication::activeWindow())
auto deleteJob = KIO::file_delete(url);
KJobWidgets::setWindow(deleteJob, QApplication::activeWindow());
deleteJob->exec();

auto mkdirJob = KIO::mkdir(url);
KJobWidgets::setWindow(mkdirJob, QApplication::activeWindow());
mkdirJob->exec();

auto dircopyJob = KIO::copy(srcUrl, dstUrl);
KJobWidgets::setWindow(dircopyJob, QApplication::activeWindow());
dircopyJob->exec();
KD::rename(src, dst)
QFile::rename(src, dst)
KToolInvocation::invokeBrowser(url)
QDesktopServices::openUrl(url)
KGlobalSettings::singleClick()
qApp->style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick)
KUrl::directory(KUrl::ObeyTrailingSlash)
QUrl url = adjusted(QUrl::RemoveFilename);
url.adjusted(QUrl::StripTrailingSlash).path()
KImageIO::typeForMime(str)
QMimeDatabase().mimeTypeForName(str)
KTemporaryFile temp;
temp.setPrefix(prefixStr);
temp.setSuffix(suffixStr);
QTemporaryFile temp;
temp.setFileTemplate(prefixStr + QLatin1String("XXXXXX") + suffixStr);
K_GLOBAL_STATIC
Q_GLOBAL_STATIC
KMenu::addTitle()
QMenu::addSection()
KStandardDirs::locate("data", "file")
QStandardPaths::locate(QStandardPaths::GenericDataLocation, "file")
KStandardDirs::locateLocal("data", "file")
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ QChar('/') + QString("file")
KStandardDirs::locateLocal("appdata", "file")
QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+ QChar('/') + QString("file")
KStandardDirs::locateLocal("cache", "file")
QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)
+ QChar('/') + QString("file")
KStandardDirs::locateLocal("tmp", "file")
QDir::tempPath() + QChar('/') + QString("file")
KStandardDirs::makeDir(path, permission);
if (!QDir(path).exists())
{
    if (QDir().mkpath(path))
    {
         QFile f(path);
         f.setPermissions(permission);
    }
}

permission = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser = 0700

KUrlRequester
KDcrawIface::RFileSelector

To select local only file or path, no need KUrlRequester.

KActionMenu
QMenu

Use QMenu::menuAction() to get Action instance of menu to plug in action collection.

KToggleAction
QAction

Use QAction::setCheckable(true) to switch Action as toggle state.

QUrl url;
url.addQueryItem(key, value);
QUrl url;
QUrlQuery q(url);
q.addQueryItem(key, value);
url.setQuery(q);
QPixmap pix, alphaMask;
pix.setAlphaChannel(mask);
QPixmap pix, alphaMask;
QPainter p(&pix);
p.setOpacity(0.2);
p.drawPixmap(0, 0, alphaMask);
p.end();

Link to documentation to port code

Scripts to port code

Laurent Montel has written scripts to port CMake and C++ code to KF5/Qt5 and remove kdelibs4support dependency. There are available in this repository (see kf5 sub-dir).

Scripts must be applied in this order, with a test compilation between each one :

  • Full safe scripts :
    • convert-to-k4aboutdata.pl (first one to apply, this help to compile)
    • adapt_cmakelists_file.pl (to convert CMake scripts, but code must don't be capititalized)
    • remove-kde4support.pl
    • convert-kicon.pl
    • convert-kmenu.pl
    • convert-kshortcut.pl
    • convert-kcolordialog.pl
    • convert-klistwidget.pl
    • convert-kmd5.pl
    • convert-kmenubar.pl
    • convert-ksplashscreen.pl
    • convert-kdebug.pl
  • Less safe scripts :
    • convert-kintnuminput.pl
    • convert-kintspinbox.pl
    • convert-ktextbrowser.pl
    • convert-kfontcombobox.pl
  • Scripts which need to check in-deep all changes :
    • convert-kvbox.pl
    • convert-kdialog.pl
    • convert-kcmdlineargs.pl
    • convert-kdebug-with-argument.sh (this one change kDebug(1556) en qCDebug with some info after to convert)
    • convert-kmimetype.pl
  • Last scripts to apply :
    • clean-forward-declaration.sh (remove forward declaration, to do when all compile fine)
    • clean-includes.sh (try to remove not used includes, not safe to 100%)
    • port_to_autogenerate_export_header.sh (convert to new signal/slot API, not safe to 100%)