Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package novprog for openSUSE:Factory checked in at 2023-06-20 16:49:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/novprog (Old) and /work/SRC/openSUSE:Factory/.novprog.new.15902 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "novprog" Tue Jun 20 16:49:47 2023 rev:9 rq:1094095 version:3.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/novprog/novprog.changes 2021-12-09 19:46:25.929157022 +0100 +++ /work/SRC/openSUSE:Factory/.novprog.new.15902/novprog.changes 2023-06-20 16:49:51.303901114 +0200 @@ -1,0 +2,9 @@ +Tue Jun 20 13:46:18 UTC 2023 - Martin Pluskal <mplus...@suse.com> + +- Update to version 3.2.2: + *Improved Linux deployment + * Replaced deprecated code +- Changes for version 3.2.1: + * Switched to Qt 6 + +------------------------------------------------------------------- Old: ---- novprog-3.2.0-src.tar.bz2 New: ---- novprog-3.2.2-src.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ novprog.spec ++++++ --- /var/tmp/diff_new_pack.K9egbY/_old 2023-06-20 16:49:51.967905105 +0200 +++ /var/tmp/diff_new_pack.K9egbY/_new 2023-06-20 16:49:51.971905128 +0200 @@ -1,7 +1,7 @@ # # spec file for package novprog # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2023 SUSE LLC # Copyright (c) 2016 Graeme Gott <gra...@gottcode.org> # # All modifications and additions to the file contributed by third parties @@ -18,21 +18,24 @@ Name: novprog -Version: 3.2.0 +Version: 3.2.2 Release: 0 Summary: Wordcount graphing program License: GPL-3.0-or-later Group: Productivity/Office/Other URL: https://gottcode.org/novprog/ -Source: http://gottcode.org/novprog/%{name}-%{version}-src.tar.bz2 +Source: https://gottcode.org/novprog/download/?os=source#/%{name}-%{version}-src.tar.bz2 +BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: hicolor-icon-theme -BuildRequires: libqt5-linguist BuildRequires: pkgconfig +BuildRequires: qt6-linguist-devel BuildRequires: update-desktop-files -BuildRequires: pkgconfig(Qt5Core) -BuildRequires: pkgconfig(Qt5Gui) -BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt6Core) +BuildRequires: pkgconfig(Qt6Gui) +BuildRequires: pkgconfig(Qt6Widgets) +BuildRequires: pkgconfig(opengl) +BuildRequires: pkgconfig(xkbcommon) >= 0.5.0 Requires: hicolor-icon-theme %description @@ -45,14 +48,14 @@ %lang_package %prep -%setup -q +%autosetup %build -%qmake5 PREFIX=%{_prefix} -%make_jobs +%cmake +%cmake_build %install -%qmake5_install +%cmake_install %suse_update_desktop_file -u -r %{name} Office Publishing %find_lang %{name} --with-qt ++++++ novprog-3.2.0-src.tar.bz2 -> novprog-3.2.2-src.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/CMakeLists.txt new/novprog-3.2.2/CMakeLists.txt --- old/novprog-3.2.0/CMakeLists.txt 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/CMakeLists.txt 2023-01-10 16:44:21.000000000 +0100 @@ -1,7 +1,13 @@ -cmake_minimum_required(VERSION 3.16.0) +# SPDX-FileCopyrightText: 2021-2023 Graeme Gott <gra...@gottcode.org> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +cmake_minimum_required(VERSION 3.16) # Configure project -project(novprog VERSION 3.2.0 LANGUAGES CXX) +project(novprog VERSION 3.2.2 LANGUAGES CXX) + +set(project_copyright "2006-2023 Graeme Gott") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -10,17 +16,18 @@ set(CMAKE_AUTORCC ON) find_package(Qt6 REQUIRED COMPONENTS Core Gui LinguistTools Widgets) -if(UNIX AND NOT APPLE) - include(GNUInstallDirs) -endif() +include(GNUInstallDirs) -if(CMAKE_BUILD_TYPE STREQUAL "Debug") - add_compile_definitions( - QT_STRICT_ITERATORS - QT_NO_NARROWING_CONVERSIONS_IN_CONNECT - QT_DISABLE_DEPRECATED_BEFORE=0x060000 - ) -endif() +add_compile_definitions( + QT_NO_KEYWORDS + $<$<CONFIG:DEBUG>:QT_STRICT_ITERATORS> + $<$<CONFIG:DEBUG>:QT_NO_NARROWING_CONVERSIONS_IN_CONNECT> + $<$<CONFIG:DEBUG>:QT_DISABLE_DEPRECATED_BEFORE=0x060400> +) + +# Version number +include(cmake/AddVersionCompileDefinition.cmake) +add_version_compile_definition(src/main.cpp VERSIONSTR) # Create translations file(GLOB translations_SRCS translations/*.ts) @@ -50,29 +57,64 @@ Qt6::Widgets ) -target_compile_definitions(novprog PRIVATE VERSIONSTR="${PROJECT_VERSION}") +# Optimize build +option(ENABLE_LINK_TIME_OPTIMIZATION "Enable link time optimization" OFF) +if(ENABLE_LINK_TIME_OPTIMIZATION) + include(CheckIPOSupported) + check_ipo_supported(RESULT result) + if(result) + set_target_properties(novprog PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE) + endif() +endif() + +option(ENABLE_STRIP "Enable automatic stripping of builds" OFF) +if(ENABLE_STRIP) + add_custom_command(TARGET novprog + POST_BUILD + COMMAND ${CMAKE_STRIP} $<TARGET_FILE:novprog> + ) +endif() # Install -if(UNIX AND NOT APPLE) - target_sources(novprog PRIVATE icons/icon.qrc) +if(APPLE) + set(datadir "../Resources") - install(TARGETS novprog RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - install(FILES ${translations_QM} DESTINATION ${CMAKE_INSTALL_DATADIR}/novprog/translations) - install(FILES doc/novprog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) - install(DIRECTORY icons/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons) - install(FILES icons/novprog.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) - install(FILES icons/novprog.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) + set_target_properties(novprog PROPERTIES + OUTPUT_NAME NovProg + MACOSX_BUNDLE TRUE + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/mac/Info.plist.in + ) + + include(cmake/BundleResources.cmake) + bundle_data(novprog ${CMAKE_SOURCE_DIR}/icons/novprog.icns Resources) + bundle_translations(novprog "${translations_QM}") elseif(WIN32) + set(datadir ".") + # Use Qt6 macro until CMake provides something # https://bugreports.qt.io/browse/QTBUG-87618 set_target_properties(novprog PROPERTIES + OUTPUT_NAME NovProg WIN32_EXECUTABLE TRUE QT_TARGET_VERSION "${PROJECT_VERSION}" QT_TARGET_COMPANY_NAME "Graeme Gott" QT_TARGET_DESCRIPTION "Wordcount graphing program" - QT_TARGET_COPYRIGHT "Copyright (C) 2021 Graeme Gott" + QT_TARGET_COPYRIGHT "\\xA9 ${project_copyright}" QT_TARGET_PRODUCT_NAME "NovProg" QT_TARGET_RC_ICONS ${CMAKE_SOURCE_DIR}/icons/novprog.ico ) _qt_internal_generate_win32_rc_file(novprog) +else() + file(RELATIVE_PATH datadir ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_DATADIR}/novprog) + + target_sources(novprog PRIVATE icons/icon.qrc) + + install(TARGETS novprog RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${translations_QM} DESTINATION ${CMAKE_INSTALL_DATADIR}/novprog/translations) + install(FILES doc/novprog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT doc) + install(DIRECTORY icons/hicolor DESTINATION ${CMAKE_INSTALL_DATADIR}/icons) + install(FILES icons/novprog.appdata.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo) + install(FILES icons/novprog.desktop DESTINATION ${CMAKE_INSTALL_DATADIR}/applications) endif() + +set_property(SOURCE src/main.cpp APPEND PROPERTY COMPILE_DEFINITIONS NOVPROG_DATADIR="${datadir}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/ChangeLog new/novprog-3.2.2/ChangeLog --- old/novprog-3.2.0/ChangeLog 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/ChangeLog 2023-01-10 16:44:21.000000000 +0100 @@ -1,3 +1,12 @@ +3.2.2 +----- +* Improved Linux deployment. +* Replaced deprecated code. + +3.2.1 +----- +* Switched to Qt 6. + 3.2.0 ----- * Added setting words written for current day. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/INSTALL new/novprog-3.2.2/INSTALL --- old/novprog-3.2.0/INSTALL 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/INSTALL 2023-01-10 16:44:21.000000000 +0100 @@ -4,26 +4,92 @@ Open a terminal and browse into the extracted folder. Linux: - 1.) Type 'qmake' to configure the program. If you would like to install the - program somewhere other than /usr/local, pass a new value for PREFIX - during configuration: 'qmake PREFIX=/opt'. - - 2.) Type 'make' to compile the program. - - 3.) Type 'sudo make install' to install the program. + 1. `cmake -B build -S . -DCMAKE_INSTALL_PREFIX=/usr' to create a location + for the build and then configure the program. There are more options + you can pass to CMake, see below for details. + + 2. `cmake --build build' to compile the program. + + 3. `cmake --install build' to install the program. This has to be done + with root privileges if installing to system directories, but the + rest of the build should be done with regular user privileges. + + For packaging you can optionally install the program into a temporary + directory by setting the DESTDIR environment variable. For example, + `DESTDIR="alternate/directory" cmake --install build' will prepend + 'alternate/directory' before all installation names. macOS: - 1.) Type 'qmake -spec macx-clang' to configure the program. + 1. `cmake -B build -S .' to create a location for the build and then + configure the program. There are more options you can pass to CMake, + see below for details. - 2.) Type 'make' to compile the program. + 2. `cmake --build build' to compile the program. - 3.) Type './mac_deploy.sh' to create a disk image of the program. + 3. Run `mac_deploy.sh' from inside the build directory to create a disk + image of the program. Windows: - 1.) Type 'qmake' to configure the program. + 1. `cmake -B ..\build -S .' to create a location for the build and then + configure the program. There are more options you can pass to CMake, + see below for details. + + 2. `cmake --build ..\build' to compile the program. + + 3. Run `windows_deploy.bat' from inside the build directory to create an + installer of the program. Note that you must have the NSIS executable + from nsis.sourceforge.io and the 7z executable from 7-zip.org in your + %PATH% for this to work. + + +Release Builds +============== + +CMake does not specify any compiler optimizations by default; this is +useful if you want to inherit CFLAGS and CXXFLAGS from the environment. +You may want to add "-DCMAKE_BUILD_TYPE=Release" during configuration +to get an optimized build. + + +Debug Builds +============ + +You should create different directories for each type of build: + + 1. `cmake -B debug -S . -DCMAKE_BUILD_TYPE=Debug' to configure the sources. + + 2. `cmake --build debug' to compile the program. + + +More CMake Options +================== + +-DCMAKE_BUILD_TYPE=<type> + Choose the type of build. Possible values are: + 'None' 'Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel' + +-DENABLE_LINK_TIME_OPTIMIZATION=[OFF] + Reduce size by optimizing entire program at link time. + +-DENABLE_STRIP=[OFF] + Reduce size by removing symbols. + + +Linux CMake Options +=================== + +-DCMAKE_INSTALL_PREFIX=<path> + Choose the base location where the program is installed + (defaults to /usr/local). + +-DCMAKE_INSTALL_BINDIR=<path> + Choose where binaries are installed + (defaults to $CMAKE_INSTALL_PREFIX/bin). - 2.) Type 'make' to compile the program. +-DCMAKE_INSTALL_DATADIR=<path> + Choose where the data files are installed + (defaults to $CMAKE_INSTALL_PREFIX/share). - 3.) Type 'windows_deploy' to create an installer of the program. Note - that you must have the NSIS executable from nsis.sourceforge.io and - the 7z executable from 7-zip.org in your %PATH% for this to work. +-DCMAKE_INSTALL_MANDIR=<path> + Choose where manual pages are installed + (defaults to $CMAKE_INSTALL_DATADIR/man). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/cmake/AddVersionCompileDefinition.cmake new/novprog-3.2.2/cmake/AddVersionCompileDefinition.cmake --- old/novprog-3.2.0/cmake/AddVersionCompileDefinition.cmake 1970-01-01 01:00:00.000000000 +0100 +++ new/novprog-3.2.2/cmake/AddVersionCompileDefinition.cmake 2023-01-10 16:44:21.000000000 +0100 @@ -0,0 +1,51 @@ +# SPDX-FileCopyrightText: 2022 Graeme Gott <gra...@gottcode.org> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +function(add_version_compile_definition versionstr_file versionstr_def) + find_package(Git QUIET) + if(Git_FOUND) + # Find git repository + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --absolute-git-dir + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + RESULT_VARIABLE git_dir_result + OUTPUT_VARIABLE git_dir + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + if (git_dir_result EQUAL 0) + # Find version number from git + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --tags --match "v*" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE versionstr + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string(REGEX REPLACE "^v" "" versionstr "${versionstr}") + + # Rerun CMake when git repository changes + if (EXISTS ${git_dir}/logs/HEAD) + set_property( + DIRECTORY + APPEND + PROPERTY CMAKE_CONFIGURE_DEPENDS ${git_dir}/logs/HEAD + ) + endif() + endif() + endif() + + # Fall back to project's VERSION + if ("${versionstr}" STREQUAL "") + set(versionstr ${PROJECT_VERSION}) + endif() + + # Pass version as compile definition to file + set_property( + SOURCE ${versionstr_file} + APPEND + PROPERTY COMPILE_DEFINITIONS ${versionstr_def}="${versionstr}" + ) +endfunction() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/cmake/BundleResources.cmake new/novprog-3.2.2/cmake/BundleResources.cmake --- old/novprog-3.2.0/cmake/BundleResources.cmake 1970-01-01 01:00:00.000000000 +0100 +++ new/novprog-3.2.2/cmake/BundleResources.cmake 2023-01-10 16:44:21.000000000 +0100 @@ -0,0 +1,52 @@ +# SPDX-FileCopyrightText: 2022 Graeme Gott <gra...@gottcode.org> +# +# SPDX-License-Identifier: GPL-3.0-or-later + +# Add files to a macOS bundle. +function(bundle_data target source destination) + if(IS_DIRECTORY ${source}) + # Recursively find files under source + file(GLOB_RECURSE files RELATIVE ${source} ${source}/*) + set(parent ${source}) + else() + # Handle single file + get_filename_component(files ${source} NAME) + get_filename_component(parent ${source} DIRECTORY) + endif() + + # Set each file to be located under destination + foreach(resource ${files}) + get_filename_component(path ${resource} DIRECTORY) + set_property( + SOURCE ${parent}/${resource} + PROPERTY + MACOSX_PACKAGE_LOCATION ${destination}/${path} + ) + endforeach() + + # Make target depend on resources + list(TRANSFORM files PREPEND "${parent}/") + target_sources(${target} PRIVATE ${files}) +endfunction() + +# Add translations to a macOS bundle. +function(bundle_translations target translations) + foreach(file ${translations}) + # Set each translation to be located under Resources + set_property( + SOURCE ${file} + PROPERTY + MACOSX_PACKAGE_LOCATION Resources/translations + ) + + # Inform macOS about translation for native dialogs + get_filename_component(resource ${file} NAME) + string(REGEX REPLACE "[^_]*_([^\\.]*)\\..*" "\\1.lproj" lang ${resource}) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E make_directory $<TARGET_BUNDLE_CONTENT_DIR:${target}>/Resources/${lang} + ) + endforeach() +endfunction() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/icons/novprog.appdata.xml new/novprog-3.2.2/icons/novprog.appdata.xml --- old/novprog-3.2.0/icons/novprog.appdata.xml 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/icons/novprog.appdata.xml 2023-01-10 16:44:21.000000000 +0100 @@ -57,6 +57,7 @@ <provides> <binary>novprog</binary> </provides> + <launchable type="desktop-id">novprog.desktop</launchable> <kudos> <kudo>HiDpiIcon</kudo> @@ -66,6 +67,21 @@ <content_rating type="oars-1.1"/> <releases> + <release version="3.2.2" date="2023-01-10"> + <description> + <ul> + <li>Improved Linux deployment</li> + <li>Replaced deprecated code</li> + </ul> + </description> + </release> + <release version="3.2.1" date="2022-05-03"> + <description> + <ul> + <li>Switched to Qt 6</li> + </ul> + </description> + </release> <release version="3.2.0" date="2021-09-21"> <description> <ul> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/icons/novprog.desktop new/novprog-3.2.2/icons/novprog.desktop --- old/novprog-3.2.0/icons/novprog.desktop 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/icons/novprog.desktop 2023-01-10 16:44:21.000000000 +0100 @@ -34,6 +34,7 @@ Comment[pl]=PostÄp powieÅci Comment[pt]=Registe e controle o progresso da sua novela Comment[ro]=UrmÄriÅ£i progresul romanului dvs. +TryExec=novprog Exec=novprog Icon=novprog Terminal=false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/mac/Info.plist.in new/novprog-3.2.2/mac/Info.plist.in --- old/novprog-3.2.0/mac/Info.plist.in 1970-01-01 01:00:00.000000000 +0100 +++ new/novprog-3.2.2/mac/Info.plist.in 2023-01-10 16:44:21.000000000 +0100 @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + + <key>CFBundleName</key> + <string>NovProg</string> + <key>CFBundleIdentifier</key> + <string>org.gottcode.NovProg</string> + <key>CFBundleIconFile</key> + <string>novprog.icns</string> + <key>CFBundleExecutable</key> + <string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> + + <key>CFBundleVersion</key> + <string>${PROJECT_VERSION}</string> + <key>CFBundleShortVersionString</key> + <string>${PROJECT_VERSION}</string> + + <key>NSHumanReadableCopyright</key> + <string>© ${project_copyright}</string> + + <key>LSMinimumSystemVersion</key> + <string>${CMAKE_OSX_DEPLOYMENT_TARGET}</string> + + <key>NSPrincipalClass</key> + <string>NSApplication</string> + <key>NSSupportsAutomaticGraphicsSwitching</key> + <true/> +</dict> +</plist> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/mac_deploy.sh new/novprog-3.2.2/mac_deploy.sh --- old/novprog-3.2.0/mac_deploy.sh 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/mac_deploy.sh 2023-01-10 16:44:21.000000000 +0100 @@ -2,7 +2,11 @@ APP='NovProg' BUNDLE="$APP.app" -VERSION='3.2.0' +VERSION='3.2.2' + +# Locate deployment script +BIN_DIR=$(pwd) +cd $(dirname "${BASH_SOURCE[0]}") # Remove any previous disk folder or DMG echo -n 'Preparing... ' @@ -16,7 +20,7 @@ # Create disk folder echo -n 'Copying application bundle... ' mkdir "$APP" -cp -Rf "$BUNDLE" "$APP/" +cp -Rf "${BIN_DIR}/${BUNDLE}" "$APP/" strip "$APP/$BUNDLE/Contents/MacOS/$APP" cp COPYING "$APP/License.txt" echo 'Done' @@ -38,23 +42,9 @@ cat ChangeLog >> "$APP/Read Me.txt" echo 'Done' -# Copy translations -echo -n 'Copying translations... ' -TRANSLATIONS="$APP/$BUNDLE/Contents/Resources/translations" -mkdir "$TRANSLATIONS" -cp translations/*.qm "$TRANSLATIONS" -echo 'Done' - -# Make macOS aware that the app bundle is translated. -# This is required to translate parts of native open/save dialogs. -echo -n 'Creating mac lproj directories for translations... ' -for translation in $(ls translations | grep qm | cut -d'.' -f1 | cut -d'_' -f2- | uniq); do - mkdir -p "$APP/$BUNDLE/Contents/Resources/${translation}.lproj" -done -echo 'Done' - # Copy Qt translations echo -n 'Copying Qt translations... ' +TRANSLATIONS="$APP/$BUNDLE/Contents/Resources/translations" cp $QTDIR/translations/qt_* "$TRANSLATIONS" cp $QTDIR/translations/qtbase_* "$TRANSLATIONS" rm -f $TRANSLATIONS/qt_help_* diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/novprog.pro new/novprog-3.2.2/novprog.pro --- old/novprog-3.2.0/novprog.pro 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/novprog.pro 1970-01-01 01:00:00.000000000 +0100 @@ -1,96 +0,0 @@ -!versionAtLeast(QT_VERSION, 5.12) { - error("NovProg requires Qt 5.12 or greater") -} - -TEMPLATE = app -QT += widgets -CONFIG += c++17 - -CONFIG(debug, debug|release) { - CONFIG += warn_on - DEFINES += QT_DEPRECATED_WARNINGS - DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 - DEFINES += QT_NO_NARROWING_CONVERSIONS_IN_CONNECT -} - -# Allow in-tree builds -MOC_DIR = build -OBJECTS_DIR = build -RCC_DIR = build - -# Set program version -VERSION = 3.2.0 -DEFINES += VERSIONSTR=\\\"$${VERSION}\\\" - -# Set program name -unix: !macx { - TARGET = novprog -} else { - TARGET = NovProg -} - -# Specify program sources -HEADERS = src/data.h \ - src/graph.h \ - src/locale_dialog.h \ - src/novel_dialog.h \ - src/window.h - -SOURCES = src/data.cpp \ - src/graph.cpp \ - src/locale_dialog.cpp \ - src/novel_dialog.cpp \ - src/window.cpp \ - src/main.cpp - -# Generate translations -TRANSLATIONS = $$files(translations/novprog_*.ts) -qtPrepareTool(LRELEASE, lrelease) -updateqm.input = TRANSLATIONS -updateqm.output = ${QMAKE_FILE_PATH}/${QMAKE_FILE_BASE}.qm -updateqm.commands = $$LRELEASE -silent ${QMAKE_FILE_IN} -qm ${QMAKE_FILE_OUT} -updateqm.CONFIG += no_link target_predeps -QMAKE_EXTRA_COMPILERS += updateqm - -# Install program data -RESOURCES += icons/breeze.qrc - -macx { - ICON = icons/novprog.icns -} else:win32 { - RC_ICONS = icons/novprog.ico - QMAKE_TARGET_DESCRIPTION = "Wordcount graphing program" - QMAKE_TARGET_COPYRIGHT = "Copyright (C) 2021 Graeme Gott" -} else:unix { - isEmpty(PREFIX) { - PREFIX = /usr - } - isEmpty(BINDIR) { - BINDIR = $$PREFIX/bin - } - isEmpty(DATADIR) { - DATADIR = $$PREFIX/share - } - - RESOURCES += icons/icon.qrc - - target.path = $$BINDIR - - icon.files = icons/hicolor/* - icon.path = $$DATADIR/icons/hicolor - - desktop.files = icons/novprog.desktop - desktop.path = $$DATADIR/applications - - appdata.files = icons/novprog.appdata.xml - appdata.path = $$DATADIR/metainfo - - qm.files = $$replace(TRANSLATIONS, .ts, .qm) - qm.path = $$DATADIR/novprog/translations - qm.CONFIG += no_check_exist - - man.files = doc/novprog.1 - man.path = $$DATADIR/man/man1 - - INSTALLS += target icon desktop appdata qm man -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/data.cpp new/novprog-3.2.2/src/data.cpp --- old/novprog-3.2.0/src/data.cpp 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/data.cpp 2023-01-10 16:44:21.000000000 +0100 @@ -250,19 +250,11 @@ file.close(); // Parse header data -#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) QStringList lines = data.split('\n', Qt::SkipEmptyParts); -#else - QStringList lines = data.split('\n', QString::SkipEmptyParts); -#endif if (lines.count() == 0) { return; } -#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) const QStringList header = lines.takeFirst().split(' ', Qt::SkipEmptyParts); -#else - const QStringList header = lines.takeFirst().split(' ', QString::SkipEmptyParts); -#endif if (header.count() < 4) { return; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/locale_dialog.cpp new/novprog-3.2.2/src/locale_dialog.cpp --- old/novprog-3.2.0/src/locale_dialog.cpp 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/locale_dialog.cpp 2023-01-10 16:44:21.000000000 +0100 @@ -64,22 +64,12 @@ //----------------------------------------------------------------------------- -void LocaleDialog::loadTranslator(const QString& name) +void LocaleDialog::loadTranslator(const QString& name, const QString& datadir) { - QString appdir = QCoreApplication::applicationDirPath(); m_appname = name; // Find translator path - QStringList paths; - paths.append(appdir); - paths.append(appdir + "/../share/" + QCoreApplication::applicationName().toLower()); - paths.append(appdir + "/../Resources"); - for (const QString& path : paths) { - if (QFile::exists(path + "/translations/")) { - m_path = path + "/translations/"; - break; - } - } + m_path = datadir + "/translations/"; // Find current locale m_current = QSettings().value("Locale/Language").toString(); @@ -93,11 +83,7 @@ if (translator.load(m_appname + locale, m_path)) { QCoreApplication::installTranslator(&translator); -#if (QT_VERSION >= QT_VERSION_CHECK(6,0,0)) const QString path = QLibraryInfo::path(QLibraryInfo::TranslationsPath); -#else - const QString path = QLibraryInfo::location(QLibraryInfo::TranslationsPath); -#endif static QTranslator qtbase_translator; if (qtbase_translator.load("qtbase_" + locale, m_path) || qtbase_translator.load("qtbase_" + locale, path)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/locale_dialog.h new/novprog-3.2.2/src/locale_dialog.h --- old/novprog-3.2.0/src/locale_dialog.h 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/locale_dialog.h 2023-01-10 16:44:21.000000000 +0100 @@ -17,10 +17,10 @@ public: explicit LocaleDialog(QWidget* parent = nullptr); - static void loadTranslator(const QString& appname); + static void loadTranslator(const QString& appname, const QString& datadir); static QString languageName(const QString& language); -public slots: +public Q_SLOTS: void accept() override; private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/main.cpp new/novprog-3.2.2/src/main.cpp --- old/novprog-3.2.0/src/main.cpp 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/main.cpp 2023-01-10 16:44:21.000000000 +0100 @@ -1,5 +1,5 @@ /* - SPDX-FileCopyrightText: 2006-2021 Graeme Gott <gra...@gottcode.org> + SPDX-FileCopyrightText: 2006-2022 Graeme Gott <gra...@gottcode.org> SPDX-License-Identifier: GPL-3.0-or-later */ @@ -16,17 +16,6 @@ int main(int argc, char** argv) { -#if (QT_VERSION < QT_VERSION_CHECK(6,0,0)) -#if !defined(Q_OS_MAC) - if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO") - && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") - && !qEnvironmentVariableIsSet("QT_SCALE_FACTOR") - && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - } -#endif - QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); -#endif QApplication app(argc, argv); app.setApplicationName("NovProg"); app.setApplicationDisplayName(Window::tr("Novel Progress")); @@ -38,23 +27,33 @@ app.setDesktopFileName("novprog"); #endif - LocaleDialog::loadTranslator("novprog_"); - - QCommandLineParser parser; - parser.setApplicationDescription(QCoreApplication::translate("main", "A wordcount graphing program")); - parser.addHelpOption(); - parser.addVersionOption(); - parser.process(app); + // Find application data + const QString appdir = app.applicationDirPath(); + const QString datadir = QDir::cleanPath(appdir + "/" + NOVPROG_DATADIR); // Handle portability QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); - QFileInfo portable(app.applicationDirPath() + "/Data"); +#ifdef Q_OS_MAC + const QFileInfo portable(appdir + "/../../../Data"); +#else + const QFileInfo portable(appdir + "/Data"); +#endif if (portable.exists() && portable.isWritable()) { path = portable.absoluteFilePath(); QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setPath(QSettings::IniFormat, QSettings::UserScope, path + "/Settings"); } + // Load application language + LocaleDialog::loadTranslator("novprog_", datadir); + + // Handle commandline + QCommandLineParser parser; + parser.setApplicationDescription(QCoreApplication::translate("main", "A wordcount graphing program")); + parser.addHelpOption(); + parser.addVersionOption(); + parser.process(app); + // Change to novels directory path += "/Novels/"; if (!QFileInfo::exists(path)) { @@ -79,6 +78,7 @@ } QDir::setCurrent(path); + // Create main window Window window; window.show(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/novel_dialog.h new/novprog-3.2.2/src/novel_dialog.h --- old/novprog-3.2.0/src/novel_dialog.h 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/novel_dialog.h 2023-01-10 16:44:21.000000000 +0100 @@ -22,10 +22,10 @@ public: NovelDialog(const QString& novel, Database* data, QWidget* parent); -public slots: +public Q_SLOTS: void accept() override; -private slots: +private Q_SLOTS: void checkAcceptAllowed(); private: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/window.cpp new/novprog-3.2.2/src/window.cpp --- old/novprog-3.2.0/src/window.cpp 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/window.cpp 2023-01-10 16:44:21.000000000 +0100 @@ -105,11 +105,7 @@ m_data = new Database(this); m_novels = new QComboBox(this); m_novels->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); -#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) connect(m_novels, &QComboBox::textActivated, this, &Window::load); -#else - connect(m_novels, qOverload<const QString&>(&QComboBox::activated), this, &Window::load); -#endif QTabWidget* graphs = new QTabWidget(this); @@ -145,11 +141,13 @@ addToolBar(actions); QMenu* menu = new QMenu(this); - menu->addAction(tr("&New Novel"), this, &Window::newNovel, QKeySequence::New); + QAction* action = menu->addAction(tr("&New Novel"), this, &Window::newNovel); + action->setShortcut(QKeySequence::New); m_edit_button = menu->addAction(tr("&Edit Novel"), this, &Window::editNovel); m_delete_button = menu->addAction(tr("&Delete Novel"), this, &Window::deleteNovel); menu->addSeparator(); - menu->addAction(tr("&Quit"), this, &Window::close, QKeySequence::Quit); + action = menu->addAction(tr("&Quit"), this, &Window::close); + action->setShortcut(QKeySequence::Quit); QToolButton* menubutton = new IconButton("application-menu", this); menubutton->setPopupMode(QToolButton::InstantPopup); @@ -157,12 +155,14 @@ actions->addWidget(menubutton); #else QMenu* menu = menuBar()->addMenu(tr("&Novel")); - menu->addAction(tr("&New"), this, &Window::newNovel, QKeySequence::New); + QAction* action = menu->addAction(tr("&New"), this, &Window::newNovel); + action->setShortcut(QKeySequence::New); m_edit_button = menu->addAction(tr("&Edit"), this, &Window::editNovel); m_delete_button = menu->addAction(tr("&Delete"), this, &Window::deleteNovel); menu->addSeparator(); - QAction* quit = menu->addAction(tr("&Quit"), this, &Window::close, QKeySequence::Quit); - quit->setMenuRole(QAction::QuitRole); + action = menu->addAction(tr("&Quit"), this, &Window::close); + action->setShortcut(QKeySequence::Quit); + action->setMenuRole(QAction::QuitRole); #endif QVBoxLayout* daily_layout = new QVBoxLayout(daily_group); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/src/window.h new/novprog-3.2.2/src/window.h --- old/novprog-3.2.0/src/window.h 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/src/window.h 2023-01-10 16:44:21.000000000 +0100 @@ -27,7 +27,7 @@ protected: void closeEvent(QCloseEvent* event) override; -private slots: +private Q_SLOTS: void newNovel(); void editNovel(); void deleteNovel(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/windows/installer.nsi new/novprog-3.2.2/windows/installer.nsi --- old/novprog-3.2.0/windows/installer.nsi 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/windows/installer.nsi 2023-01-10 16:44:21.000000000 +0100 @@ -4,7 +4,7 @@ !define APPNAME "NovProg" !define VERSIONMAJOR 3 !define VERSIONMINOR 2 -!define VERSIONPATCH 0 +!define VERSIONPATCH 2 !define APPVERSION "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONPATCH}" !define ABOUTURL "https://gottcode.org/novprog/" @@ -159,6 +159,9 @@ Section "install" + ;Remove previous installs + !include removeprevious.nsh + ;Copy files SetOutPath "$INSTDIR" File /r "..\${APPNAME}\*" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/windows/removeprevious.nsh new/novprog-3.2.2/windows/removeprevious.nsh --- old/novprog-3.2.0/windows/removeprevious.nsh 1970-01-01 01:00:00.000000000 +0100 +++ new/novprog-3.2.2/windows/removeprevious.nsh 2023-01-10 16:44:21.000000000 +0100 @@ -0,0 +1,50 @@ +Delete "$INSTDIR\libgcc_s_dw2-1.dll" +Delete "$INSTDIR\mingwm10.dll" +Delete "$INSTDIR\NovProg2.exe" +Delete "$INSTDIR\Qt5Core.dll" +Delete "$INSTDIR\Qt5Gui.dll" +Delete "$INSTDIR\Qt5Widgets.dll" +Delete "$INSTDIR\QtCore4.dll" +Delete "$INSTDIR\QtGui4.dll" +Delete "$INSTDIR\translations\qtbase_bg.qm" +Delete "$INSTDIR\translations\qtbase_ca.qm" +Delete "$INSTDIR\translations\qtbase_cs.qm" +Delete "$INSTDIR\translations\qtbase_da.qm" +Delete "$INSTDIR\translations\qtbase_de.qm" +Delete "$INSTDIR\translations\qtbase_en.qm" +Delete "$INSTDIR\translations\qtbase_es.qm" +Delete "$INSTDIR\translations\qtbase_fi.qm" +Delete "$INSTDIR\translations\qtbase_fr.qm" +Delete "$INSTDIR\translations\qtbase_gd.qm" +Delete "$INSTDIR\translations\qtbase_he.qm" +Delete "$INSTDIR\translations\qtbase_hu.qm" +Delete "$INSTDIR\translations\qtbase_it.qm" +Delete "$INSTDIR\translations\qtbase_ja.qm" +Delete "$INSTDIR\translations\qtbase_ko.qm" +Delete "$INSTDIR\translations\qtbase_lv.qm" +Delete "$INSTDIR\translations\qtbase_pl.qm" +Delete "$INSTDIR\translations\qtbase_ru.qm" +Delete "$INSTDIR\translations\qtbase_sk.qm" +Delete "$INSTDIR\translations\qtbase_uk.qm" +Delete "$INSTDIR\translations\qt_gl.qm" +Delete "$INSTDIR\translations\qt_help_cs.qm" +Delete "$INSTDIR\translations\qt_help_da.qm" +Delete "$INSTDIR\translations\qt_help_de.qm" +Delete "$INSTDIR\translations\qt_help_en.qm" +Delete "$INSTDIR\translations\qt_help_fr.qm" +Delete "$INSTDIR\translations\qt_help_gl.qm" +Delete "$INSTDIR\translations\qt_help_hu.qm" +Delete "$INSTDIR\translations\qt_help_it.qm" +Delete "$INSTDIR\translations\qt_help_ja.qm" +Delete "$INSTDIR\translations\qt_help_ko.qm" +Delete "$INSTDIR\translations\qt_help_pl.qm" +Delete "$INSTDIR\translations\qt_help_ru.qm" +Delete "$INSTDIR\translations\qt_help_sk.qm" +Delete "$INSTDIR\translations\qt_help_sl.qm" +Delete "$INSTDIR\translations\qt_help_uk.qm" +Delete "$INSTDIR\translations\qt_help_zh_CN.qm" +Delete "$INSTDIR\translations\qt_help_zh_TW.qm" +Delete "$INSTDIR\translations\qt_lt.qm" +Delete "$INSTDIR\translations\qt_pt.qm" +Delete "$INSTDIR\translations\qt_sl.qm" +Delete "$INSTDIR\translations\qt_sv.qm" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/novprog-3.2.0/windows_deploy.bat new/novprog-3.2.2/windows_deploy.bat --- old/novprog-3.2.0/windows_deploy.bat 2021-09-21 19:36:46.000000000 +0200 +++ new/novprog-3.2.2/windows_deploy.bat 2023-01-10 16:44:21.000000000 +0100 @@ -4,7 +4,7 @@ SET SRCDIR=..\novprog SET APP=NovProg -SET VERSION=3.2.0 +SET VERSION=3.2.2 ECHO Copying executable MKDIR %SRCDIR%\%APP%