From afc582fbd8513cf42423b8510334e90744d398fa Mon Sep 17 00:00:00 2001 From: Alf Gaida Date: Fri, 25 May 2018 19:12:55 +0200 Subject: [PATCH] Cherry-picking upstream release 0.7.0. * Removed build dependency libfm-dev * Removed build dependency libmenu-cache-dev * Bumped build dependency libfm-qt-def to >= 0.13.0~ * Bumped build dependency lxqt-build-tools to >= 0.5.0~ * Moved debian/.gitignore to ./.gitignore --- .gitignore | 7 +++++ AUTHORS | 4 +-- CHANGELOG | 17 ++++++++++- CMakeLists.txt | 6 ++-- README.md | 27 ++++++++++++------ debian/.gitignore | 8 ------ debian/changelog | 11 ++++++++ debian/control | 7 ++--- debian/source/options | 1 - release.sh | 28 ------------------- src/CMakeLists.txt | 8 ++++-- src/application.cpp | 7 +++-- src/imageview.cpp | 2 +- src/loadimagejob.cpp | 2 +- src/mainwindow.cpp | 11 ++++---- src/preferencesdialog.cpp | 7 +++-- .../lximage-qt-screenshot_es.desktop | 3 ++ src/translations/lximage-qt_es.desktop | 3 ++ 18 files changed, 87 insertions(+), 72 deletions(-) create mode 100644 .gitignore delete mode 100644 debian/.gitignore delete mode 100755 release.sh create mode 100644 src/translations/lximage-qt-screenshot_es.desktop create mode 100644 src/translations/lximage-qt_es.desktop diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3aa8432 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +debian/*.debhelper +debian/*.log +debian/*.substvars +debian/debhelper-build-stamp +debian/files + +debian/lximage-qt/ diff --git a/AUTHORS b/AUTHORS index f82d468..db919a9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,9 +1,9 @@ Upstream Authors: - LXQt team: http://lxqt.org + LXQt team: https://lxqt.org Hong Jen Yee (PCMan) Copyright: - Copyright (c) 2013-2017 LXQt team + Copyright (c) 2013-2018 LXQt team License: GPL-2+ and LGPL-2.1+ The full text of the licenses can be found in the 'COPYING' file. diff --git a/CHANGELOG b/CHANGELOG index f5a9d3e..21fc42d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,7 +1,22 @@ -lximage-qt-0.6.0 / 2017-10-21 +lximage-qt-0.7.0 / 2018-05-21 ============================= + * Bumped minor version to 7 + * Spanish translation update + * Just made it compilable again + * Removed not needed release.sh + * CMake: Prevent in-source builds + * fix some http->https + * Fix some mentions of LXDE + * Drop Qt foreach + * cmake: Handle CMP0071 + * Add Spanish desktop entries + +0.6.0 / 2017-10-21 +================== + + * Release 0.6.0: Update changelog * Add ImageShack upload provider. * Fix warnings issued by GCC and Clang. * Ensure file is closed when upload finishes. diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f1d464..ddc96c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,13 +4,14 @@ project(lximage-qt) include(GNUInstallDirs) set(MAJOR_VERSION 0) -set(MINOR_VERSION 6) +set(MINOR_VERSION 7) set(PATCH_VERSION 0) set(LXIMAGE_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}) -set(LXQTBT_MINIMUM_VERSION "0.4.0") +set(LXQTBT_MINIMUM_VERSION "0.5.0") set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -26,6 +27,7 @@ find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) find_package(Exif REQUIRED) message(STATUS "Building with Qt ${Qt5Core_VERSION}") +include(LXQtPreventInSourceBuilds) include(LXQtCompilerSettings NO_POLICY_SCOPE) # TODO: make the X11 stuff optional. diff --git a/README.md b/README.md index 13a554a..1ee11b2 100644 --- a/README.md +++ b/README.md @@ -2,24 +2,33 @@ ## Overview -LXImage-Qt is the Qt port of LXImage, a simple and fast image viewer. +LXImage-Qt is the Qt port of LXImage, a simple and fast image viewer. -In addition it features a tool to take screenshots. +In addition it features a tool to take screenshots. -It is maintained by the LXQt project but can be used independently from this desktop environment. +It is maintained by the LXQt project but can be used independently from this +desktop environment. ## Installation ### Compiling source code -Runtime dependencies are qtx11extras and [libfm-qt](https://github.com/lxde/libfm-qt) (LXImage-Qt used to depend on [PCManFM-Qt](https://github.com/lxde/pcmanfm-qt) but the relevant code belongs to what was outsourced in libfm-qt). -Additional build dependencies are CMake and optionally Git to pull latest VCS checkouts. The localization files were outsourced to repository [lxqt-l10n](https://github.com/lxde/lxqt-l10n) so the corresponding dependencies are needed, too. Please refer to this repository's `README.md` for further information. +Runtime dependencies are qtx11extras and [libfm-qt](https://github.com/lxqt/libfm-qt) +(LXImage-Qt used to depend on [PCManFM-Qt](https://github.com/lxqt/pcmanfm-qt) +but the relevant code belongs to what was outsourced in libfm-qt). +Additional build dependencies are CMake and optionally Git to pull latest VCS +checkouts. The localization files were outsourced to repository +[lxqt-l10n](https://github.com/lxqt/lxqt-l10n) so the corresponding dependencies +are needed, too. Please refer to this repository's `README.md` for further information. -Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` has to be set to `/usr` on most operating systems. +Code configuration is handled by CMake. CMake variable `CMAKE_INSTALL_PREFIX` +has to be set to `/usr` on most operating systems. -To build run `make`, to install `make install` which accepts variable `DESTDIR` as usual. +To build run `make`, to install `make install` which accepts variable `DESTDIR` +as usual. ### Binary packages -Official binary packages are available in Arch Linux, Debian (as of Debian stretch), Fedora and openSUSE (Leap 42.1 and Tumbleweed). -Just use the distributions' package manager to search for string 'lximage'. +Official binary packages are available in Arch Linux, Debian (as of Debian stretch), +Fedora and openSUSE (Leap 42.1 and Tumbleweed). Just use the distributions' +package manager to search for string 'lximage'. diff --git a/debian/.gitignore b/debian/.gitignore deleted file mode 100644 index bd029f5..0000000 --- a/debian/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -/*.debhelper -/*.log -/*.substvars -/debhelper-build-stamp -/files - -/lximage-qt/ -/lximage-qt-dbg/ diff --git a/debian/changelog b/debian/changelog index b6ffe59..6e8e4d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +lximage-qt (0.7.0-1) experimental; urgency=medium + + * Cherry-picking upstream release 0.7.0. + * Removed build dependency libfm-dev + * Removed build dependency libmenu-cache-dev + * Bumped build dependency libfm-qt-def to >= 0.13.0~ + * Bumped build dependency lxqt-build-tools to >= 0.5.0~ + * Moved debian/.gitignore to ./.gitignore + + -- Alf Gaida Fri, 25 May 2018 19:36:29 +0200 + lximage-qt (0.6.0-4) unstable; urgency=medium * Bumped compat to 11 diff --git a/debian/control b/debian/control index 60eaed3..46f2951 100644 --- a/debian/control +++ b/debian/control @@ -7,16 +7,13 @@ Section: x11 Priority: optional Build-Depends: debhelper (>= 11~), libexif-dev, - libglib2.0-dev, - libfm-dev, - libfm-qt-dev (>= 0.12.0), + libfm-qt-dev (>= 0.13.0~), libkf5windowsystem-dev, - libmenu-cache-dev, libqt5svg5-dev, libqt5x11extras5-dev, libx11-dev, libxfixes-dev, - lxqt-build-tools (>= 0.4.0) + lxqt-build-tools (>= 0.5.0~) Standards-Version: 4.1.4 Vcs-Browser: https://salsa.debian.org/lxqt-team/lximage-qt Vcs-Git: https://salsa.debian.org/lxqt-team/lximage-qt.git diff --git a/debian/source/options b/debian/source/options index a8df976..efee896 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1,2 +1 @@ tar-ignore = .gitignore -tar-ignore = lximage-qt.kdev4 diff --git a/release.sh b/release.sh deleted file mode 100755 index d02564b..0000000 --- a/release.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -PROJECT="lximage-qt" -version="$1" -prefix=$PROJECT-$version -shift - -if [[ -z $version ]]; then - >&2 echo "USAGE: $0 " - exit 1 -fi - -mkdir -p "dist/$version" -echo "Creating $prefix.tar.gz" -git archive -9 --format tar.gz $version --prefix="$prefix/" > "dist/$version/$prefix.tar.gz" -gpg --armor --detach-sign "dist/$version/$prefix.tar.gz" -echo "Creating $prefix.tar.xz" -git archive -9 --format tar.xz $version --prefix="$prefix/" > "dist/$version/$prefix.tar.xz" -gpg --armor --detach-sign "dist/$version/$prefix.tar.xz" -cd "dist/$version" - -sha1sum --tag *.tar.gz *.tar.xz >> CHECKSUMS -sha256sum --tag *.tar.gz *.tar.xz >> CHECKSUMS - -cd .. -echo "Uploading to lxqt.org..." - -scp -r "$version" "downloads.lxqt.org:/srv/downloads.lxqt.org/$PROJECT/" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 77e138c..25d2d91 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -33,13 +33,15 @@ set(lximage-qt_SRCS upload/uploaddialog.cpp ) -qt5_add_dbus_adaptor(lximage-qt_SRCS +qt5_add_dbus_adaptor(lximage-qt_DBUS_SRCS org.lxde.LxImage.Application.xml application.h LxImage::Application applicationadaptor ApplicationAdaptor ) +set_property(SOURCE ${lximage-qt_DBUS_SRCS} PROPERTY SKIP_AUTOGEN ON) +list(APPEND lximage-qt_SRCS "${lximage-qt_DBUS_SRCS}") set(lximage-qt_UIS mainwindow.ui @@ -48,7 +50,6 @@ set(lximage-qt_UIS upload/uploaddialog.ui ) -qt5_wrap_ui(lximage-qt_UI_H ${lximage-qt_UIS}) # add translation for lximage-qt include(LXQtTranslateTs) @@ -80,7 +81,7 @@ install(FILES ${desktop_files} DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applica add_executable(lximage-qt ${lximage-qt_SRCS} - ${lximage-qt_UI_H} + ${lximage-qt_UIS} ${desktop_files} ${QM_FILES} ) @@ -88,6 +89,7 @@ add_executable(lximage-qt add_definitions( -DLXIMAGE_DATA_DIR="${CMAKE_INSTALL_FULL_DATAROOTDIR}/lximage-qt" -DLXIMAGE_VERSION="${LXIMAGE_VERSION}" + -DQT_NO_FOREACH ) set(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Core Qt5::DBus Qt5::PrintSupport Qt5::X11Extras Qt5::Svg) diff --git a/src/application.cpp b/src/application.cpp index d5e699a..c3c07b4 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -104,7 +104,7 @@ bool Application::parseCommandLineArgs() { const bool screenshotTool = parser.isSet(screenshotOption); QStringList paths; - Q_FOREACH(QString arg, args) { + for(const QString& arg : args) { QFileInfo info(arg); paths.push_back(info.absoluteFilePath()); } @@ -151,7 +151,7 @@ void Application::newWindow(QStringList files) { window->show(); } else { - Q_FOREACH(QString fileName, files) { + for(const QString& fileName : qAsConst(files)) { window = createWindow(); window->openImageFile(fileName); @@ -167,7 +167,8 @@ void Application::newWindow(QStringList files) { } void Application::applySettings() { - Q_FOREACH(QWidget* window, topLevelWidgets()) { + const auto windows = topLevelWidgets(); + for(QWidget* window : windows) { if(window->inherits("LxImage::MainWindow")) static_cast(window)->applySettings(); } diff --git a/src/imageview.cpp b/src/imageview.cpp index 46fda02..dd1a9dd 100644 --- a/src/imageview.cpp +++ b/src/imageview.cpp @@ -346,7 +346,7 @@ void ImageView::generateCache() { // convert to the coordinate of the original image cachedSceneRect_ = viewportToScene(cachedRect_); // create a sub image of the visible without real data copy - // Reference: http://stackoverflow.com/questions/12681554/dividing-qimage-to-smaller-pieces + // Reference: https://stackoverflow.com/questions/12681554/dividing-qimage-to-smaller-pieces QRect subRect = image_.rect().intersected(cachedSceneRect_); const uchar* bits = image_.constBits(); unsigned int offset = subRect.x() * image_.depth() / 8 + subRect.y() * image_.bytesPerLine(); diff --git a/src/loadimagejob.cpp b/src/loadimagejob.cpp index d4f483b..085fa31 100644 --- a/src/loadimagejob.cpp +++ b/src/loadimagejob.cpp @@ -89,7 +89,7 @@ void LoadImageJob::exec() { exif_loader.reset(); if (exif_data) { /* reference for EXIF orientation tag: - * http://www.impulseadventure.com/photo/exif-orientation.html */ + * https://www.impulseadventure.com/photo/exif-orientation.html */ ExifEntry* orient_ent = exif_data_get_entry(exif_data.get(), EXIF_TAG_ORIENTATION); if(orient_ent) { /* orientation flag found in EXIF */ gushort orient; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d8a50d4..1e0012a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -39,7 +39,6 @@ #include #include #include "application.h" -#include #include #include #include @@ -143,9 +142,9 @@ MainWindow::~MainWindow() { void MainWindow::on_actionAbout_triggered() { QMessageBox::about(this, tr("About"), - tr("LXImage - a simple and fast image viewer\n\n" + tr("LXImage-Qt - a simple and fast image viewer\n\n" "Copyright (C) 2013\n" - "LXDE Project: http://lxde.org/\n\n" + "LXQt Project: https://lxqt.org/\n\n" "Authors:\n" "Hong Jen Yee (PCMan) ")); } @@ -906,7 +905,8 @@ void MainWindow::changeEvent(QEvent* event) { // is disabled. We needs to add the actions to the main window manually to enable the // shortcuts again. ui.menubar->hide(); - Q_FOREACH(QAction* action, ui.menubar->actions()) { + const auto actions = ui.menubar->actions(); + for(QAction* action : qAsConst(actions)) { if(!action->shortcut().isEmpty()) addAction(action); } @@ -917,7 +917,8 @@ void MainWindow::changeEvent(QEvent* event) { ui.view->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); ui.view->setBackgroundBrush(QBrush(app->settings().bgColor())); // now we're going to re-enable the menu, so remove the actions previously added. - Q_FOREACH(QAction* action, ui.menubar->actions()) { + const auto actions_ = ui.menubar->actions(); + for(QAction* action : qAsConst(actions_)) { if(!action->shortcut().isEmpty()) removeAction(action); } diff --git a/src/preferencesdialog.cpp b/src/preferencesdialog.cpp index c35183b..e86679c 100644 --- a/src/preferencesdialog.cpp +++ b/src/preferencesdialog.cpp @@ -58,7 +58,8 @@ void PreferencesDialog::accept() { settings.setFallbackIconTheme(newIconTheme); QIcon::setThemeName(newIconTheme); // update the UI by emitting a style change event - Q_FOREACH(QWidget *widget, QApplication::allWidgets()) { + const auto allWidgets = QApplication::allWidgets(); + for(QWidget *widget : allWidgets) { QEvent event(QEvent::StyleChange); QApplication::sendEvent(widget, &event); } @@ -76,9 +77,9 @@ void PreferencesDialog::accept() { static void findIconThemesInDir(QHash& iconThemes, QString dirName) { QDir dir(dirName); - QStringList subDirs = dir.entryList(QDir::AllDirs); + const QStringList subDirs = dir.entryList(QDir::AllDirs); GKeyFile* kf = g_key_file_new(); - Q_FOREACH(QString subDir, subDirs) { + for(QString subDir : subDirs) { QString indexFile = dirName % '/' % subDir % "/index.theme"; if(g_key_file_load_from_file(kf, indexFile.toLocal8Bit().constData(), GKeyFileFlags(0), NULL)) { // FIXME: skip hidden ones diff --git a/src/translations/lximage-qt-screenshot_es.desktop b/src/translations/lximage-qt-screenshot_es.desktop new file mode 100644 index 0000000..8b2952d --- /dev/null +++ b/src/translations/lximage-qt-screenshot_es.desktop @@ -0,0 +1,3 @@ +Name[es]=Captura de pantalla +GenericName[es]=Captura de pantalla +Comment[es]=Toma capturas de la pantalla diff --git a/src/translations/lximage-qt_es.desktop b/src/translations/lximage-qt_es.desktop new file mode 100644 index 0000000..9fa090a --- /dev/null +++ b/src/translations/lximage-qt_es.desktop @@ -0,0 +1,3 @@ +Name[es]=LXImage +GenericName[es]=Visor de imágenes +Comment[es]=El visor de imágenes de LXQt