diff --git a/core/libs/album/treeview/albumtreeview.cpp b/core/libs/album/treeview/albumtreeview.cpp index 249ce6660f..64f7539b75 100644 --- a/core/libs/album/treeview/albumtreeview.cpp +++ b/core/libs/album/treeview/albumtreeview.cpp @@ -1,105 +1,106 @@ /* ============================================================ * * This file is a part of digiKam project * https://www.digikam.org * * Date : 2009-03-25 * Description : Tree View for album models * * Copyright (C) 2009-2011 by Marcel Wiesweg * Copyright (C) 2010-2011 by Andi Clemens * Copyright (C) 2014 by Mohamed_Anwer * Copyright (C) 2014 by Michael G. Hansen * Copyright (C) 2009-2019 by Gilles Caulier * * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software Foundation; * either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * ============================================================ */ #include "albumtreeview.h" #include "abstractalbumtreeview_p.h" namespace Digikam { AlbumTreeView::AlbumTreeView(QWidget* const parent, Flags flags) : AbstractCheckableAlbumTreeView(parent, flags) { setDragEnabled(true); setAcceptDrops(true); - setAutoScroll(false); + setAutoScroll(false); // Workaround for bug 400960 setRootIsDecorated(false); setDropIndicatorShown(false); setAutoExpandDelay(AUTOEXPANDDELAY); if (flags & CreateDefaultModel) { setAlbumModel(new AlbumModel(AlbumModel::IncludeRootAlbum, this)); } } AlbumTreeView::~AlbumTreeView() { } void AlbumTreeView::setAlbumModel(AlbumModel* const model) { // changing model is not implemented if (m_albumModel) { return; } AbstractCheckableAlbumTreeView::setAlbumModel(model); m_dragDropHandler = albumModel()->dragDropHandler(); if (!m_dragDropHandler) { m_dragDropHandler = new AlbumDragDropHandler(albumModel()); model->setDragDropHandler(m_dragDropHandler); } } void AlbumTreeView::setAlbumFilterModel(CheckableAlbumFilterModel* const filterModel) { AbstractCheckableAlbumTreeView::setAlbumFilterModel(filterModel); } AlbumModel* AlbumTreeView::albumModel() const { return dynamic_cast(m_albumModel); } PAlbum* AlbumTreeView::currentAlbum() const { return dynamic_cast (m_albumFilterModel->albumForIndex(currentIndex())); } PAlbum* AlbumTreeView::albumForIndex(const QModelIndex& index) const { return dynamic_cast (m_albumFilterModel->albumForIndex(index)); } void AlbumTreeView::setCurrentAlbums(const QList& albums, bool selectInAlbumManager) { AbstractCheckableAlbumTreeView::setCurrentAlbums(albums, selectInAlbumManager); + scrollToSelectedAlbum(); // Workaround for bug 400960 } void AlbumTreeView::setCurrentAlbum(int albumId, bool selectInAlbumManager) { PAlbum* const album = AlbumManager::instance()->findPAlbum(albumId); setCurrentAlbums(QList() << album, selectInAlbumManager); } } // namespace Digikam diff --git a/project/bundles/appimage/data/AppRun b/project/bundles/appimage/data/AppRun index f431c853df..0cad17c858 100755 --- a/project/bundles/appimage/data/AppRun +++ b/project/bundles/appimage/data/AppRun @@ -1,115 +1,141 @@ #!/bin/bash # Main AppImage script to wrap XDG_* variable properly for Qt5. # -# Copyright (c) 2015-2018, Gilles Caulier, +# Copyright (c) 2015-2019, Gilles Caulier, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # -if [[ "$(arch)" = "x86_64" ]] ; then - export LD_PRELOAD=$LD_PRELOAD:/usr/lib64/libfreetype.so - export LD_PRELOAD=$LD_PRELOAD:/usr/lib64/libudev.so -else - export LD_PRELOAD=$LD_PRELOAD:/usr/lib/libfreetype.so - export LD_PRELOAD=$LD_PRELOAD:/usr/lib/libudev.so -fi +preload_shared_library () +{ + FILE=$1 + echo $FILE + + if [[ "$(arch)" = "x86_64" ]] ; then + # 64 bits system + + if [ -f "/usr/lib64/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/usr/lib64/$FILE + elif [ -f "/usr/lib/x86_64-linux-gnu/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/usr/lib/x86_64-linux-gnu/$FILE + elif [ -f "/lib/x86_64-linux-gnu/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/lib/x86_64-linux-gnu/$FILE + fi + + else + # 32 bits system + + if [ -f "/usr/lib/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/usr/lib/$FILE + elif [ -f "/usr/lib/i386-linux-gnu/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/usr/lib/i386-linux-gnu/$FILE + elif [ -f "/lib/i386-linux-gnu/$FILE" ] ; then + export LD_PRELOAD=$LD_PRELOAD:/lib/i386-linux-gnu/$FILE + fi + + fi +} +preload_shared_library libfreetype.so +preload_shared_library libudev.so +exit echo "-- digiKam AppImage Bundle" echo "-- Use 'help' as CLI argument to know all available options for digiKam application" +echo "-- Preloading shared libs: $LD_PRELOAD" DIR="`dirname \"$0\"`" DIR="`( cd \"$DIR\" && pwd )`" export APPDIR=$DIR export APPIMAGE_ORIGINAL_LD_LIBRARY_PATH=$LD_LIBRARY_PATH export APPIMAGE_ORIGINAL_QT_PLUGIN_PATH=$QT_PLUGIN_PATH export APPIMAGE_ORIGINAL_XDG_DATA_DIRS=$XDG_DATA_DIRS export APPIMAGE_ORIGINAL_PATH=$PATH export LD_LIBRARY_PATH=$DIR/usr/lib/:$LD_LIBRARY_PATH export QT_PLUGIN_PATH=$DIR/usr/plugins/ export XDG_DATA_DIRS=$DIR/usr/share/:$XDG_DATA_DIRS export PATH=$DIR/usr/bin:$DIR/usr/lib:$DIR/usr/lib/libexec/kf5:$DIR/usr/share/digikam/utils:$PATH export KDE_FORK_SLAVES=1 export CAMLIBS=$DIR/usr/lib/libgphoto2 export IOLIBS=$DIR/usr/lib/libgphoto2_port # code to disable Plasma desktopk detection with QDesktopService export APPIMAGE_ORIGINAL_KDE_FULL_SESSION=$KDE_FULL_SESSION export APPIMAGE_ORIGINAL_DESKTOP_SESSION=$DESKTOP_SESSION export APPIMAGE_ORIGINAL_XDG_CURRENT_DESKTOP=$XDG_CURRENT_DESKTOP export APPIMAGE_ORIGINAL_XDG_SESSION_DESKTOP=$XDG_SESSION_DESKTOP #unset KDE_FULL_SESSION #unset DESKTOP_SESSION #unset XDG_CURRENT_DESKTOP #unset XDG_SESSION_DESKTOP # if no customized Qt debug loggin variable is set, turn on one for a better readability if [ -z "$QT_MESSAGE_PATTERN" ]; then export QT_MESSAGE_PATTERN="`echo -e "\033[34m%{function}\033[0m: %{message}"`" fi export APPIMAGE_STARTUP_LD_LIBRARY_PATH=$LD_LIBRARY_PATH export APPIMAGE_STARTUP_QT_PLUGIN_PATH=$QT_PLUGIN_PATH export APPIMAGE_STARTUP_XDG_DATA_DIRS=$XDG_DATA_DIRS export APPIMAGE_STARTUP_PATH=$PATH # Parse CLI options. if [[ $1 == "showfoto" ]] ; then # Run Showfoto as well. showfoto ${@:2} elif [[ $1 == "debug" ]] ; then if [[ $2 == "showfoto" ]] ; then # Showfoto in debug mode. echo "Starting Showfoto into GDB..." echo "Use 'bt' command on debugger prompt to get a crash backtrace." echo "Use 'q' command to quit debugger session." gdb -ex=r --args showfoto ${@:3} else # digiKam in debug mode. echo "Starting digiKam into GDB..." echo "Use 'bt' command on debugger prompt to get a crash backtrace." echo "Use 'q' command to quit debugger session." gdb -ex=r --args digikam ${@:2} fi elif [[ $1 == "help" ]] ; then # digiKam/Showfoto CLI help. echo "digiKam AppImage bundle CLI options:" echo " without option : run digiKam." echo " : run Showfoto instead digiKam." echo " : run digiKam into GDB." echo " : run Showfoto into GDB." echo " : run native AppImage script for a desktop integration." echo " : show these information." elif [[ ($1 == "desktopintegration") ]] ; then # Native AppImage CLI options. echo "Call native AppImage CLI tools for desktop integration..." digikam.wrapper $@ else # Run digiKam as well. digikam $@ fi