finishing up gta5view 1.4.0
This commit is contained in:
parent
8ddd79d667
commit
e047e1b44d
19 changed files with 340 additions and 110 deletions
|
@ -17,22 +17,22 @@ install:
|
|||
before_script:
|
||||
- export INSTALL_ROOT=/usr
|
||||
- if [ `git name-rev --tags --name-only $(git rev-parse HEAD)` == "undefined" ]; then export APPLICATION_VERSION="$PACKAGE_VERSION.$TRAVIS_BUILD_NUMBER"; else export APPLICATION_VERSION=`git name-rev --tags --name-only $(git rev-parse HEAD)`; fi
|
||||
- echo "gta5view build version is $PACKAGE_VERSION"
|
||||
- echo "gta5view build version is $APPLICATION_VERSION"
|
||||
- mkdir build
|
||||
- mkdir package
|
||||
- cd build
|
||||
- echo "Grand Theft Auto V Snapmatic and Savegame viewer" > ./description-pak
|
||||
|
||||
script:
|
||||
- qmake -qt=5 "DEFINES+=GTA5SYNC_DAILYB=\\\\\\\"$PACKAGE_VERSION-rc2\\\\\\\"" ../gta5view.pro
|
||||
- qmake -qt=5 "DEFINES+=GTA5SYNC_BUILDTYPE=\\\\\\\"Release\\\\\\\"" "DEFINES+=GTA5SYNC_DAILYB=\\\\\\\"$APPLICATION_VERSION\\\\\\\"" ../gta5view.pro
|
||||
- make -j 4
|
||||
- sudo checkinstall -D --default --nodoc --pkgname=gta5view --pkgversion=$PACKAGE_VERSION --pkgrelease=rc2 --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5 --pakdir=../package
|
||||
- sudo checkinstall -D --default --nodoc --pkgname=gta5view --pkgversion=$APPLICATION_VERSION --pkgrelease=travis1 --pkggroup=utility --maintainer="Syping on Travis \<travisci@syping.de\>" --requires=libqt5core5a,libqt5gui5,libqt5network5,libqt5widgets5 --pakdir=../package
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
secure: "o7VneEz1aHfdVwZvOZLfopf6uJWNrFsZaBvunTmXFzpmNFhlNS1qwqgMUkIA2yBRbZ3wIzVs4vfwIHv7W9yE/PqK+AYL+R8+AwKGrwlgT4HqJNuk6VM/LNJ6GwT/qkQuaoOVw29bUjmzzgIRdHmw53SlJv6Hh1VE8HphlTT//aex6nCfcFhUZ0BETdZDWz5FSHwL3NalUoqfKfQrJeky5RXzCyCANQC2tKt0bV46GaWIgWrDo2KCTNqPtRWWf5GDmnkXE5IYRMQ3mXvO9iYh0v5Y2jo4PiXGUiFUU6Z3aAWFAiPdGclrBO697cf3lCTzDMhuCETR153qFYsLShUlFf61ITAmCeHAWETjZDri0lmPONo3GoNB6alGfYEA51qw14kXakrTpICtTJj7gw/gtUYOabW6hrzmieNzMBIy62RikDPjyakFnuwW2qNHRlD65e0jYv+6nCpb6E+OV16Ysh1zhV2vTfpfzVmSuyu2J+ELqXD3OZCXRSPpDIih9UQ8335p8FBji6jHORcgym/TRgdgRmENibh8tLzWp+UjpWHuWfcpvZgOskjfwU0iDMCayMJ7tDpOhXHcAhDRnd6XRIiOJ5YZCzflj2nEwmt3YUd7DwXS/AU+WHOmcNQBjXBxF/FJa35XXcy3HKJM5TTKqtph3medo30us5yXHeG6NNg="
|
||||
file: "../package/gta5view_$PACKAGE_VERSION-rc2_amd64.deb"
|
||||
file: "../package/gta5view_$APPLICATION_VERSION-travis1_amd64.deb"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
|
|
17
AppEnv.cpp
17
AppEnv.cpp
|
@ -56,11 +56,11 @@ QString AppEnv::getGameFolder(bool *ok)
|
|||
QString GTAV_defaultFolder = StandardPaths::documentsLocation() + QDir::separator() + "Rockstar Games" + QDir::separator() + "GTA V";
|
||||
QString GTAV_returnFolder = GTAV_defaultFolder;
|
||||
|
||||
QSettings SyncSettings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
SyncSettings.beginGroup("dir");
|
||||
bool forceDir = SyncSettings.value("force", false).toBool();
|
||||
GTAV_returnFolder = SyncSettings.value("dir", GTAV_defaultFolder).toString();
|
||||
SyncSettings.endGroup();
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
settings.beginGroup("dir");
|
||||
bool forceDir = settings.value("force", false).toBool();
|
||||
GTAV_returnFolder = settings.value("dir", GTAV_defaultFolder).toString();
|
||||
settings.endGroup();
|
||||
|
||||
if (forceDir)
|
||||
{
|
||||
|
@ -125,9 +125,14 @@ QByteArray AppEnv::getUserAgent()
|
|||
return QString("Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 %1/%2").arg(GTA5SYNC_APPSTR, GTA5SYNC_APPVER).toUtf8();
|
||||
}
|
||||
|
||||
// QUrl AppEnv::getCrewFetchingUrl(QString crewID)
|
||||
// {
|
||||
// return QUrl(QString("https://socialclub.rockstargames.com/reference/crewfeed/%1").arg(crewID));
|
||||
// }
|
||||
|
||||
QUrl AppEnv::getCrewFetchingUrl(QString crewID)
|
||||
{
|
||||
return QUrl(QString("https://socialclub.rockstargames.com/reference/crewfeed/%1").arg(crewID));
|
||||
return QUrl(QString("https://socialclub.rockstargames.com/crew/%1/%1").arg(crewID));
|
||||
}
|
||||
|
||||
QUrl AppEnv::getPlayerFetchingUrl(QString crewID, QString pageNumber)
|
||||
|
|
|
@ -82,6 +82,80 @@ void DatabaseThread::run()
|
|||
}
|
||||
}
|
||||
|
||||
// void DatabaseThread::scanCrewReference(QStringList crewList, int requestDelay)
|
||||
// {
|
||||
// foreach (const QString &crewID, crewList)
|
||||
// {
|
||||
// if (threadRunning && crewID != "0")
|
||||
// {
|
||||
// QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||
|
||||
// QNetworkRequest netRequest(AppEnv::getCrewFetchingUrl(crewID));
|
||||
// netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||
// netRequest.setRawHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
// netRequest.setRawHeader("Accept-Language", "en-US;q=0.5,en;q=0.3");
|
||||
// netRequest.setRawHeader("Connection", "keep-alive");
|
||||
|
||||
// QNetworkReply *netReply = netManager->get(netRequest);
|
||||
|
||||
// QEventLoop *downloadLoop = new QEventLoop();
|
||||
// QObject::connect(netReply, SIGNAL(finished()), downloadLoop, SLOT(quit()));
|
||||
// QObject::connect(this, SIGNAL(threadEndCommited()), downloadLoop, SLOT(quit()));
|
||||
// QTimer::singleShot(30000, downloadLoop, SLOT(quit()));
|
||||
// downloadLoop->exec();
|
||||
// delete downloadLoop;
|
||||
|
||||
// if (netReply->isFinished())
|
||||
// {
|
||||
// QByteArray crewJson = netReply->readAll();
|
||||
// QJsonDocument crewDocument = QJsonDocument::fromJson(crewJson);
|
||||
// QJsonObject crewObject = crewDocument.object();
|
||||
// QVariantMap crewMap = crewObject.toVariantMap();
|
||||
// QString crewName;
|
||||
// bool isFound = false;
|
||||
|
||||
// if (crewMap.contains("activities"))
|
||||
// {
|
||||
// QList<QVariant> activitiesList = crewMap["activities"].toList();
|
||||
// foreach (const QVariant &activitiesVariant, activitiesList)
|
||||
// {
|
||||
// QMap<QString, QVariant> activityRootMap = activitiesVariant.toMap();
|
||||
// foreach(const QVariant &activityRootVariant, activityRootMap)
|
||||
// {
|
||||
// QMap<QString, QVariant> activityMap = activityRootVariant.toMap();
|
||||
// foreach(const QVariant &activityVariant, activityMap)
|
||||
// {
|
||||
// QMap<QString, QVariant> activityFinalMap = activityVariant.toMap();
|
||||
// if (activityFinalMap.contains("id") && activityFinalMap["id"] == crewID)
|
||||
// {
|
||||
// if (activityFinalMap.contains("name") && isFound == false)
|
||||
// {
|
||||
// isFound = true;
|
||||
// crewName = activityFinalMap["name"].toString();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (!crewName.isNull())
|
||||
// {
|
||||
// crewDB->setCrewName(crewID.toInt(), crewName);
|
||||
// }
|
||||
// }
|
||||
|
||||
// QEventLoop *waitingLoop = new QEventLoop();
|
||||
// QTimer::singleShot(requestDelay, waitingLoop, SLOT(quit()));
|
||||
// QObject::connect(this, SIGNAL(threadEndCommited()), waitingLoop, SLOT(quit()));
|
||||
// waitingLoop->exec();
|
||||
// delete waitingLoop;
|
||||
|
||||
// delete netReply;
|
||||
// delete netManager;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
void DatabaseThread::scanCrewReference(QStringList crewList, int requestDelay)
|
||||
{
|
||||
foreach (const QString &crewID, crewList)
|
||||
|
@ -91,6 +165,9 @@ void DatabaseThread::scanCrewReference(QStringList crewList, int requestDelay)
|
|||
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||
|
||||
QNetworkRequest netRequest(AppEnv::getCrewFetchingUrl(crewID));
|
||||
#if QT_VERSION >= 0x050600
|
||||
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
#endif
|
||||
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||
netRequest.setRawHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
netRequest.setRawHeader("Accept-Language", "en-US;q=0.5,en;q=0.3");
|
||||
|
@ -107,38 +184,18 @@ void DatabaseThread::scanCrewReference(QStringList crewList, int requestDelay)
|
|||
|
||||
if (netReply->isFinished())
|
||||
{
|
||||
QByteArray crewJson = netReply->readAll();
|
||||
QJsonDocument crewDocument = QJsonDocument::fromJson(crewJson);
|
||||
QJsonObject crewObject = crewDocument.object();
|
||||
QVariantMap crewMap = crewObject.toVariantMap();
|
||||
QString crewName;
|
||||
bool isFound = false;
|
||||
|
||||
if (crewMap.contains("activities"))
|
||||
QByteArray crewHtml = netReply->readAll();
|
||||
QStringList crewHtmlSplit1 = QString::fromUtf8(crewHtml).split("<title>Rockstar Games Social Club - Crew : ");
|
||||
if (crewHtmlSplit1.length() >= 2)
|
||||
{
|
||||
QList<QVariant> activitiesList = crewMap["activities"].toList();
|
||||
foreach (const QVariant &activitiesVariant, activitiesList)
|
||||
QStringList crewHtmlSplit2 = QString(crewHtmlSplit1.at(1)).split("</title>");
|
||||
if (crewHtmlSplit2.length() >= 1)
|
||||
{
|
||||
QMap<QString, QVariant> activityRootMap = activitiesVariant.toMap();
|
||||
foreach(const QVariant &activityRootVariant, activityRootMap)
|
||||
{
|
||||
QMap<QString, QVariant> activityMap = activityRootVariant.toMap();
|
||||
foreach(const QVariant &activityVariant, activityMap)
|
||||
{
|
||||
QMap<QString, QVariant> activityFinalMap = activityVariant.toMap();
|
||||
if (activityFinalMap.contains("id") && activityFinalMap["id"] == crewID)
|
||||
{
|
||||
if (activityFinalMap.contains("name") && isFound == false)
|
||||
{
|
||||
isFound = true;
|
||||
crewName = activityFinalMap["name"].toString();
|
||||
crewName = crewHtmlSplit2.at(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!crewName.isNull())
|
||||
if (!crewName.isEmpty())
|
||||
{
|
||||
crewDB->setCrewName(crewID.toInt(), crewName);
|
||||
}
|
||||
|
@ -171,6 +228,9 @@ void DatabaseThread::scanCrewMembersList(QStringList crewList, int maxPages, int
|
|||
QNetworkAccessManager *netManager = new QNetworkAccessManager();
|
||||
|
||||
QNetworkRequest netRequest(AppEnv::getPlayerFetchingUrl(crewID, QString::number(currentPage)));
|
||||
#if QT_VERSION >= 0x050600
|
||||
netRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
#endif
|
||||
netRequest.setRawHeader("User-Agent", AppEnv::getUserAgent());
|
||||
netRequest.setRawHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
netRequest.setRawHeader("Accept-Language", "en-US;q=0.5,en;q=0.3");
|
||||
|
|
|
@ -91,3 +91,13 @@ void ProfileLoader::run()
|
|||
crewDB->addCrew(crewID);
|
||||
}
|
||||
}
|
||||
|
||||
void ProfileLoader::preloaded()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ProfileLoader::loaded()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -39,6 +39,10 @@ private:
|
|||
CrewDatabase *crewDB;
|
||||
ProfileLoader *profileLoader;
|
||||
|
||||
private slots:
|
||||
void preloaded();
|
||||
void loaded();
|
||||
|
||||
signals:
|
||||
void pictureLoaded(SnapmaticPicture *picture);
|
||||
void savegameLoaded(SavegameData *savegame, QString savegamePath);
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<layout class="QHBoxLayout" name="hlSavegame">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbSelected">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "SnapmaticPicture.h"
|
||||
#include "StringParser.h"
|
||||
#include "AppEnv.h"
|
||||
#include <QStringBuilder>
|
||||
#include <QTextDocument>
|
||||
#include <QInputDialog>
|
||||
#include <QMessageBox>
|
||||
|
@ -230,7 +231,7 @@ void SnapmaticEditor::on_cmdApply_clicked()
|
|||
{
|
||||
adjustedFileName.remove(adjustedFileName.length() - 7, 7);
|
||||
}
|
||||
QString backupFileName = adjustedFileName + ".bak";
|
||||
QString backupFileName = adjustedFileName % ".bak";
|
||||
if (!QFile::exists(backupFileName))
|
||||
{
|
||||
QFile::copy(adjustedFileName, backupFileName);
|
||||
|
@ -307,6 +308,10 @@ void SnapmaticEditor::on_labCrew_linkActivated(const QString &link)
|
|||
int indexNum = 0;
|
||||
QStringList itemList;
|
||||
QStringList crewList = crewDB->getCrews();
|
||||
if (!crewList.contains(QLatin1String("0")))
|
||||
{
|
||||
crewList.append(QLatin1String("0"));
|
||||
}
|
||||
crewList.sort();
|
||||
foreach(const QString &crew, crewList)
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "SnapmaticPicture.h"
|
||||
#include "StringParser.h"
|
||||
#include <QStringBuilder>
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonObject>
|
||||
#include <QStringList>
|
||||
|
@ -73,6 +74,7 @@ void SnapmaticPicture::reset()
|
|||
jpegRawContentSize = 0;
|
||||
picExportFileName = "";
|
||||
isCustomFormat = 0;
|
||||
isLoadedInRAM = 0;
|
||||
pictureHead = "";
|
||||
pictureStr = "";
|
||||
lowRamMode = 0;
|
||||
|
@ -90,37 +92,26 @@ void SnapmaticPicture::reset()
|
|||
localSpJson = {};
|
||||
}
|
||||
|
||||
bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bool fastLoad, bool lowRamMode_)
|
||||
bool SnapmaticPicture::preloadFile()
|
||||
{
|
||||
// Start opening file
|
||||
// lastStep is like currentStep
|
||||
|
||||
// Set boolean values
|
||||
writeEnabled = writeEnabled_;
|
||||
cacheEnabled = cacheEnabled_;
|
||||
lowRamMode = lowRamMode_;
|
||||
if (!writeEnabled) { lowRamMode = false; } // Low RAM Mode only works when writeEnabled is true
|
||||
|
||||
QFile *picFile = new QFile(picFilePath);
|
||||
picFileName = QFileInfo(picFilePath).fileName();
|
||||
|
||||
QIODevice *picStream;
|
||||
|
||||
if (!picFile->open(QFile::ReadOnly))
|
||||
{
|
||||
lastStep = "1;/1,OpenFile," + StringParser::convertDrawStringForLog(picFilePath);
|
||||
lastStep = "1;/1,OpenFile," % StringParser::convertDrawStringForLog(picFilePath);
|
||||
delete picFile;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (picFilePath.right(4) != ".g5e")
|
||||
if (picFilePath.right(4) != QLatin1String(".g5e"))
|
||||
{
|
||||
rawPicContent = picFile->read(snapmaticFileMaxSize);
|
||||
picFile->close();
|
||||
delete picFile;
|
||||
|
||||
// Set Custom Format
|
||||
// Setting is values
|
||||
isCustomFormat = false;
|
||||
isLoadedInRAM = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -133,57 +124,78 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
|
||||
// Reading g5e Content
|
||||
g5eContent.remove(0, 1);
|
||||
if (g5eContent.left(3) == "G5E")
|
||||
if (g5eContent.left(3) == QByteArray("G5E"))
|
||||
{
|
||||
g5eContent.remove(0, 3);
|
||||
if (g5eContent.left(2).toHex() == "1000")
|
||||
if (g5eContent.left(2).toHex() == QByteArray("1000"))
|
||||
{
|
||||
g5eContent.remove(0, 2);
|
||||
if (g5eContent.left(3) == "LEN")
|
||||
if (g5eContent.left(3) == QByteArray("LEN"))
|
||||
{
|
||||
g5eContent.remove(0, 3);
|
||||
int fileNameLength = g5eContent.left(1).toHex().toInt();
|
||||
g5eContent.remove(0, 1);
|
||||
if (g5eContent.left(3) == "FIL")
|
||||
if (g5eContent.left(3) == QByteArray("FIL"))
|
||||
{
|
||||
g5eContent.remove(0, 3);
|
||||
picFileName = g5eContent.left(fileNameLength);
|
||||
g5eContent.remove(0, fileNameLength);
|
||||
if (g5eContent.left(3) == "COM")
|
||||
if (g5eContent.left(3) == QByteArray("COM"))
|
||||
{
|
||||
g5eContent.remove(0, 3);
|
||||
rawPicContent = qUncompress(g5eContent);
|
||||
|
||||
// Setting is values
|
||||
isLoadedInRAM = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",4,G5E_FORMATERROR";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",4,G5E_FORMATERROR";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",3,G5E_FORMATERROR";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",3,G5E_FORMATERROR";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,G5E_FORMATERROR";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",2,G5E_FORMATERROR";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",1,G5E_NOTCOMPATIBLE";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",1,G5E_NOTCOMPATIBLE";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",1,G5E_FORMATERROR";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",1,G5E_FORMATERROR";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
emit preloaded();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bool fastLoad, bool lowRamMode_)
|
||||
{
|
||||
// Start opening file
|
||||
// lastStep is like currentStep
|
||||
|
||||
// Set boolean values
|
||||
writeEnabled = writeEnabled_;
|
||||
cacheEnabled = cacheEnabled_;
|
||||
lowRamMode = lowRamMode_;
|
||||
if (!writeEnabled) { lowRamMode = false; } // Low RAM Mode only works when writeEnabled is true
|
||||
|
||||
QIODevice *picStream;
|
||||
|
||||
if (!isLoadedInRAM) { preloadFile(); }
|
||||
|
||||
picStream = new QBuffer(&rawPicContent);
|
||||
picStream->open(QIODevice::ReadWrite);
|
||||
|
@ -191,7 +203,7 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
// Reading Snapmatic Header
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",1,NOHEADER";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",1,NOHEADER";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -202,7 +214,7 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
// Reading JPEG Header Line
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOHEADER";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",2,NOHEADER";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -211,9 +223,9 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
|
||||
// Checking for JPEG
|
||||
jpegHeaderLine.remove(0, jpegHeaderLineDifStr);
|
||||
if (jpegHeaderLine.left(4) != "JPEG")
|
||||
if (jpegHeaderLine.left(4) != QByteArray("JPEG"))
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOJPEG";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",2,NOJPEG";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -222,7 +234,7 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
// Read JPEG Stream
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",2,NOPIC";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",2,NOPIC";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -265,14 +277,14 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
// Read JSON Stream
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",3,NOJSON";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",3,NOJSON";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
}
|
||||
else if (picStream->read(4) != "JSON")
|
||||
else if (picStream->read(4) != QByteArray("JSON"))
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",3,CTJSON";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",3,CTJSON";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -283,14 +295,14 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",4,NOTITL";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",4,NOTITL";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
}
|
||||
else if (picStream->read(4) != "TITL")
|
||||
else if (picStream->read(4) != QByteArray("TITL"))
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",4,CTTITL";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",4,CTTITL";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -300,14 +312,14 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
|
||||
if (!picStream->isReadable())
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",5,NODESC";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",5,NODESC";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return picOk;
|
||||
}
|
||||
else if (picStream->read(4) != "DESC")
|
||||
else if (picStream->read(4) != QByteArray("DESC"))
|
||||
{
|
||||
lastStep = "2;/3,ReadingFile," + StringParser::convertDrawStringForLog(picFilePath) + ",5,CTDESC";
|
||||
lastStep = "2;/3,ReadingFile," % StringParser::convertDrawStringForLog(picFilePath) % ",5,CTDESC";
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
return false;
|
||||
|
@ -319,8 +331,11 @@ bool SnapmaticPicture::readingPicture(bool writeEnabled_, bool cacheEnabled_, bo
|
|||
|
||||
picStream->close();
|
||||
delete picStream;
|
||||
|
||||
if (!writeEnabled) { rawPicContent.clear(); }
|
||||
else if (lowRamMode) { rawPicContent = qCompress(rawPicContent, 9); }
|
||||
|
||||
emit loaded();
|
||||
return picOk;
|
||||
}
|
||||
|
||||
|
@ -352,26 +367,26 @@ QString SnapmaticPicture::getSnapmaticTIDEString(const QByteArray &tideBytes)
|
|||
void SnapmaticPicture::updateStrings()
|
||||
{
|
||||
QString cmpPicTitl = titlStr;
|
||||
cmpPicTitl.replace("\"", "''");
|
||||
cmpPicTitl.replace(" ", "_");
|
||||
cmpPicTitl.replace(":", "-");
|
||||
cmpPicTitl.replace("\\", "");
|
||||
cmpPicTitl.replace("{", "");
|
||||
cmpPicTitl.replace("}", "");
|
||||
cmpPicTitl.replace("/", "");
|
||||
cmpPicTitl.replace("<", "");
|
||||
cmpPicTitl.replace(">", "");
|
||||
cmpPicTitl.replace("*", "");
|
||||
cmpPicTitl.replace("?", "");
|
||||
cmpPicTitl.replace(".", "");
|
||||
cmpPicTitl.replace('\"', "''");
|
||||
cmpPicTitl.replace(' ', '_');
|
||||
cmpPicTitl.replace(':', '-');
|
||||
cmpPicTitl.remove('\\');
|
||||
cmpPicTitl.remove('{');
|
||||
cmpPicTitl.remove('}');
|
||||
cmpPicTitl.remove('/');
|
||||
cmpPicTitl.remove('<');
|
||||
cmpPicTitl.remove('>');
|
||||
cmpPicTitl.remove('*');
|
||||
cmpPicTitl.remove('?');
|
||||
cmpPicTitl.remove('.');
|
||||
pictureStr = tr("PHOTO - %1").arg(localSpJson.createdDateTime.toString("MM/dd/yy HH:mm:ss"));
|
||||
sortStr = localSpJson.createdDateTime.toString("yyMMddHHmmss") + QString::number(localSpJson.uid);
|
||||
picExportFileName = sortStr + "_" + cmpPicTitl;
|
||||
sortStr = localSpJson.createdDateTime.toString("yyMMddHHmmss") % QString::number(localSpJson.uid);
|
||||
picExportFileName = sortStr % "_" % cmpPicTitl;
|
||||
}
|
||||
|
||||
bool SnapmaticPicture::readingPictureFromFile(const QString &fileName, bool writeEnabled_, bool cacheEnabled_, bool fastLoad, bool lowRamMode_)
|
||||
{
|
||||
if (fileName != "")
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
picFilePath = fileName;
|
||||
return readingPicture(writeEnabled_, cacheEnabled_, fastLoad, lowRamMode_);
|
||||
|
@ -580,7 +595,7 @@ QImage SnapmaticPicture::getImage()
|
|||
QFile *picFile = new QFile(picFilePath);
|
||||
if (!picFile->open(QFile::ReadOnly))
|
||||
{
|
||||
lastStep = "1;/1,OpenFile," + StringParser::convertDrawStringForLog(picFilePath);
|
||||
lastStep = "1;/1,OpenFile," % StringParser::convertDrawStringForLog(picFilePath);
|
||||
delete picFile;
|
||||
return QImage(0, 0, QImage::Format_RGB888);
|
||||
}
|
||||
|
@ -781,7 +796,7 @@ bool SnapmaticPicture::exportPicture(const QString &fileName, const QString form
|
|||
QFile *picFile = new QFile(fileName);
|
||||
if (picFile->open(QIODevice::WriteOnly))
|
||||
{
|
||||
if (format == "G5E")
|
||||
if (format == QLatin1String("G5E"))
|
||||
{
|
||||
// Modern compressed export
|
||||
QByteArray stockFileNameUTF8 = picFileName.toUtf8();
|
||||
|
@ -795,14 +810,15 @@ bool SnapmaticPicture::exportPicture(const QString &fileName, const QString form
|
|||
numberLength = "00";
|
||||
}
|
||||
QByteArray g5eHeader;
|
||||
g5eHeader.reserve(stockFileNameUTF8.length() + 16);
|
||||
g5eHeader += '\x00'; // First Null Byte
|
||||
g5eHeader += "G5E"; // GTA 5 Export
|
||||
g5eHeader += QByteArray("G5E"); // GTA 5 Export
|
||||
g5eHeader += '\x10'; g5eHeader += '\x00'; // 2 byte GTA 5 Export Version
|
||||
g5eHeader += "LEN"; // Before Length
|
||||
g5eHeader += QByteArray("LEN"); // Before Length
|
||||
g5eHeader += QByteArray::fromHex(numberLength); // Length in HEX before Compressed
|
||||
g5eHeader += "FIL"; // Before File Name
|
||||
g5eHeader += QByteArray("FIL"); // Before File Name
|
||||
g5eHeader += stockFileNameUTF8; // File Name
|
||||
g5eHeader += "COM"; // Before Compressed
|
||||
g5eHeader += QByteArray("COM"); // Before Compressed
|
||||
picFile->write(g5eHeader);
|
||||
if (!lowRamMode)
|
||||
{
|
||||
|
@ -815,7 +831,7 @@ bool SnapmaticPicture::exportPicture(const QString &fileName, const QString form
|
|||
picFile->close();
|
||||
delete picFile;
|
||||
}
|
||||
else if (format == "JPG")
|
||||
else if (format == QLatin1String("JPG"))
|
||||
{
|
||||
// JPEG export
|
||||
QBuffer snapmaticStream(&rawPicContent);
|
||||
|
@ -876,7 +892,7 @@ bool SnapmaticPicture::deletePicFile()
|
|||
|
||||
bool SnapmaticPicture::isHidden()
|
||||
{
|
||||
if (picFilePath.right(7) == ".hidden")
|
||||
if (picFilePath.right(7) == QLatin1String(".hidden"))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -891,7 +907,7 @@ bool SnapmaticPicture::setPictureHidden()
|
|||
}
|
||||
if (!isHidden())
|
||||
{
|
||||
QString newPicFilePath = QString(picFilePath + ".hidden");
|
||||
QString newPicFilePath = QString(picFilePath % ".hidden");
|
||||
if (QFile::rename(picFilePath, newPicFilePath))
|
||||
{
|
||||
picFilePath = newPicFilePath;
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
explicit SnapmaticPicture(const QString &fileName = "", QObject *parent = 0);
|
||||
~SnapmaticPicture();
|
||||
void reset();
|
||||
bool preloadFile();
|
||||
bool readingPictureFromFile(const QString &fileName, bool writeEnabled = true, bool cacheEnabled = false, bool fastLoad = true, bool lowRamMode = false);
|
||||
bool readingPicture(bool writeEnabled = true, bool cacheEnabled = false, bool fastLoad = true, bool lowRamMode = false);
|
||||
bool isPicOk();
|
||||
|
@ -121,6 +122,7 @@ private:
|
|||
bool lowRamMode;
|
||||
bool writeEnabled;
|
||||
bool cacheEnabled;
|
||||
bool isLoadedInRAM;
|
||||
bool isCustomFormat;
|
||||
int jpegRawContentSize;
|
||||
int jpegRawContentSizeE;
|
||||
|
@ -138,7 +140,9 @@ private:
|
|||
static bool verifyTitleChar(const QChar &titleChar);
|
||||
|
||||
signals:
|
||||
void preloaded();
|
||||
void updated();
|
||||
void loaded();
|
||||
|
||||
public slots:
|
||||
};
|
||||
|
|
|
@ -40,6 +40,9 @@
|
|||
<layout class="QHBoxLayout" name="hlSnapmatic">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cbSelected">
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::NoFocus</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
|
|
|
@ -38,7 +38,7 @@ QString StringParser::parseTitleString(const QByteArray &commitBytes, int maxLen
|
|||
{
|
||||
Q_UNUSED(maxLength)
|
||||
QString retStr = QTextCodec::codecForName("UTF-16LE")->toUnicode(commitBytes).trimmed();
|
||||
retStr.remove(QChar((char)0x00));
|
||||
retStr.remove(QChar('\x00'));
|
||||
return retStr;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,9 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, D
|
|||
|
||||
void UserInterface::setupDirEnv()
|
||||
{
|
||||
// settings init
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
|
||||
bool folderExists;
|
||||
GTAV_Folder = AppEnv::getGameFolder(&folderExists);
|
||||
if (folderExists)
|
||||
|
@ -102,11 +105,18 @@ void UserInterface::setupDirEnv()
|
|||
folderExists = true;
|
||||
QDir::setCurrent(GTAV_Folder);
|
||||
AppEnv::setGameFolder(GTAV_Folder);
|
||||
|
||||
// First time folder selection save
|
||||
settings.beginGroup("dir");
|
||||
if (settings.value("dir", "").toString().isEmpty())
|
||||
{
|
||||
settings.setValue("dir", GTAV_Folder);
|
||||
}
|
||||
settings.endGroup();
|
||||
}
|
||||
}
|
||||
|
||||
// profiles init
|
||||
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
|
||||
settings.beginGroup("Profile");
|
||||
QString defaultProfile = settings.value("Default", "").toString();
|
||||
|
||||
|
|
4
config.h
4
config.h
|
@ -50,14 +50,14 @@
|
|||
|
||||
#ifndef GTA5SYNC_APPVER
|
||||
#ifndef GTA5SYNC_DAILYB
|
||||
#define GTA5SYNC_APPVER "1.4.0-rc2"
|
||||
#define GTA5SYNC_APPVER "1.4.0"
|
||||
#else
|
||||
#define GTA5SYNC_APPVER QString("%1").arg(GTA5SYNC_DAILYB)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GTA5SYNC_BUILDTYPE
|
||||
#define GTA5SYNC_BUILDTYPE "Release Candidate"
|
||||
#define GTA5SYNC_BUILDTYPE "Custom"
|
||||
#endif
|
||||
|
||||
#ifndef GTA5SYNC_SHARE
|
||||
|
|
|
@ -132,6 +132,9 @@ win32: RC_FILE += res/app.rc
|
|||
win32: LIBS += -luser32
|
||||
win32: CONFIG -= embed_manifest_exe
|
||||
|
||||
# MAC OS X ONLY
|
||||
macx: ICON = res/5sync.icns
|
||||
|
||||
# QT4 ONLY STUFF
|
||||
|
||||
isEqual(QT_MAJOR_VERSION, 4): INCLUDEPATH += ./qjson4
|
||||
|
|
BIN
res/5sync.icns
Normal file
BIN
res/5sync.icns
Normal file
Binary file not shown.
|
@ -31,10 +31,11 @@
|
|||
<qresource prefix="/global">
|
||||
<file>global.de.ini</file>
|
||||
<file>global.en.ini</file>
|
||||
<file>global.ja.ini</file>
|
||||
<file>global.fr.ini</file>
|
||||
<file>global.zh.ini</file>
|
||||
<file>global.es.ini</file>
|
||||
<file>global.fr.ini</file>
|
||||
<file>global.ja.ini</file>
|
||||
<file>global.ru.ini</file>
|
||||
<file>global.zh.ini</file>
|
||||
</qresource>
|
||||
<qresource prefix="/template">
|
||||
<file>template.g5e</file>
|
||||
|
|
106
res/global.ru.ini
Normal file
106
res/global.ru.ini
Normal file
|
@ -0,0 +1,106 @@
|
|||
[Global]
|
||||
AIRP="Международный аэропорт Лос-Сантос"
|
||||
ALAMO="Аламо-Си"
|
||||
ALTA="Альта"
|
||||
ARMYB="Форт-Занкудо"
|
||||
BANNING="Бэннинг"
|
||||
BAYTRE="Каньон Бэйтри"
|
||||
BEACH="Веспуччи-Бич"
|
||||
BHAMCA="Каньон Бэнхэм"
|
||||
BRADP="Перевал Брэддока"
|
||||
BRADT="Тоннель Брэддока"
|
||||
BURTON="Бертон"
|
||||
CALAFB="Калафиа-Бридж"
|
||||
CANNY="Каньон Ратон"
|
||||
CCREAK="Кэссиди-Крик"
|
||||
CHAMH="Чемберлен-Хиллз"
|
||||
CHIL="Вайнвуд-Хиллз"
|
||||
CHU="Чумаш"
|
||||
CMSW="Заповедник горы Чилиад"
|
||||
COSI="Загород"
|
||||
CYPRE="Сайпрес-Флэтс"
|
||||
DAVIS="Дэвис"
|
||||
DELBE="Дель-Перро-Бич"
|
||||
DELPE="Дель-Перро"
|
||||
DELSOL="Ла-Пуэрта"
|
||||
DESRT="Пустыня Гранд-Сенора"
|
||||
DOWNT="Центр"
|
||||
DTVINE="Центр Вайнвуда"
|
||||
EAST_V="Восточный Вайнвуд"
|
||||
EBURO="Эль-Бурро-Хайтс"
|
||||
ECLIPS="Эклипс"
|
||||
ELGORL="Маяк Эль-Гордо"
|
||||
ELSANT="Восточный Лос-Сантос"
|
||||
ELYSIAN="Элизиан-Айленд"
|
||||
GALFISH="Галили"
|
||||
GALLI="Галилео-Парк"
|
||||
GOLF="Гольф-клуб"
|
||||
GRAPES="Грейпсид"
|
||||
GREATC="Грейт-Чапаррал"
|
||||
HARMO="Хармони"
|
||||
HAWICK="Хавик"
|
||||
HEART="Харт-Аттакс-Бич"
|
||||
HORS="Гоночная трасса Вайнвуда"
|
||||
HUD_MG_TRI_ALA="Аламо-Си"
|
||||
HUD_MG_TRI_VES="Веспуччи"
|
||||
HUMLAB="Лаборатория Humane Labs and Research"
|
||||
JAIL="Тюрьма Болингброук"
|
||||
KOREAT="Маленький Сеул"
|
||||
LACT="Лэнд-экт-резервуар"
|
||||
LAGO="Лаго-Занкудо"
|
||||
LDAM="Лэнд-экт-дэм"
|
||||
LMESA="Ла-Меса"
|
||||
LOSPFY="Шоссе Ла-Пуэрта"
|
||||
LOSPUER="Ла-Пуэрта"
|
||||
LOSSF="Шоссе Лос-Сантоса"
|
||||
MGCR_1="Южный Лос-Сантос"
|
||||
MGCR_6="Каналы Веспуччи"
|
||||
MGSR_3="Каньон Ратон"
|
||||
MIRR="Миррор-Парк"
|
||||
MORN="Морнингвуд"
|
||||
MOVIE="Richards Majestic"
|
||||
MTCHIL="Гора Чилиад"
|
||||
MTGORDO="Гора Гордо"
|
||||
MTJOSE="Гора Джосайя"
|
||||
MURRI="Мурьета-Хайтс"
|
||||
NCHU="Северный Чумаш"
|
||||
OBSERV="Обсерватория Галилео"
|
||||
OCEANA="Тихий океан"
|
||||
PALCOV="Бухта Палето"
|
||||
PALETO="Палето-Бэй"
|
||||
PALFOR="Лес Палето"
|
||||
PALHIGH="Нагорья Паломино"
|
||||
PALMPOW="Электростанция Палмер-Тэйлор"
|
||||
PBLUFF="Пасифик-Блаффс"
|
||||
PBOX="Пиллбокс-Хилл"
|
||||
PROCOB="Прокопио-Бич"
|
||||
PROL="Северный Янктон"
|
||||
RANCHO="Ранчо"
|
||||
RGLEN="Ричман-Глен"
|
||||
RICHM="Ричман"
|
||||
ROCKF="Рокфорд-Хиллз"
|
||||
RTRAK="Трасса Redwood Lights"
|
||||
SANAND="Сан-Андреас"
|
||||
SANCHIA="Сан-Шаньский горный хребет"
|
||||
SANDY="Сэнди-Шорс"
|
||||
SENORA="Шоссе Сенора"
|
||||
SKID="Мишн-Роу"
|
||||
SLAB="Стэб-Сити"
|
||||
SLSANT="Южный Лос-Сантос"
|
||||
STAD="Арена Maze Bank"
|
||||
STRAW="Строберри"
|
||||
TATAMO="Татавиамские горы"
|
||||
TERMINA="Терминал"
|
||||
TEXTI="Текстайл-Сити"
|
||||
TONGVAH="Тонгва-Хиллз"
|
||||
TONGVAV="Долина Тонгва"
|
||||
UTOPIAG="Утопия-Гарденс"
|
||||
VCANA="Каналы Веспуччи"
|
||||
VESP="Веспуччи"
|
||||
VINE="Вайнвуд"
|
||||
WINDF="Ветряная ферма Ron Alternates"
|
||||
WMIRROR="Вест-Миррор-драйв"
|
||||
WVINE="Западный Вайнвуд"
|
||||
ZANCUDO="Река Занкудо"
|
||||
ZENORA="Шоссе Сенора"
|
||||
ZP_ORT="Порт Южного Лос-Сантоса"
|
Binary file not shown.
|
@ -1496,7 +1496,7 @@ Press 1 for Default View</source>
|
|||
<message>
|
||||
<location filename="../UserInterface.ui" line="247"/>
|
||||
<source>&Settings</source>
|
||||
<translation>Оп&ции</translation>
|
||||
<translation>&Настройки</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../UserInterface.ui" line="282"/>
|
||||
|
|
Loading…
Reference in a new issue