Minor changes and MimeType support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Syping 2021-05-27 02:28:41 +02:00
parent f4b4450f69
commit 4a293b6acd
11 changed files with 60 additions and 50 deletions

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Install packages # Install packages
.ci/debian_install.sh && \ .ci/debian_install.sh && \

View file

@ -1,15 +1,15 @@
#!/bin/bash #!/usr/bin/env bash
if [ "${DOCKER_USER}" != "" ]; then if [ "${DOCKER_USER}" != "" ]; then
DOCKER_IMAGE=${DOCKER_USER}/debian:${DEBIAN_VERSION} DOCKER_IMAGE=${DOCKER_USER}/debian:${DEBIAN_VERSION}
else else
DOCKER_IMAGE=debian:${DEBIAN_VERSION} DOCKER_IMAGE=debian:${DEBIAN_VERSION}
fi fi
PROJECT_DIR_DOCKER=/gta5view PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \ cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh" /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export APT_INSTALL=${APT_INSTALL} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/debian_install.sh && .ci/debian_build.sh"

View file

@ -5,7 +5,7 @@
!define WEB_SITE "https://gta5view.syping.de/" !define WEB_SITE "https://gta5view.syping.de/"
!define VERSION "1.10.0.0" !define VERSION "1.10.0.0"
!define COPYRIGHT "Copyright © 2016-2021 Syping" !define COPYRIGHT "Copyright © 2016-2021 Syping"
!define DESCRIPTION "Grand Theft Auto V Savegame and Snapmatic Viewer/Editor" !define DESCRIPTION "Open Source Snapmatic and Savegame viewer/editor for GTA V"
!define INSTALLER_NAME "gta5view_setup.exe" !define INSTALLER_NAME "gta5view_setup.exe"
!define MAIN_APP_EXE "gta5view.exe" !define MAIN_APP_EXE "gta5view.exe"
!define INSTALL_TYPE "SetShellVarContext all" !define INSTALL_TYPE "SetShellVarContext all"

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.10-static DOCKER_IMAGE=sypingauto/gta5view-build:1.10-static
PROJECT_DIR_DOCKER=/gta5view PROJECT_DIR_DOCKER=/gta5view
@ -6,20 +6,20 @@ PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \ cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \ /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/windows_build.sh" && \
# Prepare environment variable # Prepare environment variable
export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \ export GTA5VIEW_EXECUTABLE=gta5view-${EXECUTABLE_VERSION}${EXECUTABLE_ARCH}.exe && \
# Upload Assets to Dropbox # Upload Assets to Dropbox
if [ "${PACKAGE_CODE}" == "gta5-mods" ]; then if [ "${PACKAGE_CODE}" == "gta5-mods" ]; then
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION} ${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gta5-mods/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \ ${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gta5-mods/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE} rm -rf ${GTA5VIEW_EXECUTABLE}
elif [ "${PACKAGE_CODE}" == "gtainside" ]; then elif [ "${PACKAGE_CODE}" == "gtainside" ]; then
${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gtainside/${PACKAGE_VERSION} ${PROJECT_DIR}/.ci/dropbox_uploader.sh mkdir gtainside/${PACKAGE_VERSION}
${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gtainside/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \ ${PROJECT_DIR}/.ci/dropbox_uploader.sh upload ${PROJECT_DIR}/assets/${GTA5VIEW_EXECUTABLE} gtainside/${PACKAGE_VERSION}/${GTA5VIEW_EXECUTABLE} && \
rm -rf ${GTA5VIEW_EXECUTABLE} rm -rf ${GTA5VIEW_EXECUTABLE}
fi fi

View file

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
DOCKER_IMAGE=sypingauto/gta5view-build:1.10-shared DOCKER_IMAGE=sypingauto/gta5view-build:1.10-shared
PROJECT_DIR_DOCKER=/gta5view PROJECT_DIR_DOCKER=/gta5view
@ -6,6 +6,6 @@ PROJECT_DIR_DOCKER=/gta5view
cd ${PROJECT_DIR} && \ cd ${PROJECT_DIR} && \
docker pull ${DOCKER_IMAGE} && \ docker pull ${DOCKER_IMAGE} && \
docker run --rm \ docker run --rm \
-v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \ -v "${PROJECT_DIR}:${PROJECT_DIR_DOCKER}" \
${DOCKER_IMAGE} \ ${DOCKER_IMAGE} \
/bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh" /bin/bash -c "export PROJECT_DIR=${PROJECT_DIR_DOCKER} && export QT_SELECT=${QT_SELECT} && export APPLICATION_VERSION=${APPLICATION_VERSION} && export APPLICATION_COMMIT=${APPLICATION_COMMIT} && export BUILD_TYPE=${BUILD_TYPE} && export QMAKE_FLAGS_QT4=${QMAKE_FLAGS_QT4} && export QMAKE_FLAGS_QT5=${QMAKE_FLAGS_QT5} && export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} && export QMAKE_BUILD_TYPE=${QMAKE_BUILD_TYPE} && export PACKAGE_VERSION=${PACKAGE_VERSION} && export PACKAGE_BUILD=${PACKAGE_BUILD} && export PACKAGE_CODE=${PACKAGE_CODE} && export EXECUTABLE_VERSION=${EXECUTABLE_VERSION} && export EXECUTABLE_ARCH=${EXECUTABLE_ARCH} && cd ${PROJECT_DIR_DOCKER} && .ci/wininstall_build.sh"

View file

@ -365,6 +365,7 @@ target_link_libraries(gta5view PRIVATE Qt${QT_VERSION_MAJOR}::Network Qt${QT_VER
install(TARGETS gta5view DESTINATION bin) install(TARGETS gta5view DESTINATION bin)
install(FILES res/de.syping.gta5view.desktop DESTINATION share/applications) install(FILES res/de.syping.gta5view.desktop DESTINATION share/applications)
install(FILES res/de.syping.gta5view.metainfo.xml DESTINATION share/metainfo) install(FILES res/de.syping.gta5view.metainfo.xml DESTINATION share/metainfo)
install(FILES res/de.syping.gta5view.xml DESTINATION share/mime/packages)
install(FILES res/gta5view-16.png DESTINATION share/icons/hicolor/16x16/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-16.png DESTINATION share/icons/hicolor/16x16/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-24.png DESTINATION share/icons/hicolor/24x24/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-24.png DESTINATION share/icons/hicolor/24x24/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-32.png DESTINATION share/icons/hicolor/32x32/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-32.png DESTINATION share/icons/hicolor/32x32/apps RENAME de.syping.gta5view.png)
@ -374,7 +375,6 @@ install(FILES res/gta5view-96.png DESTINATION share/icons/hicolor/96x96/apps REN
install(FILES res/gta5view-128.png DESTINATION share/icons/hicolor/128x128/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-128.png DESTINATION share/icons/hicolor/128x128/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-256.png DESTINATION share/icons/hicolor/256x256/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-256.png DESTINATION share/icons/hicolor/256x256/apps RENAME de.syping.gta5view.png)
install(FILES res/gta5view-512.png DESTINATION share/icons/hicolor/512x512/apps RENAME de.syping.gta5view.png) install(FILES res/gta5view-512.png DESTINATION share/icons/hicolor/512x512/apps RENAME de.syping.gta5view.png)
install(FILES res/de.syping.gta5view.png DESTINATION share/pixmaps)
if(QCONF_BUILD) if(QCONF_BUILD)
include(res/img.cmake) include(res/img.cmake)
install(FILES ${GTA5VIEW_IMGFILES} DESTINATION share/gta5view/resources) install(FILES ${GTA5VIEW_IMGFILES} DESTINATION share/gta5view/resources)

View file

@ -266,11 +266,13 @@ void ProfileInterface::loadingProgress(int value, int maximum)
void ProfileInterface::directoryChanged(const QString &path) void ProfileInterface::directoryChanged(const QString &path)
{ {
Q_UNUSED(path) Q_UNUSED(path)
QDir dir(profileFolder); QDir dir(profileFolder);
QVector<QString> t_savegameFiles; QVector<QString> t_savegameFiles;
QVector<QString> t_snapmaticPics; QVector<QString> t_snapmaticPics;
QVector<QString> n_savegameFiles; QVector<QString> n_savegameFiles;
QVector<QString> n_snapmaticPics; QVector<QString> n_snapmaticPics;
const QStringList files = dir.entryList(QDir::Files); const QStringList files = dir.entryList(QDir::Files);
for (const QString &fileName : files) { for (const QString &fileName : files) {
if (fileName.startsWith("SGTA5") && !fileName.endsWith(".bak")) { if (fileName.startsWith("SGTA5") && !fileName.endsWith(".bak")) {
@ -290,26 +292,24 @@ void ProfileInterface::directoryChanged(const QString &path)
snapmaticPics = t_snapmaticPics; snapmaticPics = t_snapmaticPics;
if (!n_savegameFiles.isEmpty() || !n_snapmaticPics.isEmpty()) { if (!n_savegameFiles.isEmpty() || !n_snapmaticPics.isEmpty()) {
QEventLoop loop; QTimer::singleShot(1000, this, [=](){
QTimer::singleShot(1000, &loop, SLOT(quit())); for (const QString &fileName : qAsConst(n_savegameFiles)) {
loop.exec(); const QString filePath = profileFolder % "/" % fileName;
SavegameData *savegame = new SavegameData(filePath);
for (const QString &fileName : qAsConst(n_savegameFiles)) { if (savegame->readingSavegame())
const QString filePath = profileFolder % "/" % fileName; savegameLoaded(savegame, filePath, true);
SavegameData *savegame = new SavegameData(filePath); else
if (savegame->readingSavegame()) delete savegame;
savegameLoaded(savegame, filePath, true); }
else for (const QString &fileName : qAsConst(n_snapmaticPics)) {
delete savegame; const QString filePath = profileFolder % "/" % fileName;
} SnapmaticPicture *picture = new SnapmaticPicture(filePath);
for (const QString &fileName : qAsConst(n_snapmaticPics)) { if (picture->readingPicture(true))
const QString filePath = profileFolder % "/" % fileName; pictureLoaded(picture, true);
SnapmaticPicture *picture = new SnapmaticPicture(filePath); else
if (picture->readingPicture(true)) delete picture;
pictureLoaded(picture, true); }
else });
delete picture;
}
} }
} }
@ -318,7 +318,7 @@ void ProfileInterface::directoryScanned(QVector<QString> savegameFiles_s, QVecto
savegameFiles = savegameFiles_s; savegameFiles = savegameFiles_s;
snapmaticPics = snapmaticPics_s; snapmaticPics = snapmaticPics_s;
fileSystemWatcher.addPath(profileFolder); fileSystemWatcher.addPath(profileFolder);
QObject::connect(&fileSystemWatcher, SIGNAL(directoryChanged(QString)), this, SLOT(directoryChanged(QString))); QObject::connect(&fileSystemWatcher, &QFileSystemWatcher::directoryChanged, this, &ProfileInterface::directoryChanged);
} }
#endif #endif

View file

@ -1,5 +1,5 @@
## gta5view ## gta5view
Grand Theft Auto V Savegame and Snapmatic viewer/editor Open Source Snapmatic and Savegame viewer/editor for GTA V
- View Snapmatics with the ability to disable them in-game - View Snapmatics with the ability to disable them in-game
- Edit Snapmatic pictures and properties in multiple ways - Edit Snapmatic pictures and properties in multiple ways

View file

@ -4,8 +4,9 @@ Name=gta5view
Comment=Open and edit GTA V profiles Comment=Open and edit GTA V profiles
Comment[de]=GTA V Profile öffnen und bearbeiten Comment[de]=GTA V Profile öffnen und bearbeiten
Comment[ru]=Просмотрщик и редактор профилей GTA V Comment[ru]=Просмотрщик и редактор профилей GTA V
Categories=Qt;Utility;FileTools Comment[zh_TW]= GTA V
Exec=gta5view Categories=Qt;Utility;FileTools;
TryExec=gta5view
Exec=gta5view %f
Icon=de.syping.gta5view Icon=de.syping.gta5view
Terminal=false MimeType=application/x-gta5view-export;
StartupNotify=false

View file

@ -11,11 +11,12 @@
<summary>Open and edit GTA V profiles</summary> <summary>Open and edit GTA V profiles</summary>
<summary xml:lang="de">GTA V Profile öffnen und bearbeiten</summary> <summary xml:lang="de">GTA V Profile öffnen und bearbeiten</summary>
<summary xml:lang="ru">Просмотрщик и редактор профилей GTA V</summary> <summary xml:lang="ru">Просмотрщик и редактор профилей GTA V</summary>
<summary xml:lang="zh-TW">打開與編輯 GTA V 個人檔案</summary>
<icon type="remote">https://img.syping.de/gta5view/gta5view.png</icon> <icon type="remote">https://img.syping.de/gta5view/gta5view.png</icon>
<description> <description>
<p>Open Source Snapmatic picture and Savegame viewer/editor for GTA V</p> <p>Open Source Snapmatic and Savegame viewer/editor for GTA V</p>
<p>Features</p> <p>Features</p>
<ul> <ul>
<li>View Snapmatics with the ability to disable them in-game</li> <li>View Snapmatics with the ability to disable them in-game</li>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-gta5view-export">
<comment>gta5view Export</comment>
<glob pattern="*.g5e"/>
<generic-icon name="de.syping.gta5view"/>
</mime-type>
</mime-info>