Digikam/CodingSprint2014: Difference between revisions

From KDE Community Wiki
Line 522: Line 522:
</source>
</source>
|Adjust size value :
|Adjust size value :
*Small = 16 (default from KIconLoader::SmallIcon())
*Small = 16 (default from KIconLoader::SmallIcon()),
*SmallMedium = 22,
*SmallMedium = 22,
*Medium = 32,
*Medium = 32,

Revision as of 11:51, 2 December 2014

KDE Graphics Coding Sprint 2014

The KDE Graphics coding sprint 2014 will take place at Berlin, Germany, from november 14h to 16th 2014.

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
    • dlnaexport
    • kmlexport
    • acquireimages
    • calendar
    • dngconverter
    • printimages
    • imageviewer
  • Tools in pending stage :
    • 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.
libkexiv2/tests done done done yes no Gilles, Laurent

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.
libkdcraw/tests done done done yes no Gilles, Laurent, Veaceslav
  • 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 uncomplete uncomplete 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().
libkipi/test done uncomplete uncomplete yes yes 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 uncomplete uncomplete yes no Gilles, Laurent, Teemu
libkface/tests done uncomplete uncomplete yes no Gilles, Laurent, Teemu

Libkgeomap

Component Cmake port pure Qt5 port pure KF5 port compile warnings Who Remarks
libkgeomap/src done uncomplete done yes no Gilles, Laurent, Teemu
  • Needs Marble code from kde-frameworks-5 git branch to compile.
  • We need to detect the Marble version somehow, to avoid linking KF5 build against Qt4 version of Marble. Ideas?
  • QT_NO_CAST_ASCII removed from build.
libkgeomap/tests done uncomplete done yes no Gilles, Laurent, Teemu
libkgeomap/calibrator done uncomplete done yes no Gilles, Laurent, Teemu
libkgeomap/demo done uncomplete 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
  • ${KF5*_LIBRARIES} are populated by MacroLocalLibs.cmake
Kipi-plugins/tests done uncomplete uncomplete yes no Gilles, Laurent
Kipi-plugins Documentation done not applicable not applicable yes no Gilles
Kipi-plugins/sendimages done under progress under progress yes yes Gilles, Laurent
Kipi-plugins/printimages done under progress undes progress yes yes Gilles, Laurent
Kipi-plugins/kmlexport done under progress undes progress yes yes Gilles, Laurent
Kipi-plugins/timeadjust done under progress undes progress yes yes Gilles, Laurent
Kipi-plugins/flashexport done under progress undes progress no yes Gilles, Laurent

digiKam

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 (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 todo todo todo

Recommendations

Porting to KF5 is divided in 3 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 Qt5. 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.

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()'''
KUrl::setFileName(newFileName)
QUrl::setPath(QUrl::path() + newFileName)
KDialog::spacingHint()
'QApplication::style()->pixelMetric(QStyle::PM_DefaultLayoutSpacing)'''
KDialog::marginHint()
QApplication::style()->pixelMetric(QStyle::PM_DefaultChildMargin)
KIconLoader::SmallIcon("icon_name", size)
QIcon::fromTheme("icon_name").pixmap(size, size)
Adjust size value :
  • Small = 16 (default from KIconLoader::SmallIcon()),
  • SmallMedium = 22,
  • Medium = 32,
  • Large = 48,
  • Huge = 64,
  • Enormous = 128
KStandardDirs::installPath("data") + QString("filename")
QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last()
+ "/" + QString("filename")
File to open in read-only. File is already created.
KStandardDirs::locateLocal("data", QString("filename"))
QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)
+ '/' + QString("filename")
File to open in read-only. File is already created.
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.

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%)

Image Editor Model/View Fixes and Finalization

CANVAS : full image dimensions not shown when not viewing at 100% zoom level

CANVAS : image shifts position in mouse-over mode when changing between Before and After

CANVAS : mouse-over preview mode does not work

CANVAS : unable to zoom out to less than fit to window

Unable to crop due to image corruption into canvas with not X11 based computers

Import Tool Reports Review and Fixes

Database Reports Review and Fixes

Coding Sprint Notes

Next major task is to port digiKam to Qt5. Approx. 10% is already ported by Gilles. Objectives for this coding sprint:

  • Specify timeline for porting digiKam
  • Identify priorities (what should be ported first)
  • Delegate porting tasks to developers (who does what)


Shourya Singh Gupta works on implementing the Kipi tools functionality in the Batch Queue Manager (Tools Settings).

Marcel Wiesweg works on memory consumption in database and the bug with JPEG (and RAW) image preview on high-resolution screens. Also see https://bugs.kde.org/show_bug.cgi?id=205776

He work also to complete the Removable collection support. The goal is to show thumbnails from disconnected media, but not editable as well. A feedback to the user is provided to indicate that items and collection are not available, but users can continue to search and preview collection through database. See bugs https://bugs.kde.org/show_bug.cgi?id=191494 and https://bugs.kde.org/show_bug.cgi?id=114539.

MySQL support is now disabled by default because it's not fully functional and still experimental. MySQL support still fully available of course, but as an optional feature.

Gilles has polished whole libkgeomap public API to be ready for KF5 port. A lots of changes have been applied to reduce binary compatibility issues, especially, if library will be moved somewhere in KDE core to be more easily used by another project as KPhotoAlbum, like it have been done recently about libkface.