first development version of 1.4.x

This commit is contained in:
Syping 2017-03-01 15:19:40 +01:00
parent 1ff4f353e3
commit 24b1f32bbe
63 changed files with 4792 additions and 4350 deletions

View File

@ -25,9 +25,10 @@ AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::AboutDialog) ui(new Ui::AboutDialog)
{ {
ui->setupUi(this); // Set Window Flags
aboutStr = ui->labAbout->text(); setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
titleStr = this->windowTitle();
// Build Strings
QString appVersion = qApp->applicationVersion(); QString appVersion = qApp->applicationVersion();
QString buildType = GTA5SYNC_BUILDTYPE; QString buildType = GTA5SYNC_BUILDTYPE;
buildType.replace("_", " "); buildType.replace("_", " ");
@ -38,6 +39,11 @@ AboutDialog::AboutDialog(QWidget *parent) :
#else #else
QString projectDes = tr("A project for viewing Grand Theft Auto V Snapmatic<br/>\nPictures and Savegames"); QString projectDes = tr("A project for viewing Grand Theft Auto V Snapmatic<br/>\nPictures and Savegames");
#endif #endif
// Setup User Interface
ui->setupUi(this);
aboutStr = ui->labAbout->text();
titleStr = this->windowTitle();
ui->labAbout->setText(aboutStr.arg(appVersion % " (" % buildType % ")", buildStr, qVersion(), projectBuild, GTA5SYNC_APPVENDORLINK, GTA5SYNC_APPVENDOR, GTA5SYNC_COPYRIGHT, GTA5SYNC_APPSTR, projectDes)); ui->labAbout->setText(aboutStr.arg(appVersion % " (" % buildType % ")", buildStr, qVersion(), projectBuild, GTA5SYNC_APPVENDORLINK, GTA5SYNC_APPVENDOR, GTA5SYNC_COPYRIGHT, GTA5SYNC_APPSTR, projectDes));
this->setWindowTitle(titleStr.arg(GTA5SYNC_APPSTR)); this->setWindowTitle(titleStr.arg(GTA5SYNC_APPSTR));

View File

@ -150,9 +150,7 @@ void DatabaseThread::scanCrewReference(QStringList crewList, int requestDelay)
waitingLoop->exec(); waitingLoop->exec();
delete waitingLoop; delete waitingLoop;
netReply->deleteLater();
delete netReply; delete netReply;
netManager->deleteLater();
delete netManager; delete netManager;
} }
} }
@ -224,9 +222,7 @@ void DatabaseThread::scanCrewMembersList(QStringList crewList, int maxPages, int
currentPage++; currentPage++;
} }
netReply->deleteLater();
delete netReply; delete netReply;
netManager->deleteLater();
delete netManager; delete netManager;
} }
} }

View File

@ -23,6 +23,15 @@
#include <QImage> #include <QImage>
#include <QDebug> #include <QDebug>
// IMAGES VALUES
#define snapmaticResolutionW 960
#define snapmaticResolutionH 536
#define snapmaticResolutionLW 430
#define snapmaticResolutionLH 240
#define snapmaticAvatarResolution 470
#define snapmaticAvatarPlacementW 145
#define snapmaticAvatarPlacementH 66
ImportDialog::ImportDialog(QWidget *parent) : ImportDialog::ImportDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::ImportDialog) ui(new Ui::ImportDialog)
@ -51,7 +60,7 @@ ImportDialog::~ImportDialog()
void ImportDialog::processImage() void ImportDialog::processImage()
{ {
QImage snapmaticImage = workImage; QImage snapmaticImage = workImage;
QPixmap snapmaticPixmap(960, 536); QPixmap snapmaticPixmap(snapmaticResolutionW, snapmaticResolutionH);
snapmaticPixmap.fill(Qt::black); snapmaticPixmap.fill(Qt::black);
QPainter snapmaticPainter(&snapmaticPixmap); QPainter snapmaticPainter(&snapmaticPixmap);
if (ui->cbAvatar->isChecked()) if (ui->cbAvatar->isChecked())
@ -61,24 +70,23 @@ void ImportDialog::processImage()
int diffHeight = 0; int diffHeight = 0;
if (ui->rbKeep->isChecked()) if (ui->rbKeep->isChecked())
{ {
snapmaticImage = snapmaticImage.scaled(470, 470, Qt::KeepAspectRatio, Qt::SmoothTransformation); snapmaticImage = snapmaticImage.scaled(snapmaticAvatarResolution, snapmaticAvatarResolution, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (snapmaticImage.width() > snapmaticImage.height()) if (snapmaticImage.width() > snapmaticImage.height())
{ {
diffHeight = 470 - snapmaticImage.height(); diffHeight = snapmaticAvatarResolution - snapmaticImage.height();
diffHeight = diffHeight / 2; diffHeight = diffHeight / 2;
} }
else if (snapmaticImage.width() < snapmaticImage.height()) else if (snapmaticImage.width() < snapmaticImage.height())
{ {
diffWidth = 470 - snapmaticImage.width(); diffWidth = snapmaticAvatarResolution - snapmaticImage.width();
diffWidth = diffWidth / 2; diffWidth = diffWidth / 2;
} }
} }
else else
{ {
snapmaticImage = snapmaticImage.scaled(470, 470, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); snapmaticImage = snapmaticImage.scaled(snapmaticAvatarResolution, snapmaticAvatarResolution, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
} }
snapmaticPainter.drawImage(0, 0, avatarAreaImage); snapmaticPainter.drawImage(snapmaticAvatarPlacementW + diffWidth, snapmaticAvatarPlacementH + diffHeight, snapmaticImage);
snapmaticPainter.drawImage(145 + diffWidth, 66 + diffHeight, snapmaticImage);
imageTitle = "Custom Avatar"; imageTitle = "Custom Avatar";
} }
else else
@ -88,28 +96,28 @@ void ImportDialog::processImage()
int diffHeight = 0; int diffHeight = 0;
if (ui->rbKeep->isChecked()) if (ui->rbKeep->isChecked())
{ {
snapmaticImage = snapmaticImage.scaled(960, 536, Qt::KeepAspectRatio, Qt::SmoothTransformation); snapmaticImage = snapmaticImage.scaled(snapmaticResolutionW, snapmaticResolutionH, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (snapmaticImage.width() != 960) if (snapmaticImage.width() != snapmaticResolutionW)
{ {
diffWidth = 960 - snapmaticImage.width(); diffWidth = snapmaticResolutionW - snapmaticImage.width();
diffWidth = diffWidth / 2; diffWidth = diffWidth / 2;
} }
else if (snapmaticImage.height() != 536) else if (snapmaticImage.height() != snapmaticResolutionH)
{ {
diffHeight = 536 - snapmaticImage.height(); diffHeight = snapmaticResolutionH - snapmaticImage.height();
diffHeight = diffHeight / 2; diffHeight = diffHeight / 2;
} }
} }
else else
{ {
snapmaticImage = snapmaticImage.scaled(960, 536, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); snapmaticImage = snapmaticImage.scaled(snapmaticResolutionW, snapmaticResolutionH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
} }
snapmaticPainter.drawImage(0 + diffWidth, 0 + diffHeight, snapmaticImage); snapmaticPainter.drawImage(0 + diffWidth, 0 + diffHeight, snapmaticImage);
imageTitle = "Custom Picture"; imageTitle = "Custom Picture";
} }
snapmaticPainter.end(); snapmaticPainter.end();
newImage = snapmaticPixmap.toImage(); newImage = snapmaticPixmap.toImage();
ui->labPicture->setPixmap(snapmaticPixmap.scaled(430, 240, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); ui->labPicture->setPixmap(snapmaticPixmap.scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
} }
QImage ImportDialog::image() QImage ImportDialog::image()
@ -162,3 +170,13 @@ void ImportDialog::on_cmdOK_clicked()
doImport = true; doImport = true;
close(); close();
} }
void ImportDialog::on_labPicture_labelPainted()
{
if (ui->cbAvatar->isChecked())
{
QPainter labelPainter(ui->labPicture);
labelPainter.drawImage(0, 0, avatarAreaImage.scaled(snapmaticResolutionLW, snapmaticResolutionLH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
labelPainter.end();
}
}

View File

@ -44,6 +44,7 @@ private slots:
void on_cbAvatar_clicked(); void on_cbAvatar_clicked();
void on_cmdCancel_clicked(); void on_cmdCancel_clicked();
void on_cmdOK_clicked(); void on_cmdOK_clicked();
void on_labPicture_labelPainted();
private: private:
Ui::ImportDialog *ui; Ui::ImportDialog *ui;

View File

@ -42,7 +42,7 @@
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="labPicture"> <widget class="UiModLabel" name="labPicture">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>430</width> <width>430</width>
@ -175,6 +175,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>UiModLabel</class>
<extends>QLabel</extends>
<header>UiModLabel.h</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -37,6 +37,10 @@ OptionsDialog::OptionsDialog(ProfileDatabase *profileDB, QWidget *parent) :
QDialog(parent), profileDB(profileDB), QDialog(parent), profileDB(profileDB),
ui(new Ui::OptionsDialog) ui(new Ui::OptionsDialog)
{ {
// Set Window Flags
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
// Setup User Interface
ui->setupUi(this); ui->setupUi(this);
ui->tabWidget->setCurrentIndex(0); ui->tabWidget->setCurrentIndex(0);
ui->labPicCustomRes->setVisible(false); ui->labPicCustomRes->setVisible(false);

View File

@ -23,6 +23,7 @@
#include "SidebarGenerator.h" #include "SidebarGenerator.h"
#include "StandardPaths.h" #include "StandardPaths.h"
#include "PictureExport.h" #include "PictureExport.h"
#include "StringParser.h"
#include "GlobalString.h" #include "GlobalString.h"
#include "UiModLabel.h" #include "UiModLabel.h"
@ -89,6 +90,10 @@ PictureDialog::PictureDialog(bool primaryWindow, QWidget *parent) :
void PictureDialog::setupPictureDialog(bool withDatabase_) void PictureDialog::setupPictureDialog(bool withDatabase_)
{ {
// Set Window Flags
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
// Setup User Interface
ui->setupUi(this); ui->setupUi(this);
windowTitleStr = this->windowTitle(); windowTitleStr = this->windowTitle();
jsonDrawString = ui->labJSON->text(); jsonDrawString = ui->labJSON->text();
@ -422,7 +427,7 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, bool readOk,
} }
created = picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate); created = picture->getSnapmaticProperties().createdDateTime.toString(Qt::DefaultLocaleShortDate);
plyrsList = picture->getSnapmaticProperties().playersList; plyrsList = picture->getSnapmaticProperties().playersList;
picTitl = picture->getPictureTitl(); picTitl = StringParser::escapeString(picture->getPictureTitle());
picArea = picture->getSnapmaticProperties().location.area; picArea = picture->getSnapmaticProperties().location.area;
if (globalMap.contains(picArea)) if (globalMap.contains(picArea))
{ {
@ -596,7 +601,7 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button)
if (button == Qt::LeftButton) if (button == Qt::LeftButton)
{ {
QRect desktopRect = QApplication::desktop()->screenGeometry(this); QRect desktopRect = QApplication::desktop()->screenGeometry(this);
PictureWidget *pictureWidget = new PictureWidget(this); PictureWidget *pictureWidget = new PictureWidget(this); // Work!
pictureWidget->setObjectName("PictureWidget"); pictureWidget->setObjectName("PictureWidget");
#if QT_VERSION >= 0x050600 #if QT_VERSION >= 0x050600
pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint^Qt::MaximizeUsingFullscreenGeometryHint); pictureWidget->setWindowFlags(pictureWidget->windowFlags()^Qt::FramelessWindowHint^Qt::WindowStaysOnTopHint^Qt::MaximizeUsingFullscreenGeometryHint);
@ -620,8 +625,8 @@ void PictureDialog::on_labPicture_mouseDoubleClicked(Qt::MouseButton button)
pictureWidget->raise(); pictureWidget->raise();
pictureWidget->exec(); pictureWidget->exec();
fullscreenWidget = 0; fullscreenWidget = 0; // Work!
delete pictureWidget; delete pictureWidget; // Work!
} }
} }

View File

@ -76,7 +76,7 @@ void PictureExport::exportAsPicture(QWidget *parent, SnapmaticPicture *picture)
settings.beginGroup("FileDialogs"); settings.beginGroup("FileDialogs");
settings.beginGroup("ExportAsPicture"); settings.beginGroup("ExportAsPicture");
fileDialogPreSave: fileDialogPreSave: //Work?
QFileDialog fileDialog(parent); QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile); fileDialog.setFileMode(QFileDialog::AnyFile);
fileDialog.setViewMode(QFileDialog::Detail); fileDialog.setViewMode(QFileDialog::Detail);
@ -145,12 +145,12 @@ fileDialogPreSave:
if (!QFile::remove(selectedFile)) if (!QFile::remove(selectedFile))
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\"")); QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\""));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
{ {
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
@ -179,13 +179,13 @@ fileDialogPreSave:
if (!isSaved) if (!isSaved)
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("Failed to export current Snapmatic picture")); QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("No valid file is selected")); QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("No valid file is selected"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
@ -207,7 +207,7 @@ void PictureExport::exportAsSnapmatic(QWidget *parent, SnapmaticPicture *picture
adjustedPicPath.remove(adjustedPicPath.length() - 7, 7); adjustedPicPath.remove(adjustedPicPath.length() - 7, 7);
} }
fileDialogPreSave: fileDialogPreSave: //Work?
QFileInfo sgdFileInfo(adjustedPicPath); QFileInfo sgdFileInfo(adjustedPicPath);
QFileDialog fileDialog(parent); QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile); fileDialog.setFileMode(QFileDialog::AnyFile);
@ -218,7 +218,7 @@ fileDialogPreSave:
fileDialog.setDefaultSuffix(".rem"); fileDialog.setDefaultSuffix(".rem");
fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint); fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint);
fileDialog.setWindowTitle(PictureDialog::tr("Export as GTA Snapmatic...")); fileDialog.setWindowTitle(PictureDialog::tr("Export as GTA Snapmatic..."));
fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("&Export")); fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("Export"));
QStringList filters; QStringList filters;
filters << PictureDialog::tr("GTA V Export (*.g5e)"); filters << PictureDialog::tr("GTA V Export (*.g5e)");
@ -248,12 +248,12 @@ fileDialogPreSave:
if (!QFile::remove(selectedFile)) if (!QFile::remove(selectedFile))
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\"")); QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to overwrite %1 with current Snapmatic picture").arg("\""+selectedFile+"\""));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
{ {
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
@ -263,7 +263,7 @@ fileDialogPreSave:
if (!isExported) if (!isExported)
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture")); QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
@ -284,7 +284,7 @@ fileDialogPreSave:
if (!isCopied) if (!isCopied)
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture")); QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
else else
{ {
@ -295,7 +295,7 @@ fileDialogPreSave:
else else
{ {
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("No valid file is selected")); QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("No valid file is selected"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }

View File

@ -42,6 +42,7 @@
#include <QPalette> #include <QPalette>
#include <QPainter> #include <QPainter>
#include <QRegExp> #include <QRegExp>
#include <QAction>
#include <QDebug> #include <QDebug>
#include <QColor> #include <QColor>
#include <QTimer> #include <QTimer>
@ -79,22 +80,18 @@ ProfileInterface::~ProfileInterface()
foreach(ProfileWidget *widget, widgets.keys()) foreach(ProfileWidget *widget, widgets.keys())
{ {
widgets.remove(widget); widgets.remove(widget);
widget->deleteLater();
delete widget; delete widget;
} }
foreach(SavegameData *savegame, savegames) foreach(SavegameData *savegame, savegames)
{ {
savegames.removeAll(savegame); savegames.removeAll(savegame);
savegame->deleteLater();
delete savegame; delete savegame;
} }
foreach(SnapmaticPicture *picture, pictures) foreach(SnapmaticPicture *picture, pictures)
{ {
pictures.removeAll(picture); pictures.removeAll(picture);
picture->deleteLater();
delete picture; delete picture;
} }
profileLoader->deleteLater();
delete profileLoader; delete profileLoader;
delete ui; delete ui;
@ -318,32 +315,50 @@ void ProfileInterface::profileLoaded_p()
void ProfileInterface::savegameDeleted_event() void ProfileInterface::savegameDeleted_event()
{ {
savegameDeleted((SavegameWidget*)sender()); savegameDeleted((SavegameWidget*)sender(), true);
} }
void ProfileInterface::savegameDeleted(SavegameWidget *sgdWidget) void ProfileInterface::savegameDeleted(SavegameWidget *sgdWidget, bool isRemoteEmited)
{ {
SavegameData *savegame = sgdWidget->getSavegame(); SavegameData *savegame = sgdWidget->getSavegame();
if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); } if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); }
widgets.remove(sgdWidget); widgets.remove(sgdWidget);
sgdWidget->close();
sgdWidget->deleteLater(); // Deleting when the widget did send a event cause a crash
if (isRemoteEmited)
{
sgdWidget->deleteLater();
}
else
{
delete sgdWidget;
}
savegames.removeAll(savegame); savegames.removeAll(savegame);
delete savegame; delete savegame;
} }
void ProfileInterface::pictureDeleted_event() void ProfileInterface::pictureDeleted_event()
{ {
pictureDeleted((SnapmaticWidget*)sender()); pictureDeleted((SnapmaticWidget*)sender(), true);
} }
void ProfileInterface::pictureDeleted(SnapmaticWidget *picWidget) void ProfileInterface::pictureDeleted(SnapmaticWidget *picWidget, bool isRemoteEmited)
{ {
SnapmaticPicture *picture = picWidget->getPicture(); SnapmaticPicture *picture = picWidget->getPicture();
if (picWidget->isSelected()) { picWidget->setSelected(false); } if (picWidget->isSelected()) { picWidget->setSelected(false); }
widgets.remove(picWidget); widgets.remove(picWidget);
picWidget->close();
picWidget->deleteLater(); // Deleting when the widget did send a event cause a crash
if (isRemoteEmited)
{
picWidget->deleteLater();
}
else
{
delete picWidget;
}
pictures.removeAll(picture); pictures.removeAll(picture);
delete picture; delete picture;
} }
@ -359,7 +374,7 @@ void ProfileInterface::on_cmdImport_clicked()
settings.beginGroup("FileDialogs"); settings.beginGroup("FileDialogs");
settings.beginGroup("ImportCopy"); settings.beginGroup("ImportCopy");
fileDialogPreOpen: fileDialogPreOpen: //Work?
QFileDialog fileDialog(this); QFileDialog fileDialog(this);
fileDialog.setFileMode(QFileDialog::ExistingFiles); fileDialog.setFileMode(QFileDialog::ExistingFiles);
fileDialog.setViewMode(QFileDialog::Detail); fileDialog.setViewMode(QFileDialog::Detail);
@ -390,7 +405,7 @@ fileDialogPreOpen:
if (selectedFiles.length() == 1) if (selectedFiles.length() == 1)
{ {
QString selectedFile = selectedFiles.at(0); QString selectedFile = selectedFiles.at(0);
if (!importFile(selectedFile, true, 0)) goto fileDialogPreOpen; if (!importFile(selectedFile, true, 0)) goto fileDialogPreOpen; //Work?
} }
else if (selectedFiles.length() > 1) else if (selectedFiles.length() > 1)
{ {
@ -463,7 +478,7 @@ fileDialogPreOpen:
else else
{ {
QMessageBox::warning(this, tr("Import"), tr("No valid file is selected")); QMessageBox::warning(this, tr("Import"), tr("No valid file is selected"));
goto fileDialogPreOpen; goto fileDialogPreOpen; //Work?
} }
} }
@ -920,7 +935,6 @@ void ProfileInterface::exportSelected()
if (exportThread->isFinished()) if (exportThread->isFinished())
{ {
exportThread->deleteLater();
delete exportThread; delete exportThread;
} }
else else
@ -928,7 +942,6 @@ void ProfileInterface::exportSelected()
QEventLoop threadFinishLoop; QEventLoop threadFinishLoop;
QObject::connect(exportThread, SIGNAL(finished()), &threadFinishLoop, SLOT(quit())); QObject::connect(exportThread, SIGNAL(finished()), &threadFinishLoop, SLOT(quit()));
threadFinishLoop.exec(); threadFinishLoop.exec();
exportThread->deleteLater();
delete exportThread; delete exportThread;
} }
} }
@ -954,8 +967,7 @@ void ProfileInterface::deleteSelected()
if (widget->getWidgetType() == "SnapmaticWidget") if (widget->getWidgetType() == "SnapmaticWidget")
{ {
SnapmaticWidget *picWidget = (SnapmaticWidget*)widget; SnapmaticWidget *picWidget = (SnapmaticWidget*)widget;
QString fileName = picWidget->getPicturePath(); if (picWidget->getPicture()->deletePicFile())
if (!QFile::exists(fileName) || QFile::remove(fileName))
{ {
pictureDeleted(picWidget); pictureDeleted(picWidget);
} }

View File

@ -98,8 +98,8 @@ private:
bool importSavegameData(SavegameData *savegame, QString sgdPath, bool warn = true); bool importSavegameData(SavegameData *savegame, QString sgdPath, bool warn = true);
void pictureLoaded(SnapmaticPicture *picture, bool inserted); void pictureLoaded(SnapmaticPicture *picture, bool inserted);
void savegameLoaded(SavegameData *savegame, QString savegamePath, bool inserted); void savegameLoaded(SavegameData *savegame, QString savegamePath, bool inserted);
void savegameDeleted(SavegameWidget *sgdWidget); void savegameDeleted(SavegameWidget *sgdWidget, bool isRemoteEmited = false);
void pictureDeleted(SnapmaticWidget *picWidget); void pictureDeleted(SnapmaticWidget *picWidget, bool isRemoteEmited = false);
void insertSnapmaticIPI(QWidget *widget); void insertSnapmaticIPI(QWidget *widget);
void insertSavegameIPI(QWidget *widget); void insertSavegameIPI(QWidget *widget);
void sortingProfileInterface(); void sortingProfileInterface();

View File

@ -34,7 +34,7 @@ void SavegameCopy::copySavegame(QWidget *parent, QString sgdPath)
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("FileDialogs"); settings.beginGroup("FileDialogs");
fileDialogPreSave: fileDialogPreSave: //Work?
QFileInfo sgdFileInfo(sgdPath); QFileInfo sgdFileInfo(sgdPath);
QFileDialog fileDialog(parent); QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile); fileDialog.setFileMode(QFileDialog::AnyFile);
@ -72,12 +72,12 @@ fileDialogPreSave:
if (!QFile::remove(selectedFile)) if (!QFile::remove(selectedFile))
{ {
QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to overwrite %1 with current Savegame").arg("\""+selectedFile+"\"")); QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to overwrite %1 with current Savegame").arg("\""+selectedFile+"\""));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
{ {
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
@ -85,13 +85,13 @@ fileDialogPreSave:
if (!isCopied) if (!isCopied)
{ {
QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to export current Savegame")); QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to export current Savegame"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }
else else
{ {
QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("No valid file is selected")); QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("No valid file is selected"));
goto fileDialogPreSave; goto fileDialogPreSave; //Work?
} }
} }

View File

@ -19,15 +19,15 @@
#include "StringParser.h" #include "StringParser.h"
#include "SavegameData.h" #include "SavegameData.h"
#include <QTextCodec> #include <QTextCodec>
#include <QByteArray>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#define savegameHeaderLength 260
#define verificationValue QByteArray::fromHex("00000001")
SavegameData::SavegameData(const QString &fileName, QObject *parent) : QObject(parent), savegameFileName(fileName) SavegameData::SavegameData(const QString &fileName, QObject *parent) : QObject(parent), savegameFileName(fileName)
{ {
// PARSE INT INIT - DO NOT CHANGE THIS VALUES
savegameHeaderLength = 260;
verificationValue = QByteArray::fromHex("00000001");
// INIT SAVEGAME // INIT SAVEGAME
savegameStr = ""; savegameStr = "";
savegameOk = 0; savegameOk = 0;

View File

@ -40,10 +40,6 @@ private:
QString savegameStr; QString savegameStr;
QString lastStep; QString lastStep;
bool savegameOk; bool savegameOk;
// PARSE INT
QByteArray verificationValue;
int savegameHeaderLength;
}; };
#endif // SAVEGAMEDATA_H #endif // SAVEGAMEDATA_H

View File

@ -7,6 +7,10 @@ SavegameDialog::SavegameDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::SavegameDialog) ui(new Ui::SavegameDialog)
{ {
// Set Window Flags
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
// Setup User Interface
ui->setupUi(this); ui->setupUi(this);
savegameLabStr = ui->labSavegameText->text(); savegameLabStr = ui->labSavegameText->text();

View File

@ -19,6 +19,9 @@
#include "SnapmaticEditor.h" #include "SnapmaticEditor.h"
#include "ui_SnapmaticEditor.h" #include "ui_SnapmaticEditor.h"
#include "SnapmaticPicture.h" #include "SnapmaticPicture.h"
#include "StringParser.h"
#include <QTextDocument>
#include <QInputDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
@ -42,6 +45,7 @@ SnapmaticEditor::SnapmaticEditor(QWidget *parent) :
ui->cmdCancel->setIcon(QIcon::fromTheme("dialog-cancel")); ui->cmdCancel->setIcon(QIcon::fromTheme("dialog-cancel"));
} }
snapmaticTitle = "";
smpic = 0; smpic = 0;
} }
@ -179,6 +183,30 @@ void SnapmaticEditor::setSnapmaticPicture(SnapmaticPicture *picture)
{ {
ui->rbCustom->setChecked(true); ui->rbCustom->setChecked(true);
} }
setSnapmaticTitle(picture->getPictureTitle());
}
void SnapmaticEditor::setSnapmaticTitle(const QString &title)
{
if (title.length() > 39)
{
snapmaticTitle = title.left(39);
}
else
{
snapmaticTitle = title;
}
QString editStr = QString("<a href=\"g5e://edittitle\" style=\"text-decoration: none;\">%1</a>").arg(tr("Edit"));
QString titleStr = tr("Title: %1 (%2)").arg(StringParser::escapeString(snapmaticTitle), editStr);
ui->labTitle->setText(titleStr);
if (SnapmaticPicture::verifyTitle(snapmaticTitle))
{
ui->labAppropriate->setText(tr("Appropriate: %1").arg(QString("<span style=\"color: green\">%1</a>").arg(tr("Yes", "Yes, should work fine"))));
}
else
{
ui->labAppropriate->setText(tr("Appropriate: %1").arg(QString("<span style=\"color: red\">%1</a>").arg(tr("No", "No, could lead to issues"))));
}
} }
void SnapmaticEditor::on_cmdCancel_clicked() void SnapmaticEditor::on_cmdCancel_clicked()
@ -210,10 +238,19 @@ void SnapmaticEditor::on_cmdApply_clicked()
{ {
QFile::copy(adjustedFileName, backupFileName); QFile::copy(adjustedFileName, backupFileName);
} }
SnapmaticProperties fallbackProperties = smpic->getSnapmaticProperties();
QString fallbackTitle = smpic->getPictureTitle();
smpic->setSnapmaticProperties(localSpJson); smpic->setSnapmaticProperties(localSpJson);
smpic->setPictureTitle(snapmaticTitle);
if (!smpic->exportPicture(originalFileName)) if (!smpic->exportPicture(originalFileName))
{ {
QMessageBox::warning(this, tr("Snapmatic Properties"), tr("Patching of Snapmatic Properties failed because of I/O Error")); QMessageBox::warning(this, tr("Snapmatic Properties"), tr("Patching of Snapmatic Properties failed because of I/O Error"));
smpic->setSnapmaticProperties(fallbackProperties);
smpic->setPictureTitle(fallbackTitle);
}
else
{
smpic->emitUpdate();
} }
} }
close(); close();
@ -251,3 +288,16 @@ void SnapmaticEditor::on_cbQualify_toggled(bool checked)
} }
} }
} }
void SnapmaticEditor::on_labTitle_linkActivated(const QString &link)
{
if (link == "g5e://edittitle")
{
bool ok;
QString newTitle = QInputDialog::getText(this, tr("Snapmatic Title"), tr("New Snapmatic title:"), QLineEdit::Normal, snapmaticTitle, &ok, windowFlags());
if (ok && !newTitle.isEmpty())
{
setSnapmaticTitle(newTitle);
}
}
}

View File

@ -33,6 +33,7 @@ class SnapmaticEditor : public QDialog
public: public:
explicit SnapmaticEditor(QWidget *parent = 0); explicit SnapmaticEditor(QWidget *parent = 0);
void setSnapmaticPicture(SnapmaticPicture *picture); void setSnapmaticPicture(SnapmaticPicture *picture);
void setSnapmaticTitle(const QString &title);
~SnapmaticEditor(); ~SnapmaticEditor();
private slots: private slots:
@ -47,11 +48,13 @@ private slots:
void on_cmdCancel_clicked(); void on_cmdCancel_clicked();
void on_cmdApply_clicked(); void on_cmdApply_clicked();
void on_cbQualify_toggled(bool checked); void on_cbQualify_toggled(bool checked);
void on_labTitle_linkActivated(const QString &link);
private: private:
Ui::SnapmaticEditor *ui; Ui::SnapmaticEditor *ui;
SnapmaticProperties localSpJson; SnapmaticProperties localSpJson;
SnapmaticPicture *smpic; SnapmaticPicture *smpic;
QString snapmaticTitle;
void qualifyAvatar(); void qualifyAvatar();
}; };

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>375</width> <width>400</width>
<height>319</height> <height>350</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -119,6 +119,50 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="gbTitle">
<property name="title">
<string>Snapmatic Title</string>
</property>
<layout class="QVBoxLayout" name="vlTitle">
<item>
<widget class="UiModLabel" name="labTitle">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<property name="text">
<string>Title: %1 (%2)</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="UiModLabel" name="labAppropriate">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Appropriate: %1</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<widget class="QGroupBox" name="gbExtras"> <widget class="QGroupBox" name="gbExtras">
<property name="title"> <property name="title">
@ -133,7 +177,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLabel" name="labQualify"> <widget class="UiModLabel" name="labQualify">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -212,6 +256,13 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets>
<customwidget>
<class>UiModLabel</class>
<extends>QLabel</extends>
<header>UiModLabel.h</header>
</customwidget>
</customwidgets>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>

View File

@ -29,6 +29,7 @@
#include <QBuffer> #include <QBuffer>
#include <QDebug> #include <QDebug>
#include <QImage> #include <QImage>
#include <QSize>
#include <QFile> #include <QFile>
// PARSER ALLOCATIONS // PARSER ALLOCATIONS
@ -49,11 +50,13 @@
#define titlStreamEditorLength 256 #define titlStreamEditorLength 256
#define titlStreamCharacterMax 39 #define titlStreamCharacterMax 39
// IMAGES VALUES
#define snapmaticResolutionW 960
#define snapmaticResolutionH 536
#define snapmaticResolution QSize(snapmaticResolutionW, snapmaticResolutionH)
SnapmaticPicture::SnapmaticPicture(const QString &fileName, QObject *parent) : QObject(parent), picFilePath(fileName) SnapmaticPicture::SnapmaticPicture(const QString &fileName, QObject *parent) : QObject(parent), picFilePath(fileName)
{ {
// PREDEFINED PROPERTIES
snapmaticResolution = QSize(960, 536);
reset(); reset();
} }
@ -65,7 +68,7 @@ void SnapmaticPicture::reset()
{ {
// INIT PIC // INIT PIC
rawPicContent = ""; rawPicContent = "";
cachePicture = QImage(0, 0, QImage::Format_RGB888); cachePicture = QImage();
jpegRawContentSize = 0; jpegRawContentSize = 0;
picExportFileName = ""; picExportFileName = "";
isCustomFormat = 0; isCustomFormat = 0;
@ -483,51 +486,6 @@ bool SnapmaticPicture::setPictureTitl(const QString &newTitle_)
return false; return false;
} }
bool SnapmaticPicture::exportPicture(const QString &fileName, bool customFormat)
{
QFile *picFile = new QFile(fileName);
if (picFile->open(QIODevice::WriteOnly))
{
if (!customFormat)
{
// Classic straight export
picFile->write(rawPicContent);
picFile->close();
picFile->deleteLater();
}
else
{
// Modern compressed export
QByteArray stockFileNameUTF8 = picFileName.toUtf8();
QByteArray numberLength = QByteArray::number(stockFileNameUTF8.length());
if (numberLength.length() == 1)
{
numberLength.insert(0, "0");
}
else if (numberLength.length() != 2)
{
numberLength = "00";
}
picFile->write(QByteArray::fromHex("00")); // First Null Byte
picFile->write("G5E"); // GTA 5 Export
picFile->write(QByteArray::fromHex("1000")); // 2 byte GTA 5 Export Version
picFile->write("LEN"); // Before Length
picFile->write(QByteArray::fromHex(numberLength)); // Length in HEX before Compressed
picFile->write("FIL"); // Before File Name
picFile->write(stockFileNameUTF8); // File Name
picFile->write("COM"); // Before Compressed
picFile->write(qCompress(rawPicContent, 9)); // Compressed Snapmatic
picFile->close();
picFile->deleteLater();
}
return true;
}
else
{
return false;
}
}
QString SnapmaticPicture::getExportPictureFileName() QString SnapmaticPicture::getExportPictureFileName()
{ {
return picExportFileName; return picExportFileName;
@ -655,24 +613,34 @@ bool SnapmaticPicture::isPicOk()
return picOk; return picOk;
} }
void SnapmaticPicture::setPicFileName(QString picFileName_)
{
picFileName = picFileName_;
}
void SnapmaticPicture::setPicFilePath(QString picFilePath_)
{
picFilePath = picFilePath_;
}
void SnapmaticPicture::clearCache() void SnapmaticPicture::clearCache()
{ {
cacheEnabled = false; cacheEnabled = false;
cachePicture = QImage(0, 0, QImage::Format_RGB888); cachePicture = QImage();
}
void SnapmaticPicture::emitUpdate()
{
emit updated();
} }
// JSON part // JSON part
bool SnapmaticPicture::isJsonOk()
{
return jsonOk;
}
QString SnapmaticPicture::getJsonStr()
{
return jsonStr;
}
SnapmaticProperties SnapmaticPicture::getSnapmaticProperties()
{
return localSpJson;
}
void SnapmaticPicture::parseJsonContent() void SnapmaticPicture::parseJsonContent()
{ {
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8()); QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8());
@ -733,21 +701,6 @@ void SnapmaticPicture::parseJsonContent()
jsonOk = true; jsonOk = true;
} }
bool SnapmaticPicture::isJsonOk()
{
return jsonOk;
}
QString SnapmaticPicture::getJsonStr()
{
return jsonStr;
}
SnapmaticProperties SnapmaticPicture::getSnapmaticProperties()
{
return localSpJson;
}
bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson) bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson)
{ {
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8()); QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8());
@ -811,6 +764,70 @@ bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson)
return true; return true;
} }
// FILE MANAGEMENT
bool SnapmaticPicture::exportPicture(const QString &fileName, bool customFormat)
{
QFile *picFile = new QFile(fileName);
if (picFile->open(QIODevice::WriteOnly))
{
if (!customFormat)
{
// Classic straight export
picFile->write(rawPicContent);
picFile->close();
picFile->deleteLater();
}
else
{
// Modern compressed export
QByteArray stockFileNameUTF8 = picFileName.toUtf8();
QByteArray numberLength = QByteArray::number(stockFileNameUTF8.length());
if (numberLength.length() == 1)
{
numberLength.insert(0, "0");
}
else if (numberLength.length() != 2)
{
numberLength = "00";
}
picFile->write(QByteArray::fromHex("00")); // First Null Byte
picFile->write("G5E"); // GTA 5 Export
picFile->write(QByteArray::fromHex("1000")); // 2 byte GTA 5 Export Version
picFile->write("LEN"); // Before Length
picFile->write(QByteArray::fromHex(numberLength)); // Length in HEX before Compressed
picFile->write("FIL"); // Before File Name
picFile->write(stockFileNameUTF8); // File Name
picFile->write("COM"); // Before Compressed
picFile->write(qCompress(rawPicContent, 9)); // Compressed Snapmatic
picFile->close();
picFile->deleteLater();
}
return true;
}
else
{
return false;
}
}
void SnapmaticPicture::setPicFileName(const QString &picFileName_)
{
picFileName = picFileName_;
}
void SnapmaticPicture::setPicFilePath(const QString &picFilePath_)
{
picFilePath = picFilePath_;
}
bool SnapmaticPicture::deletePicFile()
{
if (!QFile::exists(picFilePath)) return true;
if (QFile::remove(picFilePath)) return true;
return false;
}
// VISIBILITY // VISIBILITY
bool SnapmaticPicture::isHidden() bool SnapmaticPicture::isHidden()

View File

@ -71,10 +71,14 @@ public:
bool setImage(const QImage &picture); bool setImage(const QImage &picture);
bool setPictureTitl(const QString &newTitle); bool setPictureTitl(const QString &newTitle);
bool setPictureStream(const QByteArray &picByteArray); bool setPictureStream(const QByteArray &picByteArray);
bool exportPicture(const QString &fileName, bool customFormat = false);
void setPicFileName(QString picFileName);
void setPicFilePath(QString picFilePath);
void updateStrings(); void updateStrings();
void emitUpdate();
// FILE MANAGEMENT
bool exportPicture(const QString &fileName, bool customFormat = false);
void setPicFileName(const QString &picFileName);
void setPicFilePath(const QString &picFilePath);
bool deletePicFile();
// ALTERNATIVES // ALTERNATIVES
QString getPictureTitle() { return getPictureTitl(); } QString getPictureTitle() { return getPictureTitl(); }
@ -122,9 +126,6 @@ private:
// PICTURE STREAM // PICTURE STREAM
QByteArray rawPicContent; QByteArray rawPicContent;
// PREDEFINED PROPERTIES
QSize snapmaticResolution;
// JSON // JSON
void parseJsonContent(); void parseJsonContent();
bool jsonOk; bool jsonOk;
@ -135,6 +136,7 @@ private:
static bool verifyTitleChar(const QChar &titleChar); static bool verifyTitleChar(const QChar &titleChar);
signals: signals:
void updated();
public slots: public slots:
}; };

View File

@ -23,6 +23,7 @@
#include "DatabaseThread.h" #include "DatabaseThread.h"
#include "PictureDialog.h" #include "PictureDialog.h"
#include "PictureExport.h" #include "PictureExport.h"
#include "StringParser.h"
#include "config.h" #include "config.h"
#include <QMessageBox> #include <QMessageBox>
#include <QPixmap> #include <QPixmap>
@ -84,6 +85,7 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
picPath = picture->getPictureFilePath(); picPath = picture->getPictureFilePath();
picTitl = picture->getPictureTitl(); picTitl = picture->getPictureTitl();
picStr = picture->getPictureStr(); picStr = picture->getPictureStr();
QObject::connect(picture, SIGNAL(updated()), this, SLOT(snapmaticUpdated()));
QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getImage().scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::AutoColor); QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getImage().scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation), Qt::AutoColor);
ui->labPicStr->setText(picStr + "\n" + picTitl + ""); ui->labPicStr->setText(picStr + "\n" + picTitl + "");
@ -94,6 +96,15 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
adjustTextColor(); adjustTextColor();
} }
void SnapmaticWidget::snapmaticUpdated()
{
// Current only strings get updated
picPath = smpic->getPictureFilePath();
picTitl = smpic->getPictureTitl();
picStr = smpic->getPictureStr();
ui->labPicStr->setText(picStr + "\n" + picTitl + "");
}
void SnapmaticWidget::on_cmdView_clicked() void SnapmaticWidget::on_cmdView_clicked()
{ {
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR); QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
@ -102,7 +113,6 @@ void SnapmaticWidget::on_cmdView_clicked()
settings.endGroup(); settings.endGroup();
PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, this); PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, this);
picDialog->setWindowFlags(picDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
picDialog->setSnapmaticPicture(smpic, true); picDialog->setSnapmaticPicture(smpic, true);
picDialog->setModal(true); picDialog->setModal(true);
@ -135,23 +145,25 @@ void SnapmaticWidget::on_cmdExport_clicked()
} }
void SnapmaticWidget::on_cmdDelete_clicked() void SnapmaticWidget::on_cmdDelete_clicked()
{
if (deletePicture()) emit pictureDeleted();
}
bool SnapmaticWidget::deletePicture()
{ {
int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("Are you sure to delete %1 from your Snapmatic pictures?").arg("\""+picStr+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::No); int uchoice = QMessageBox::question(this, tr("Delete picture"), tr("Are you sure to delete %1 from your Snapmatic pictures?").arg("\""+picStr+"\""), QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if (uchoice == QMessageBox::Yes) if (uchoice == QMessageBox::Yes)
{ {
if (!QFile::exists(picPath)) if (smpic->deletePicFile())
{ {
emit pictureDeleted(); return true;
}
else if(QFile::remove(picPath))
{
emit pictureDeleted();
} }
else else
{ {
QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg("\""+picStr+"\"")); QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg("\""+picStr+"\""));
} }
} }
return false;
} }
void SnapmaticWidget::mousePressEvent(QMouseEvent *ev) void SnapmaticWidget::mousePressEvent(QMouseEvent *ev)

View File

@ -42,6 +42,7 @@ public:
void setSnapmaticPicture(SnapmaticPicture *picture); void setSnapmaticPicture(SnapmaticPicture *picture);
void setSelectionMode(bool selectionMode); void setSelectionMode(bool selectionMode);
void setSelected(bool isSelected); void setSelected(bool isSelected);
bool deletePicture();
bool makePictureVisible(); bool makePictureVisible();
bool makePictureHidden(); bool makePictureHidden();
SnapmaticPicture *getPicture(); SnapmaticPicture *getPicture();
@ -66,6 +67,7 @@ private slots:
void makePictureVisibleSlot(); void makePictureVisibleSlot();
void makePictureHiddenSlot(); void makePictureHiddenSlot();
void editSnapmaticProperties(); void editSnapmaticProperties();
void snapmaticUpdated();
protected: protected:
bool eventFilter(QObject *obj, QEvent *ev); bool eventFilter(QObject *obj, QEvent *ev);

View File

@ -18,6 +18,7 @@
#include "StringParser.h" #include "StringParser.h"
#include "config.h" #include "config.h"
#include <QTextDocument>
#include <QApplication> #include <QApplication>
#include <QTextCodec> #include <QTextCodec>
#include <QByteArray> #include <QByteArray>
@ -60,3 +61,12 @@ QString StringParser::convertBuildedString(const QString &buildedStr)
outputStr.replace("$SEPARATOR", QDir::separator()); outputStr.replace("$SEPARATOR", QDir::separator());
return outputStr; return outputStr;
} }
QString StringParser::escapeString(const QString &toEscape)
{
#if QT_VERSION >= 0x050000
return toEscape.toHtmlEscaped();
#else
return Qt::escape(toEscape);
#endif
}

View File

@ -30,6 +30,7 @@ public:
static QString convertDrawStringForLog(const QString &inputStr); static QString convertDrawStringForLog(const QString &inputStr);
static QString convertLogStringForDraw(const QString &inputStr); static QString convertLogStringForDraw(const QString &inputStr);
static QString convertBuildedString(const QString &buildedStr); static QString convertBuildedString(const QString &buildedStr);
static QString escapeString(const QString &toEscape);
}; };
#endif // STRINGPARSER_H #endif // STRINGPARSER_H

View File

@ -208,7 +208,6 @@ void UserInterface::closeProfile()
ui->menuProfile->setEnabled(false); ui->menuProfile->setEnabled(false);
ui->actionSelect_profile->setEnabled(false); ui->actionSelect_profile->setEnabled(false);
ui->swProfile->removeWidget(profileUI); ui->swProfile->removeWidget(profileUI);
profileUI->deleteLater();
delete profileUI; delete profileUI;
} }
this->setWindowTitle(defaultWindowTitle.arg(tr("Select Profile"))); this->setWindowTitle(defaultWindowTitle.arg(tr("Select Profile")));
@ -248,11 +247,10 @@ void UserInterface::openSelectProfile()
void UserInterface::on_actionAbout_gta5sync_triggered() void UserInterface::on_actionAbout_gta5sync_triggered()
{ {
AboutDialog *aboutDialog = new AboutDialog(this); AboutDialog *aboutDialog = new AboutDialog(this);
aboutDialog->setWindowFlags(aboutDialog->windowFlags()^Qt::WindowContextHelpButtonHint); aboutDialog->setWindowIcon(windowIcon());
aboutDialog->setModal(true); aboutDialog->setModal(true);
aboutDialog->show(); aboutDialog->show();
aboutDialog->exec(); aboutDialog->exec();
aboutDialog->deleteLater();
delete aboutDialog; delete aboutDialog;
} }
@ -297,13 +295,14 @@ void UserInterface::on_actionDelete_selected_triggered()
void UserInterface::on_actionOptions_triggered() void UserInterface::on_actionOptions_triggered()
{ {
OptionsDialog *optionsDialog = new OptionsDialog(profileDB, this); OptionsDialog *optionsDialog = new OptionsDialog(profileDB, this);
optionsDialog->setWindowFlags(optionsDialog->windowFlags()^Qt::WindowContextHelpButtonHint); optionsDialog->setWindowIcon(windowIcon());
optionsDialog->commitProfiles(GTAV_Profiles); optionsDialog->commitProfiles(GTAV_Profiles);
QObject::connect(optionsDialog, SIGNAL(settingsApplied(int,QString)), this, SLOT(settingsApplied(int,QString))); QObject::connect(optionsDialog, SIGNAL(settingsApplied(int, QString)), this, SLOT(settingsApplied(int, QString)));
optionsDialog->setModal(true); optionsDialog->setModal(true);
optionsDialog->show(); optionsDialog->show();
optionsDialog->exec(); optionsDialog->exec();
delete optionsDialog; delete optionsDialog;
} }
@ -428,35 +427,30 @@ bool UserInterface::openFile(QString selectedFile, bool warn)
void UserInterface::openSnapmaticFile(SnapmaticPicture *picture) void UserInterface::openSnapmaticFile(SnapmaticPicture *picture)
{ {
PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, this); PictureDialog picDialog(profileDB, crewDB, this);
picDialog->setWindowFlags(picDialog->windowFlags()^Qt::WindowContextHelpButtonHint); picDialog.setSnapmaticPicture(picture, true);
picDialog->setSnapmaticPicture(picture, true); picDialog.setModal(true);
picDialog->setModal(true);
int crewID = picture->getSnapmaticProperties().crewID; int crewID = picture->getSnapmaticProperties().crewID;
if (crewID != 0) { crewDB->addCrew(crewID); } if (crewID != 0) { crewDB->addCrew(crewID); }
QObject::connect(threadDB, SIGNAL(playerNameFound(int, QString)), profileDB, SLOT(setPlayerName(int, QString))); QObject::connect(threadDB, SIGNAL(playerNameFound(int, QString)), profileDB, SLOT(setPlayerName(int, QString)));
QObject::connect(threadDB, SIGNAL(playerNameUpdated()), picDialog, SLOT(playerNameUpdated())); QObject::connect(threadDB, SIGNAL(playerNameUpdated()), &picDialog, SLOT(playerNameUpdated()));
picDialog->show(); picDialog.show();
picDialog->setMinimumSize(picDialog->size()); picDialog.setMinimumSize(picDialog.size());
picDialog->setMaximumSize(picDialog->size()); picDialog.setMaximumSize(picDialog.size());
picDialog->exec(); picDialog.exec();
delete picDialog;
} }
void UserInterface::openSavegameFile(SavegameData *savegame) void UserInterface::openSavegameFile(SavegameData *savegame)
{ {
SavegameDialog *sgdDialog = new SavegameDialog(this); SavegameDialog sgdDialog(this);
sgdDialog->setWindowFlags(sgdDialog->windowFlags()^Qt::WindowContextHelpButtonHint); sgdDialog.setSavegameData(savegame, savegame->getSavegameFileName(), true);
sgdDialog->setSavegameData(savegame, savegame->getSavegameFileName(), true); sgdDialog.setModal(true);
sgdDialog->setModal(true); sgdDialog.show();
sgdDialog.exec();
sgdDialog->show();
sgdDialog->exec();
delete sgdDialog;
} }
void UserInterface::settingsApplied(int _contentMode, QString _language) void UserInterface::settingsApplied(int _contentMode, QString _language)

View File

@ -50,14 +50,14 @@
#ifndef GTA5SYNC_APPVER #ifndef GTA5SYNC_APPVER
#ifndef GTA5SYNC_DAILYB #ifndef GTA5SYNC_DAILYB
#define GTA5SYNC_APPVER "1.3.3" #define GTA5SYNC_APPVER "1.4.0-dev1"
#else #else
#define GTA5SYNC_APPVER QString("%1").arg(GTA5SYNC_DAILYB) #define GTA5SYNC_APPVER QString("%1").arg(GTA5SYNC_DAILYB)
#endif #endif
#endif #endif
#ifndef GTA5SYNC_BUILDTYPE #ifndef GTA5SYNC_BUILDTYPE
#define GTA5SYNC_BUILDTYPE "Custom" #define GTA5SYNC_BUILDTYPE "Developer"
#endif #endif
#ifndef GTA5SYNC_SHARE #ifndef GTA5SYNC_SHARE

View File

@ -1,5 +1,5 @@
Community translation files Community translation files
They get loaded in ApplicationPathExecFileFolder/lang They get loaded in ApplicationPathExecFileFolder/lang
You can help translate with using Qt Linguist, after you've translated you'll need to send me a pull request on https://github.com/Syping/gta5sync You can help translate with using Qt Linguist, after you've translated you'll need to send me a pull request on https://github.com/Syping/gta5sync

File diff suppressed because it is too large Load Diff

View File

@ -432,7 +432,6 @@ int main(int argc, char *argv[])
SnapmaticPicture picture; SnapmaticPicture picture;
bool readOk = picture.readingPictureFromFile(arg1); bool readOk = picture.readingPictureFromFile(arg1);
picDialog.setWindowFlags(picDialog.windowFlags()^Qt::WindowContextHelpButtonHint);
picDialog.setWindowIcon(IconLoader::loadingAppIcon()); picDialog.setWindowIcon(IconLoader::loadingAppIcon());
picDialog.setSnapmaticPicture(&picture, readOk); picDialog.setSnapmaticPicture(&picture, readOk);

View File

@ -1 +1 @@
#include "QJsonArray.h" #include "QJsonArray.h"

View File

@ -1,410 +1,410 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonArray.h" #include "QJsonArray.h"
#include "QJsonValueRef.h" #include "QJsonValueRef.h"
#include "QJsonValue.h" #include "QJsonValue.h"
#include <QtCore/QStringList> #include <QtCore/QStringList>
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonArray // Name: QJsonArray
// Desc: default constructor // Desc: default constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::QJsonArray() { QJsonArray::QJsonArray() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonArray // Name: QJsonArray
// Desc: copy constructor // Desc: copy constructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::QJsonArray(const QJsonArray &other) : values_(other.values_) { QJsonArray::QJsonArray(const QJsonArray &other) : values_(other.values_) {
} }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonArray // Name: QJsonArray
// Desc: Creates an array initialized from args initialization list. // Desc: Creates an array initialized from args initialization list.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::QJsonArray(std::initializer_list<QJsonValue> args) { QJsonArray::QJsonArray(std::initializer_list<QJsonValue> args) {
for(const QJsonValue &arg : args) { for(const QJsonValue &arg : args) {
values_.append(arg); values_.append(arg);
} }
} }
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: ~QJsonArray // Name: ~QJsonArray
// Desc: destructor // Desc: destructor
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::~QJsonArray() { QJsonArray::~QJsonArray() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator= // Name: operator=
// Desc: assignment operator // Desc: assignment operator
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray &QJsonArray::operator=(const QJsonArray &other) { QJsonArray &QJsonArray::operator=(const QJsonArray &other) {
QJsonArray(other).swap(*this); QJsonArray(other).swap(*this);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator+= // Name: operator+=
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray &QJsonArray::operator+=(const QJsonValue &value) { QJsonArray &QJsonArray::operator+=(const QJsonValue &value) {
values_.append(value); values_.append(value);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator<< // Name: operator<<
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray &QJsonArray::operator<<(const QJsonValue &value) { QJsonArray &QJsonArray::operator<<(const QJsonValue &value) {
values_.append(value); values_.append(value);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator+ // Name: operator+
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonArray::operator+(const QJsonValue &value) const { QJsonArray QJsonArray::operator+(const QJsonValue &value) const {
QJsonArray arr(*this); QJsonArray arr(*this);
arr.append(value); arr.append(value);
return arr; return arr;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator!= // Name: operator!=
// Desc: returns true if the compared array IS NOT equal to this // Desc: returns true if the compared array IS NOT equal to this
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonArray::operator!=(const QJsonArray &other) const { bool QJsonArray::operator!=(const QJsonArray &other) const {
return values_ != other.values_; return values_ != other.values_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator== // Name: operator==
// Desc: returns true if the compared array IS equal to this // Desc: returns true if the compared array IS equal to this
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonArray::operator==(const QJsonArray &other) const { bool QJsonArray::operator==(const QJsonArray &other) const {
return values_ == other.values_; return values_ == other.values_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: begin // Name: begin
// Desc: returns an iterator to the first contained element // Desc: returns an iterator to the first contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::const_iterator QJsonArray::begin() const { QJsonArray::const_iterator QJsonArray::begin() const {
return values_.begin(); return values_.begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: end // Name: end
// Desc: returns an iterator to one past the last contained element // Desc: returns an iterator to one past the last contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::const_iterator QJsonArray::end() const { QJsonArray::const_iterator QJsonArray::end() const {
return values_.end(); return values_.end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: begin // Name: begin
// Desc: returns an iterator to the first contained element // Desc: returns an iterator to the first contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::iterator QJsonArray::begin() { QJsonArray::iterator QJsonArray::begin() {
return values_.begin(); return values_.begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: end // Name: end
// Desc: returns an iterator to one past the last contained element // Desc: returns an iterator to one past the last contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::iterator QJsonArray::end() { QJsonArray::iterator QJsonArray::end() {
return values_.end(); return values_.end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: constBegin // Name: constBegin
// Desc: returns an iterator to the first contained element // Desc: returns an iterator to the first contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::const_iterator QJsonArray::constBegin() const { QJsonArray::const_iterator QJsonArray::constBegin() const {
return begin(); return begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: constEnd // Name: constEnd
// Desc: returns an iterator to one past the last contained element // Desc: returns an iterator to one past the last contained element
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::const_iterator QJsonArray::constEnd() const { QJsonArray::const_iterator QJsonArray::constEnd() const {
return end(); return end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: first // Name: first
// Desc: returns the first element by value // Desc: returns the first element by value
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonArray::first() const { QJsonValue QJsonArray::first() const {
Q_ASSERT(!empty()); Q_ASSERT(!empty());
return values_.first(); return values_.first();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: last // Name: last
// Desc: returns the last element by value // Desc: returns the last element by value
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonArray::last() const { QJsonValue QJsonArray::last() const {
Q_ASSERT(!empty()); Q_ASSERT(!empty());
return values_.last(); return values_.last();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator[] // Name: operator[]
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef QJsonArray::operator[](int i) { QJsonValueRef QJsonArray::operator[](int i) {
return QJsonValueRef(this, i); return QJsonValueRef(this, i);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator[] // Name: operator[]
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonArray::operator[](int i) const { QJsonValue QJsonArray::operator[](int i) const {
return values_[i]; return values_[i];
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: at // Name: at
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonArray::at(int i) const { QJsonValue QJsonArray::at(int i) const {
return values_.at(i); return values_.at(i);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: size // Name: size
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonArray::size() const { int QJsonArray::size() const {
return values_.size(); return values_.size();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: count // Name: count
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonArray::count() const { int QJsonArray::count() const {
return size(); return size();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: empty // Name: empty
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonArray::empty() const { bool QJsonArray::empty() const {
return values_.empty(); return values_.empty();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isEmpty // Name: isEmpty
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonArray::isEmpty() const { bool QJsonArray::isEmpty() const {
return empty(); return empty();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: pop_back // Name: pop_back
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::pop_back() { void QJsonArray::pop_back() {
values_.pop_back(); values_.pop_back();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: pop_front // Name: pop_front
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::pop_front() { void QJsonArray::pop_front() {
values_.pop_front(); values_.pop_front();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: push_back // Name: push_back
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::push_back(const QJsonValue &value) { void QJsonArray::push_back(const QJsonValue &value) {
values_.push_back(value); values_.push_back(value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: push_front // Name: push_front
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::push_front(const QJsonValue &value) { void QJsonArray::push_front(const QJsonValue &value) {
values_.push_front(value); values_.push_front(value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::append(const QJsonValue &value) { void QJsonArray::append(const QJsonValue &value) {
values_.append(value); values_.append(value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonArray::contains(const QJsonValue &value) const { bool QJsonArray::contains(const QJsonValue &value) const {
return values_.contains(value); return values_.contains(value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::iterator QJsonArray::erase(iterator it) { QJsonArray::iterator QJsonArray::erase(iterator it) {
return values_.erase(it); return values_.erase(it);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::insert(int i, const QJsonValue &value) { void QJsonArray::insert(int i, const QJsonValue &value) {
values_.insert(i, value); values_.insert(i, value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray::iterator QJsonArray::insert(iterator before, const QJsonValue &value) { QJsonArray::iterator QJsonArray::insert(iterator before, const QJsonValue &value) {
return values_.insert(before, value); return values_.insert(before, value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::prepend(const QJsonValue &value) { void QJsonArray::prepend(const QJsonValue &value) {
values_.prepend(value); values_.prepend(value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::removeAt(int i) { void QJsonArray::removeAt(int i) {
values_.removeAt(i); values_.removeAt(i);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::removeFirst() { void QJsonArray::removeFirst() {
values_.removeFirst(); values_.removeFirst();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::removeLast() { void QJsonArray::removeLast() {
values_.removeLast(); values_.removeLast();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::replace(int i, const QJsonValue &value) { void QJsonArray::replace(int i, const QJsonValue &value) {
values_.replace(i, value); values_.replace(i, value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonArray::takeAt(int i) { QJsonValue QJsonArray::takeAt(int i) {
return values_.takeAt(i); return values_.takeAt(i);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toVariantList // Name: toVariantList
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QVariantList QJsonArray::toVariantList() const { QVariantList QJsonArray::toVariantList() const {
QVariantList a; QVariantList a;
Q_FOREACH(const QJsonValue &v, *this) { Q_FOREACH(const QJsonValue &v, *this) {
a.push_back(v.toVariant()); a.push_back(v.toVariant());
} }
return a; return a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonArray::fromStringList(const QStringList &list) { QJsonArray QJsonArray::fromStringList(const QStringList &list) {
QJsonArray a; QJsonArray a;
Q_FOREACH(const QString &s, list) { Q_FOREACH(const QString &s, list) {
a.push_back(QJsonValue(s)); a.push_back(QJsonValue(s));
} }
return a; return a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonArray::fromVariantList(const QVariantList &list) { QJsonArray QJsonArray::fromVariantList(const QVariantList &list) {
QJsonArray a; QJsonArray a;
Q_FOREACH(const QVariant &v, list) { Q_FOREACH(const QVariant &v, list) {
a.push_back(QJsonValue::fromVariant(v)); a.push_back(QJsonValue::fromVariant(v));
} }
return a; return a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonRoot *QJsonArray::clone() const { QJsonRoot *QJsonArray::clone() const {
return new QJsonArray(*this); return new QJsonArray(*this);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const QJsonObject *QJsonArray::toObject() const { const QJsonObject *QJsonArray::toObject() const {
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject *QJsonArray::toObject() { QJsonObject *QJsonArray::toObject() {
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray *QJsonArray::toArray() { QJsonArray *QJsonArray::toArray() {
return this; return this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const QJsonArray *QJsonArray::toArray() const { const QJsonArray *QJsonArray::toArray() const {
return this; return this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonArray::swap(QJsonArray &other) { void QJsonArray::swap(QJsonArray &other) {
qSwap(values_, other.values_); qSwap(values_, other.values_);
} }
#endif #endif

View File

@ -1,139 +1,139 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_ARRAY_H_ #ifndef QJSON_ARRAY_H_
#define QJSON_ARRAY_H_ #define QJSON_ARRAY_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonArray> #include <QtCore/QJsonArray>
#else #else
#include "QJsonRoot.h" #include "QJsonRoot.h"
#include <QtCore/QList> #include <QtCore/QList>
#include <QtCore/QVariantList> #include <QtCore/QVariantList>
class QJsonValue; class QJsonValue;
class QJsonValueRef; class QJsonValueRef;
class QJsonArray : public QJsonRoot { class QJsonArray : public QJsonRoot {
friend class QJsonDocument; friend class QJsonDocument;
friend class QJsonValue; friend class QJsonValue;
friend class QJsonValueRef; friend class QJsonValueRef;
friend class QJsonParser; friend class QJsonParser;
public: public:
// TODO(eteran): manually implement the array, for now we use QList // TODO(eteran): manually implement the array, for now we use QList
// but the real thing has a custom implementation // but the real thing has a custom implementation
// I guess for the purposes of less interdependancies? // I guess for the purposes of less interdependancies?
// maybe so it's easier to forward declare the iterators? // maybe so it's easier to forward declare the iterators?
typedef QList<QJsonValue>::const_iterator const_iterator; typedef QList<QJsonValue>::const_iterator const_iterator;
typedef QList<QJsonValue>::iterator iterator; typedef QList<QJsonValue>::iterator iterator;
typedef const_iterator ConstIterator; typedef const_iterator ConstIterator;
typedef iterator Iterator; typedef iterator Iterator;
typedef QList<QJsonValue>::const_pointer const_pointer; typedef QList<QJsonValue>::const_pointer const_pointer;
typedef QList<QJsonValue>::const_reference const_reference; typedef QList<QJsonValue>::const_reference const_reference;
typedef QList<QJsonValue>::difference_type difference_type; typedef QList<QJsonValue>::difference_type difference_type;
typedef QList<QJsonValue>::pointer pointer; typedef QList<QJsonValue>::pointer pointer;
typedef QList<QJsonValue>::reference reference; typedef QList<QJsonValue>::reference reference;
typedef QList<QJsonValue>::size_type size_type; typedef QList<QJsonValue>::size_type size_type;
typedef QList<QJsonValue>::value_type value_type; typedef QList<QJsonValue>::value_type value_type;
public: public:
QJsonArray(); QJsonArray();
QJsonArray(const QJsonArray &other); QJsonArray(const QJsonArray &other);
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
QJsonArray(std::initializer_list<QJsonValue> args); QJsonArray(std::initializer_list<QJsonValue> args);
#endif #endif
~QJsonArray(); ~QJsonArray();
public: public:
QJsonArray &operator=(const QJsonArray &other); QJsonArray &operator=(const QJsonArray &other);
public: public:
bool operator!=(const QJsonArray &other) const; bool operator!=(const QJsonArray &other) const;
bool operator==(const QJsonArray &other) const; bool operator==(const QJsonArray &other) const;
QJsonArray operator+(const QJsonValue &value) const; QJsonArray operator+(const QJsonValue &value) const;
QJsonArray &operator+=(const QJsonValue &value); QJsonArray &operator+=(const QJsonValue &value);
QJsonArray &operator<<(const QJsonValue &value); QJsonArray &operator<<(const QJsonValue &value);
public: public:
const_iterator begin() const; const_iterator begin() const;
const_iterator end() const; const_iterator end() const;
iterator begin(); iterator begin();
iterator end(); iterator end();
const_iterator constBegin() const; const_iterator constBegin() const;
const_iterator constEnd() const; const_iterator constEnd() const;
public: public:
QJsonValueRef operator[](int i); QJsonValueRef operator[](int i);
QJsonValue operator[](int i) const; QJsonValue operator[](int i) const;
QJsonValue at(int i) const; QJsonValue at(int i) const;
QJsonValue first() const; QJsonValue first() const;
QJsonValue last() const; QJsonValue last() const;
public: public:
int size() const; int size() const;
int count() const; int count() const;
bool empty() const; bool empty() const;
bool isEmpty() const; bool isEmpty() const;
public: public:
void pop_back(); void pop_back();
void pop_front(); void pop_front();
void push_back(const QJsonValue &value); void push_back(const QJsonValue &value);
void push_front(const QJsonValue &value); void push_front(const QJsonValue &value);
public: public:
void append(const QJsonValue &value); void append(const QJsonValue &value);
bool contains(const QJsonValue &value) const; bool contains(const QJsonValue &value) const;
iterator erase(iterator it); iterator erase(iterator it);
void insert(int i, const QJsonValue &value); void insert(int i, const QJsonValue &value);
iterator insert(iterator before, const QJsonValue &value); iterator insert(iterator before, const QJsonValue &value);
void prepend(const QJsonValue &value); void prepend(const QJsonValue &value);
void removeAt(int i); void removeAt(int i);
void removeFirst(); void removeFirst();
void removeLast(); void removeLast();
void replace(int i, const QJsonValue &value); void replace(int i, const QJsonValue &value);
QJsonValue takeAt(int i); QJsonValue takeAt(int i);
public: public:
QVariantList toVariantList() const; QVariantList toVariantList() const;
public: public:
static QJsonArray fromStringList(const QStringList &list); static QJsonArray fromStringList(const QStringList &list);
static QJsonArray fromVariantList(const QVariantList &list); static QJsonArray fromVariantList(const QVariantList &list);
private: private:
virtual QJsonRoot *clone() const; virtual QJsonRoot *clone() const;
virtual QJsonArray *toArray(); virtual QJsonArray *toArray();
virtual QJsonObject *toObject(); virtual QJsonObject *toObject();
virtual const QJsonArray *toArray() const; virtual const QJsonArray *toArray() const;
virtual const QJsonObject *toObject() const; virtual const QJsonObject *toObject() const;
private: private:
void swap(QJsonArray &other); void swap(QJsonArray &other);
private: private:
QList<QJsonValue> values_; QList<QJsonValue> values_;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonDocument.h" #include "QJsonDocument.h"

View File

@ -1,417 +1,417 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonDocument.h" #include "QJsonDocument.h"
#include "QJsonObject.h" #include "QJsonObject.h"
#include "QJsonArray.h" #include "QJsonArray.h"
#include "QJsonParser.h" #include "QJsonParser.h"
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QByteArray> #include <QtCore/QByteArray>
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtCore/QTextCodec> #include <QtCore/QTextCodec>
#include <QtCore/QtCore> #include <QtCore/QtCore>
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonDocument // Name: QJsonDocument
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument::QJsonDocument() : root_(0) { QJsonDocument::QJsonDocument() : root_(0) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonDocument // Name: QJsonDocument
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument::QJsonDocument(const QJsonObject &object) : root_(0) { QJsonDocument::QJsonDocument(const QJsonObject &object) : root_(0) {
setObject(object); setObject(object);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonDocument // Name: QJsonDocument
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument::QJsonDocument(const QJsonArray &array) : root_(0) { QJsonDocument::QJsonDocument(const QJsonArray &array) : root_(0) {
setArray(array); setArray(array);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonDocument // Name: QJsonDocument
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument::QJsonDocument(const QJsonDocument &other) : root_(0) { QJsonDocument::QJsonDocument(const QJsonDocument &other) : root_(0) {
if(other.root_) { if(other.root_) {
root_ = other.root_->clone(); root_ = other.root_->clone();
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: ~QJsonDocument // Name: ~QJsonDocument
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument::~QJsonDocument() { QJsonDocument::~QJsonDocument() {
delete root_; delete root_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator= // Name: operator=
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument &QJsonDocument::operator=(const QJsonDocument &other) { QJsonDocument &QJsonDocument::operator=(const QJsonDocument &other) {
QJsonDocument(other).swap(*this); QJsonDocument(other).swap(*this);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator!= // Name: operator!=
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::operator!=(const QJsonDocument &other) const { bool QJsonDocument::operator!=(const QJsonDocument &other) const {
return !(*this == other); return !(*this == other);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator== // Name: operator==
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::operator==(const QJsonDocument &other) const { bool QJsonDocument::operator==(const QJsonDocument &other) const {
if(isArray() && other.isArray()) { if(isArray() && other.isArray()) {
return array() == other.array(); return array() == other.array();
} }
if(isObject() && other.isObject()) { if(isObject() && other.isObject()) {
return object() == other.object(); return object() == other.object();
} }
if(isEmpty() && other.isEmpty()) { if(isEmpty() && other.isEmpty()) {
return true; return true;
} }
if(isNull() && other.isNull()) { if(isNull() && other.isNull()) {
return true; return true;
} }
return false; return false;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isArray // Name: isArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::isArray() const { bool QJsonDocument::isArray() const {
return root_ && root_->toArray(); return root_ && root_->toArray();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isEmpty // Name: isEmpty
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::isEmpty() const { bool QJsonDocument::isEmpty() const {
// TODO(eteran): figure out the rules here that Qt5 uses // TODO(eteran): figure out the rules here that Qt5 uses
// it *looks* like they define empty as being NULL // it *looks* like they define empty as being NULL
// which is obviously different than this // which is obviously different than this
return !root_; return !root_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isNull // Name: isNull
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::isNull() const { bool QJsonDocument::isNull() const {
return !root_; return !root_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isObject // Name: isObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonDocument::isObject() const { bool QJsonDocument::isObject() const {
return root_ && root_->toObject(); return root_ && root_->toObject();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: setArray // Name: setArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonDocument::setArray(const QJsonArray &array) { void QJsonDocument::setArray(const QJsonArray &array) {
setRoot(array); setRoot(array);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: setObject // Name: setObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonDocument::setObject(const QJsonObject &object) { void QJsonDocument::setObject(const QJsonObject &object) {
setRoot(object); setRoot(object);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: setRoot // Name: setRoot
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonDocument::setRoot(const QJsonRoot &root) { void QJsonDocument::setRoot(const QJsonRoot &root) {
delete root_; delete root_;
root_ = root.clone(); root_ = root.clone();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toBinaryData // Name: toBinaryData
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QByteArray QJsonDocument::toBinaryData() const { QByteArray QJsonDocument::toBinaryData() const {
QByteArray r; QByteArray r;
// TODO(eteran): implement this // TODO(eteran): implement this
return r; return r;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: escapeString // Name: escapeString
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonDocument::escapeString(const QString &s) const { QString QJsonDocument::escapeString(const QString &s) const {
QString r; QString r;
Q_FOREACH(QChar ch, s) { Q_FOREACH(QChar ch, s) {
switch(ch.toLatin1()) { switch(ch.toLatin1()) {
case '\"': r.append("\\\""); break; case '\"': r.append("\\\""); break;
case '\\': r.append("\\\\"); break; case '\\': r.append("\\\\"); break;
#if 0 #if 0
case '/': r.append("\\/"); break; case '/': r.append("\\/"); break;
#endif #endif
case '\b': r.append("\\b"); break; case '\b': r.append("\\b"); break;
case '\f': r.append("\\f"); break; case '\f': r.append("\\f"); break;
case '\n': r.append("\\n"); break; case '\n': r.append("\\n"); break;
case '\r': r.append("\\r"); break; case '\r': r.append("\\r"); break;
case '\t': r.append("\\t"); break; case '\t': r.append("\\t"); break;
default: default:
r += ch; r += ch;
break; break;
} }
} }
return r; return r;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toJson // Name: toJson
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonDocument::toJson(const QJsonValue &v, JsonFormat format) const { QString QJsonDocument::toJson(const QJsonValue &v, JsonFormat format) const {
QString b; QString b;
QTextStream ss(&b, QIODevice::WriteOnly | QIODevice::Text); QTextStream ss(&b, QIODevice::WriteOnly | QIODevice::Text);
switch(v.type()) { switch(v.type()) {
case QJsonValue::Null: case QJsonValue::Null:
ss << "null"; ss << "null";
break; break;
case QJsonValue::Bool: case QJsonValue::Bool:
ss << (v.toBool() ? "true" : "false"); ss << (v.toBool() ? "true" : "false");
break; break;
case QJsonValue::Double: case QJsonValue::Double:
{ {
double d = v.toDouble (); double d = v.toDouble ();
if (qIsFinite(d)) { if (qIsFinite(d)) {
// +2 to format to ensure the expected precision // +2 to format to ensure the expected precision
ss << QByteArray::number(d, 'g', 15 + 2); // ::digits10 is 15 ss << QByteArray::number(d, 'g', 15 + 2); // ::digits10 is 15
} else { } else {
ss << "null"; // +INF || -INF || NaN (see RFC4627#section2.4) ss << "null"; // +INF || -INF || NaN (see RFC4627#section2.4)
} }
} }
break; break;
case QJsonValue::String: case QJsonValue::String:
ss << '"' << escapeString(v.toString()) << '"'; ss << '"' << escapeString(v.toString()) << '"';
break; break;
case QJsonValue::Array: case QJsonValue::Array:
{ {
const QJsonArray a = v.toArray(); const QJsonArray a = v.toArray();
ss << "["; ss << "[";
if(!a.empty()) { if(!a.empty()) {
QJsonArray::const_iterator it = a.begin(); QJsonArray::const_iterator it = a.begin();
QJsonArray::const_iterator e = a.end(); QJsonArray::const_iterator e = a.end();
ss << toJson(*it++, format); ss << toJson(*it++, format);
for(;it != e; ++it) { for(;it != e; ++it) {
ss << ','; ss << ',';
ss << toJson(*it, format); ss << toJson(*it, format);
} }
} }
ss << "]"; ss << "]";
} }
break; break;
case QJsonValue::Object: case QJsonValue::Object:
{ {
const QJsonObject o = v.toObject(); const QJsonObject o = v.toObject();
ss << "{"; ss << "{";
if(!o.empty()) { if(!o.empty()) {
QJsonObject::const_iterator it = o.begin(); QJsonObject::const_iterator it = o.begin();
QJsonObject::const_iterator e = o.end(); QJsonObject::const_iterator e = o.end();
ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format); ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format);
++it; ++it;
for(;it != e; ++it) { for(;it != e; ++it) {
ss << ','; ss << ',';
ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format); ss << '"' << escapeString(it.key()) << "\": " << toJson(it.value(), format);
} }
} }
ss << "}"; ss << "}";
} }
break; break;
case QJsonValue::Undefined: case QJsonValue::Undefined:
Q_ASSERT(0); Q_ASSERT(0);
break; break;
} }
return b; return b;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toJson // Name: toJson
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QByteArray QJsonDocument::toJson(JsonFormat format) const { QByteArray QJsonDocument::toJson(JsonFormat format) const {
Q_UNUSED(format); Q_UNUSED(format);
if(isArray()) { if(isArray()) {
QString s = toJson(array(), format); QString s = toJson(array(), format);
return s.toUtf8(); return s.toUtf8();
} }
if(isObject()) { if(isObject()) {
QString s = toJson(object(), format); QString s = toJson(object(), format);
return s.toUtf8(); return s.toUtf8();
} }
return QByteArray(); return QByteArray();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toVariant // Name: toVariant
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QVariant QJsonDocument::toVariant() const { QVariant QJsonDocument::toVariant() const {
if(!isEmpty()) { if(!isEmpty()) {
if(QJsonObject *const object = root_->toObject()) { if(QJsonObject *const object = root_->toObject()) {
return object->toVariantMap(); return object->toVariantMap();
} }
if(QJsonArray *const array = root_->toArray()) { if(QJsonArray *const array = root_->toArray()) {
return array->toVariantList(); return array->toVariantList();
} }
} }
return QVariant(); return QVariant();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: array // Name: array
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonDocument::array() const { QJsonArray QJsonDocument::array() const {
if(!isEmpty()) { if(!isEmpty()) {
if(QJsonArray *const array = root_->toArray()) { if(QJsonArray *const array = root_->toArray()) {
return *array; return *array;
} }
} }
return QJsonArray(); return QJsonArray();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: object // Name: object
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonDocument::object() const { QJsonObject QJsonDocument::object() const {
if(!isEmpty()) { if(!isEmpty()) {
if(QJsonObject *const object = root_->toObject()) { if(QJsonObject *const object = root_->toObject()) {
return *object; return *object;
} }
} }
return QJsonObject(); return QJsonObject();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: rawData // Name: rawData
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const char *QJsonDocument::rawData(int *size) const { const char *QJsonDocument::rawData(int *size) const {
Q_UNUSED(size); Q_UNUSED(size);
// TODO(eteran): implement this // TODO(eteran): implement this
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: fromBinaryData // Name: fromBinaryData
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) { QJsonDocument QJsonDocument::fromBinaryData(const QByteArray &data, DataValidation validation) {
Q_UNUSED(data); Q_UNUSED(data);
Q_UNUSED(validation); Q_UNUSED(validation);
QJsonDocument doc; QJsonDocument doc;
// TODO(eteran): implement this // TODO(eteran): implement this
return doc; return doc;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: fromJson // Name: fromJson
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) { QJsonDocument QJsonDocument::fromJson(const QByteArray &json, QJsonParseError *error) {
QJsonDocument doc; QJsonDocument doc;
const char *const begin = json.constData(); const char *const begin = json.constData();
const char *const end = begin + json.size(); const char *const end = begin + json.size();
QJsonParser parser(begin, end); QJsonParser parser(begin, end);
doc.root_ = parser.parse(); doc.root_ = parser.parse();
if(error) { if(error) {
*error = parser.state(); *error = parser.state();
} }
return doc; return doc;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: fromRawData // Name: fromRawData
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) { QJsonDocument QJsonDocument::fromRawData(const char *data, int size, DataValidation validation) {
// data has to be aligned to a 4 byte boundary. // data has to be aligned to a 4 byte boundary.
Q_ASSERT(!(reinterpret_cast<quintptr>(data) % 3)); Q_ASSERT(!(reinterpret_cast<quintptr>(data) % 3));
return fromBinaryData(QByteArray::fromRawData(data, size), validation); return fromBinaryData(QByteArray::fromRawData(data, size), validation);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: fromVariant // Name: fromVariant
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) { QJsonDocument QJsonDocument::fromVariant(const QVariant &variant) {
QJsonDocument doc; QJsonDocument doc;
if (variant.type() == QVariant::Map) { if (variant.type() == QVariant::Map) {
doc.setObject(QJsonObject::fromVariantMap(variant.toMap())); doc.setObject(QJsonObject::fromVariantMap(variant.toMap()));
} else if (variant.type() == QVariant::Hash) { } else if (variant.type() == QVariant::Hash) {
doc.setObject(QJsonObject::fromVariantHash(variant.toHash())); doc.setObject(QJsonObject::fromVariantHash(variant.toHash()));
} else if (variant.type() == QVariant::List) { } else if (variant.type() == QVariant::List) {
doc.setArray(QJsonArray::fromVariantList(variant.toList())); doc.setArray(QJsonArray::fromVariantList(variant.toList()));
} else if (variant.type() == QVariant::StringList) { } else if (variant.type() == QVariant::StringList) {
doc.setArray(QJsonArray::fromStringList(variant.toStringList())); doc.setArray(QJsonArray::fromStringList(variant.toStringList()));
} }
return doc; return doc;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: swap // Name: swap
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonDocument::swap(QJsonDocument &other) { void QJsonDocument::swap(QJsonDocument &other) {
qSwap(root_, other.root_); qSwap(root_, other.root_);
} }
#endif #endif

View File

@ -1,103 +1,103 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_DOCUMENT_H_ #ifndef QJSON_DOCUMENT_H_
#define QJSON_DOCUMENT_H_ #define QJSON_DOCUMENT_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonDocument> #include <QtCore/QJsonDocument>
#else #else
class QVariant; class QVariant;
class QByteArray; class QByteArray;
class QTextStream; class QTextStream;
class QJsonObject; class QJsonObject;
class QJsonValue; class QJsonValue;
class QJsonArray; class QJsonArray;
class QJsonParseError; class QJsonParseError;
class QJsonRoot; class QJsonRoot;
class QJsonDocument { class QJsonDocument {
public: public:
enum DataValidation { enum DataValidation {
Validate = 0, Validate = 0,
BypassValidation = 1 BypassValidation = 1
}; };
enum JsonFormat { enum JsonFormat {
Indented, Indented,
Compact Compact
}; };
public: public:
QJsonDocument(); QJsonDocument();
QJsonDocument(const QJsonObject &object); QJsonDocument(const QJsonObject &object);
QJsonDocument(const QJsonArray &array); QJsonDocument(const QJsonArray &array);
QJsonDocument(const QJsonDocument &other); QJsonDocument(const QJsonDocument &other);
~QJsonDocument(); ~QJsonDocument();
public: public:
QJsonDocument &operator=(const QJsonDocument &other); QJsonDocument &operator=(const QJsonDocument &other);
public: public:
bool operator!=(const QJsonDocument &other) const; bool operator!=(const QJsonDocument &other) const;
bool operator==(const QJsonDocument &other) const; bool operator==(const QJsonDocument &other) const;
public: public:
bool isArray() const; bool isArray() const;
bool isEmpty() const; bool isEmpty() const;
bool isNull() const; bool isNull() const;
bool isObject() const; bool isObject() const;
public: public:
QByteArray toBinaryData() const; QByteArray toBinaryData() const;
QByteArray toJson(JsonFormat format = Indented) const; QByteArray toJson(JsonFormat format = Indented) const;
QVariant toVariant() const; QVariant toVariant() const;
public: public:
QJsonArray array() const; QJsonArray array() const;
QJsonObject object() const; QJsonObject object() const;
const char *rawData(int *size) const; const char *rawData(int *size) const;
public: public:
void setArray(const QJsonArray &array); void setArray(const QJsonArray &array);
void setObject(const QJsonObject &object); void setObject(const QJsonObject &object);
public: public:
static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate); static QJsonDocument fromBinaryData(const QByteArray &data, DataValidation validation = Validate);
static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0); static QJsonDocument fromJson(const QByteArray &json, QJsonParseError *error = 0);
static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate); static QJsonDocument fromRawData(const char *data, int size, DataValidation validation = Validate);
static QJsonDocument fromVariant(const QVariant &variant); static QJsonDocument fromVariant(const QVariant &variant);
private: private:
void setRoot(const QJsonRoot &root); void setRoot(const QJsonRoot &root);
QString toJson(const QJsonValue &v, JsonFormat format) const; QString toJson(const QJsonValue &v, JsonFormat format) const;
QString escapeString(const QString &s) const; QString escapeString(const QString &s) const;
private: private:
void swap(QJsonDocument &other); void swap(QJsonDocument &other);
private: private:
QJsonRoot *root_; QJsonRoot *root_;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonObject.h" #include "QJsonObject.h"

View File

@ -1,322 +1,322 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonObject.h" #include "QJsonObject.h"
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonObject // Name: QJsonObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::QJsonObject() { QJsonObject::QJsonObject() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonObject // Name: QJsonObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::QJsonObject(const QJsonObject &other) : values_(other.values_) { QJsonObject::QJsonObject(const QJsonObject &other) : values_(other.values_) {
} }
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonObject // Name: QJsonObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args) { QJsonObject::QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args) {
for(const QPair<QString, QJsonValue> &arg : args) { for(const QPair<QString, QJsonValue> &arg : args) {
values_.insert(arg.first, arg.second); values_.insert(arg.first, arg.second);
} }
} }
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: ~QJsonObject // Name: ~QJsonObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::~QJsonObject() { QJsonObject::~QJsonObject() {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject &QJsonObject::operator=(const QJsonObject &other) { QJsonObject &QJsonObject::operator=(const QJsonObject &other) {
QJsonObject(other).swap(*this); QJsonObject(other).swap(*this);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::iterator QJsonObject::begin() { QJsonObject::iterator QJsonObject::begin() {
return values_.begin(); return values_.begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::begin() const { QJsonObject::const_iterator QJsonObject::begin() const {
return values_.begin(); return values_.begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::iterator QJsonObject::end() { QJsonObject::iterator QJsonObject::end() {
return values_.end(); return values_.end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::end() const { QJsonObject::const_iterator QJsonObject::end() const {
return values_.end(); return values_.end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::constBegin() const { QJsonObject::const_iterator QJsonObject::constBegin() const {
return begin(); return begin();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::constEnd() const { QJsonObject::const_iterator QJsonObject::constEnd() const {
return end(); return end();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonObject::count() const { int QJsonObject::count() const {
return size(); return size();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonObject::length() const { int QJsonObject::length() const {
return size(); return size();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonObject::size() const { int QJsonObject::size() const {
return values_.size(); return values_.size();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonObject::empty() const { bool QJsonObject::empty() const {
return values_.empty(); return values_.empty();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonObject::isEmpty() const { bool QJsonObject::isEmpty() const {
return empty(); return empty();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const { QJsonObject::const_iterator QJsonObject::constFind(const QString &key) const {
return values_.find(key); return values_.find(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonObject::contains(const QString &key) const { bool QJsonObject::contains(const QString &key) const {
return values_.contains(key); return values_.contains(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::iterator QJsonObject::find(const QString &key) { QJsonObject::iterator QJsonObject::find(const QString &key) {
return values_.find(key); return values_.find(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::const_iterator QJsonObject::find(const QString &key) const { QJsonObject::const_iterator QJsonObject::find(const QString &key) const {
return values_.find(key); return values_.find(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::iterator QJsonObject::erase(iterator it) { QJsonObject::iterator QJsonObject::erase(iterator it) {
return values_.erase(it); return values_.erase(it);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &value) { QJsonObject::iterator QJsonObject::insert(const QString &key, const QJsonValue &value) {
return values_.insert(key, value); return values_.insert(key, value);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QStringList QJsonObject::keys() const { QStringList QJsonObject::keys() const {
return values_.keys(); return values_.keys();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonObject::remove(const QString &key) { void QJsonObject::remove(const QString &key) {
values_.remove(key); values_.remove(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonObject::take(const QString &key) { QJsonValue QJsonObject::take(const QString &key) {
return values_.take(key); return values_.take(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonObject::value(const QString &key) const { QJsonValue QJsonObject::value(const QString &key) const {
return values_.value(key); return values_.value(key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonObject::operator!=(const QJsonObject &other) const { bool QJsonObject::operator!=(const QJsonObject &other) const {
return values_ != other.values_; return values_ != other.values_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonObject::operator==(const QJsonObject &other) const { bool QJsonObject::operator==(const QJsonObject &other) const {
return values_ != other.values_; return values_ != other.values_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonObject::operator[](const QString &key) const { QJsonValue QJsonObject::operator[](const QString &key) const {
return values_[key]; return values_[key];
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef QJsonObject::operator[](const QString &key) { QJsonValueRef QJsonObject::operator[](const QString &key) {
return QJsonValueRef(this, key); return QJsonValueRef(this, key);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QVariantMap QJsonObject::toVariantMap() const { QVariantMap QJsonObject::toVariantMap() const {
QVariantMap a; QVariantMap a;
for(const_iterator it = begin(); it != end(); ++it) { for(const_iterator it = begin(); it != end(); ++it) {
a.insert(it.key(), it.value().toVariant()); a.insert(it.key(), it.value().toVariant());
} }
return a; return a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QVariantHash QJsonObject::toVariantHash() const { QVariantHash QJsonObject::toVariantHash() const {
QVariantHash a; QVariantHash a;
for(const_iterator it = begin(); it != end(); ++it) { for(const_iterator it = begin(); it != end(); ++it) {
a.insert(it.key(), it.value().toVariant()); a.insert(it.key(), it.value().toVariant());
} }
return a; return a;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map) { QJsonObject QJsonObject::fromVariantMap(const QVariantMap &map) {
QJsonObject o; QJsonObject o;
for(QVariantMap::const_iterator it = map.begin(); it != map.end(); ++it) { for(QVariantMap::const_iterator it = map.begin(); it != map.end(); ++it) {
o.insert(it.key(), QJsonValue::fromVariant(it.value())); o.insert(it.key(), QJsonValue::fromVariant(it.value()));
} }
return o; return o;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonObject::fromVariantHash(const QVariantHash &hash) { QJsonObject QJsonObject::fromVariantHash(const QVariantHash &hash) {
QJsonObject o; QJsonObject o;
for(QVariantHash::const_iterator it = hash.begin(); it != hash.end(); ++it) { for(QVariantHash::const_iterator it = hash.begin(); it != hash.end(); ++it) {
o.insert(it.key(), QJsonValue::fromVariant(it.value())); o.insert(it.key(), QJsonValue::fromVariant(it.value()));
} }
return o; return o;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonRoot *QJsonObject::clone() const { QJsonRoot *QJsonObject::clone() const {
return new QJsonObject(*this); return new QJsonObject(*this);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const QJsonObject *QJsonObject::toObject() const { const QJsonObject *QJsonObject::toObject() const {
return this; return this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject *QJsonObject::toObject() { QJsonObject *QJsonObject::toObject() {
return this; return this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray *QJsonObject::toArray() { QJsonArray *QJsonObject::toArray() {
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const QJsonArray *QJsonObject::toArray() const { const QJsonArray *QJsonObject::toArray() const {
return 0; return 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: swap // Name: swap
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonObject::swap(QJsonObject &other) { void QJsonObject::swap(QJsonObject &other) {
qSwap(values_, other.values_); qSwap(values_, other.values_);
} }
#endif #endif

View File

@ -1,121 +1,121 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_OBJECT_H_ #ifndef QJSON_OBJECT_H_
#define QJSON_OBJECT_H_ #define QJSON_OBJECT_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonObject> #include <QtCore/QJsonObject>
#else #else
#include "QJsonRoot.h" #include "QJsonRoot.h"
#include "QJsonValueRef.h" #include "QJsonValueRef.h"
#include "QJsonValue.h" #include "QJsonValue.h"
#include <QtCore/QString> #include <QtCore/QString>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QVariantMap> #include <QtCore/QVariantMap>
#include <QtCore/QMap> #include <QtCore/QMap>
class QJsonObject : public QJsonRoot { class QJsonObject : public QJsonRoot {
friend class QJsonDocument; friend class QJsonDocument;
friend class QJsonValue; friend class QJsonValue;
friend class QJsonValueRef; friend class QJsonValueRef;
friend class QJsonParser; friend class QJsonParser;
public: public:
// TODO(eteran): manually implement the map, for now we use QMap // TODO(eteran): manually implement the map, for now we use QMap
// but the real thing has a custom implementation // but the real thing has a custom implementation
// I guess for the purposes of less interdependancies? // I guess for the purposes of less interdependancies?
// maybe so it's easier to forward declare the iterators? // maybe so it's easier to forward declare the iterators?
typedef QMap<QString, QJsonValue>::const_iterator const_iterator; typedef QMap<QString, QJsonValue>::const_iterator const_iterator;
typedef QMap<QString, QJsonValue>::iterator iterator; typedef QMap<QString, QJsonValue>::iterator iterator;
typedef const_iterator ConstIterator; typedef const_iterator ConstIterator;
typedef iterator Iterator; typedef iterator Iterator;
typedef QMap<QString, QJsonValue>::key_type key_type; typedef QMap<QString, QJsonValue>::key_type key_type;
typedef QMap<QString, QJsonValue>::mapped_type mapped_type; typedef QMap<QString, QJsonValue>::mapped_type mapped_type;
typedef QMap<QString, QJsonValue>::size_type size_type; typedef QMap<QString, QJsonValue>::size_type size_type;
public: public:
QJsonObject(); QJsonObject();
#if __cplusplus >= 201103L #if __cplusplus >= 201103L
QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args); QJsonObject(std::initializer_list<QPair<QString, QJsonValue> > args);
#endif #endif
QJsonObject(const QJsonObject &other); QJsonObject(const QJsonObject &other);
~QJsonObject(); ~QJsonObject();
QJsonObject &operator=(const QJsonObject &other); QJsonObject &operator=(const QJsonObject &other);
public: public:
iterator begin(); iterator begin();
const_iterator begin() const; const_iterator begin() const;
iterator end(); iterator end();
const_iterator end() const; const_iterator end() const;
const_iterator constBegin() const; const_iterator constBegin() const;
const_iterator constEnd() const; const_iterator constEnd() const;
public: public:
int count() const; int count() const;
int length() const; int length() const;
int size() const; int size() const;
bool empty() const; bool empty() const;
bool isEmpty() const; bool isEmpty() const;
public: public:
const_iterator constFind(const QString &key) const; const_iterator constFind(const QString &key) const;
bool contains(const QString &key) const; bool contains(const QString &key) const;
iterator find(const QString &key); iterator find(const QString &key);
const_iterator find(const QString &key) const; const_iterator find(const QString &key) const;
public: public:
iterator erase(iterator it); iterator erase(iterator it);
iterator insert(const QString &key, const QJsonValue &value); iterator insert(const QString &key, const QJsonValue &value);
QStringList keys() const; QStringList keys() const;
void remove(const QString &key); void remove(const QString &key);
QJsonValue take(const QString &key); QJsonValue take(const QString &key);
QJsonValue value(const QString &key) const; QJsonValue value(const QString &key) const;
bool operator!=(const QJsonObject &other) const; bool operator!=(const QJsonObject &other) const;
bool operator==(const QJsonObject &other) const; bool operator==(const QJsonObject &other) const;
QJsonValue operator[](const QString &key) const; QJsonValue operator[](const QString &key) const;
QJsonValueRef operator[](const QString &key); QJsonValueRef operator[](const QString &key);
public: public:
QVariantMap toVariantMap() const; QVariantMap toVariantMap() const;
QVariantHash toVariantHash() const; QVariantHash toVariantHash() const;
public: public:
static QJsonObject fromVariantMap(const QVariantMap &map); static QJsonObject fromVariantMap(const QVariantMap &map);
static QJsonObject fromVariantHash(const QVariantHash &hash); static QJsonObject fromVariantHash(const QVariantHash &hash);
private: private:
virtual QJsonRoot *clone() const; virtual QJsonRoot *clone() const;
virtual QJsonArray *toArray(); virtual QJsonArray *toArray();
virtual QJsonObject *toObject(); virtual QJsonObject *toObject();
virtual const QJsonArray *toArray() const; virtual const QJsonArray *toArray() const;
virtual const QJsonObject *toObject() const; virtual const QJsonObject *toObject() const;
private: private:
void swap(QJsonObject &other); void swap(QJsonObject &other);
private: private:
QMap<QString, QJsonValue> values_; QMap<QString, QJsonValue> values_;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonParseError.h" #include "QJsonParseError.h"

View File

@ -1,64 +1,64 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonParseError.h" #include "QJsonParseError.h"
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: errorString // Name: errorString
// Desc: The QJsonParseError class is used to report errors during JSON parsing. // Desc: The QJsonParseError class is used to report errors during JSON parsing.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonParseError::errorString() const { QString QJsonParseError::errorString() const {
switch(error) { switch(error) {
case NoError: case NoError:
return "No error occurred"; return "No error occurred";
case UnterminatedObject: case UnterminatedObject:
return "unterminated object"; return "unterminated object";
case MissingNameSeparator: case MissingNameSeparator:
return "missing name separator"; return "missing name separator";
case UnterminatedArray: case UnterminatedArray:
return "unterminated array"; return "unterminated array";
case MissingValueSeparator: case MissingValueSeparator:
return "missing value separator"; return "missing value separator";
case IllegalValue: case IllegalValue:
return "illegal value"; return "illegal value";
case TerminationByNumber: case TerminationByNumber:
return "invalid termination by number"; return "invalid termination by number";
case IllegalNumber: case IllegalNumber:
return "illegal number"; return "illegal number";
case IllegalEscapeSequence: case IllegalEscapeSequence:
return "illegal escape sequence"; return "illegal escape sequence";
case IllegalUTF8String: case IllegalUTF8String:
return "invalid UTF8 string"; return "invalid UTF8 string";
case UnterminatedString: case UnterminatedString:
return "unterminated string"; return "unterminated string";
case MissingObject: case MissingObject:
return "object is missing after a comma"; return "object is missing after a comma";
case DeepNesting: case DeepNesting:
return "too deeply nested document"; return "too deeply nested document";
case DocumentTooLarge: case DocumentTooLarge:
return "too large document"; return "too large document";
case GarbageAtEnd: case GarbageAtEnd:
return "garbage at the end of the document"; return "garbage at the end of the document";
} }
return QString(); return QString();
} }
#endif #endif

View File

@ -1,60 +1,60 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_PARSE_ERROR_H_ #ifndef QJSON_PARSE_ERROR_H_
#define QJSON_PARSE_ERROR_H_ #define QJSON_PARSE_ERROR_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonParseError> #include <QtCore/QJsonParseError>
#else #else
#include <QtCore/QString> #include <QtCore/QString>
class QJsonParseError { class QJsonParseError {
public: public:
enum ParseError { enum ParseError {
NoError = 0, NoError = 0,
UnterminatedObject = 1, UnterminatedObject = 1,
MissingNameSeparator = 2, MissingNameSeparator = 2,
UnterminatedArray = 3, UnterminatedArray = 3,
MissingValueSeparator = 4, MissingValueSeparator = 4,
IllegalValue = 5, IllegalValue = 5,
TerminationByNumber = 6, TerminationByNumber = 6,
IllegalNumber = 7, IllegalNumber = 7,
IllegalEscapeSequence = 8, IllegalEscapeSequence = 8,
IllegalUTF8String = 9, IllegalUTF8String = 9,
UnterminatedString = 10, UnterminatedString = 10,
MissingObject = 11, MissingObject = 11,
DeepNesting = 12, DeepNesting = 12,
DocumentTooLarge = 13, DocumentTooLarge = 13,
GarbageAtEnd = 14 GarbageAtEnd = 14
}; };
public: public:
QString errorString() const; QString errorString() const;
public: public:
ParseError error; ParseError error;
int offset; int offset;
}; };
#endif #endif
#endif #endif

View File

@ -1,455 +1,455 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonParser.h" #include "QJsonParser.h"
#include "QJsonArray.h" #include "QJsonArray.h"
#include "QJsonObject.h" #include "QJsonObject.h"
#include "QJsonValue.h" #include "QJsonValue.h"
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
#include <cctype> #include <cctype>
#include <QScopedPointer> #include <QScopedPointer>
#include <QVector> #include <QVector>
namespace { namespace {
unsigned int to_hex(int ch) { unsigned int to_hex(int ch) {
static const int hexval[256] = { static const int hexval[256] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 0x0, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
}; };
if(static_cast<unsigned int>(ch) < 256) { if(static_cast<unsigned int>(ch) < 256) {
return hexval[static_cast<unsigned int>(ch)]; return hexval[static_cast<unsigned int>(ch)];
} else { } else {
return 0; return 0;
} }
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonParser // Name: QJsonParser
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonParser::QJsonParser(const char *begin, const char *end) : begin_(begin), end_(end), p_(begin) { QJsonParser::QJsonParser(const char *begin, const char *end) : begin_(begin), end_(end), p_(begin) {
state_.error = QJsonParseError::NoError; state_.error = QJsonParseError::NoError;
state_.offset = 0; state_.offset = 0;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: parse // Name: parse
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonRoot *QJsonParser::parse() { QJsonRoot *QJsonParser::parse() {
if(begin_ == end_) { if(begin_ == end_) {
return 0; return 0;
} }
QJsonRoot *ret = 0; QJsonRoot *ret = 0;
try { try {
const char ch = peek(); const char ch = peek();
switch(ch) { switch(ch) {
case ArrayBegin: case ArrayBegin:
ret = getArray(); ret = getArray();
break; break;
case ObjectBegin: case ObjectBegin:
ret = getObject(); ret = getObject();
break; break;
default: default:
state_.error = QJsonParseError::IllegalValue; state_.error = QJsonParseError::IllegalValue;
state_.offset = p_ - begin_; state_.offset = p_ - begin_;
break; break;
} }
} catch(const QJsonParseError &e) { } catch(const QJsonParseError &e) {
state_ = e; state_ = e;
} }
if(ret) { if(ret) {
// eat up trailing white space... // eat up trailing white space...
while(p_ != end_ && std::isspace(*p_)) { while(p_ != end_ && std::isspace(*p_)) {
++p_; ++p_;
} }
//detect trailing garbage //detect trailing garbage
if(p_ != end_) { if(p_ != end_) {
state_.error = QJsonParseError::GarbageAtEnd; state_.error = QJsonParseError::GarbageAtEnd;
state_.offset = p_ - begin_; state_.offset = p_ - begin_;
} }
} }
return ret; return ret;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: peek // Name: peek
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
char QJsonParser::peek() { char QJsonParser::peek() {
// first eat up some whitespace // first eat up some whitespace
while(p_ != end_ && std::isspace(*p_)) { while(p_ != end_ && std::isspace(*p_)) {
++p_; ++p_;
} }
return *p_; return *p_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getValue // Name: getValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonParser::getValue() { QJsonValue QJsonParser::getValue() {
switch(peek()) { switch(peek()) {
case ObjectBegin: case ObjectBegin:
{ {
QScopedPointer<QJsonObject> obj(getObject()); QScopedPointer<QJsonObject> obj(getObject());
return QJsonValue(*obj); return QJsonValue(*obj);
} }
case ArrayBegin: case ArrayBegin:
{ {
QScopedPointer<QJsonArray> arr(getArray()); QScopedPointer<QJsonArray> arr(getArray());
return QJsonValue(*arr); return QJsonValue(*arr);
} }
case Quote: case Quote:
return QJsonValue(getString()); return QJsonValue(getString());
case 't': case 't':
return getTrue(); return getTrue();
case 'f': case 'f':
return getFalse(); return getFalse();
case 'n': case 'n':
return getNull(); return getNull();
default: default:
return getNumber(); return getNumber();
} }
throwError(QJsonParseError::MissingObject); throwError(QJsonParseError::MissingObject);
return QJsonValue(); return QJsonValue();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getObject // Name: getObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject *QJsonParser::getObject() { QJsonObject *QJsonParser::getObject() {
QScopedPointer<QJsonObject> obj(new QJsonObject); QScopedPointer<QJsonObject> obj(new QJsonObject);
char tok = peek(); char tok = peek();
if(tok != ObjectBegin) { if(tok != ObjectBegin) {
throwError(QJsonParseError::IllegalValue); throwError(QJsonParseError::IllegalValue);
} }
++p_; ++p_;
// handle empty object // handle empty object
tok = peek(); tok = peek();
if(peek() == ObjectEnd) { if(peek() == ObjectEnd) {
++p_; ++p_;
} else { } else {
do { do {
QPair<QString, QJsonValue> p = getPair(); QPair<QString, QJsonValue> p = getPair();
obj->values_.insert(p.first, p.second); obj->values_.insert(p.first, p.second);
tok = peek(); tok = peek();
++p_; ++p_;
} while(tok == ValueSeparator); } while(tok == ValueSeparator);
} }
if(tok != ObjectEnd) { if(tok != ObjectEnd) {
throwError(QJsonParseError::UnterminatedObject); throwError(QJsonParseError::UnterminatedObject);
} }
return obj.take(); return obj.take();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getArray // Name: getArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray *QJsonParser::getArray() { QJsonArray *QJsonParser::getArray() {
QScopedPointer<QJsonArray> arr(new QJsonArray); QScopedPointer<QJsonArray> arr(new QJsonArray);
char tok = peek(); char tok = peek();
if(tok != ArrayBegin) { if(tok != ArrayBegin) {
throwError(QJsonParseError::IllegalValue); throwError(QJsonParseError::IllegalValue);
} }
++p_; ++p_;
// handle empty object // handle empty object
tok = peek(); tok = peek();
if(tok == ArrayEnd) { if(tok == ArrayEnd) {
++p_; ++p_;
} else { } else {
do { do {
arr->values_.push_back(getValue()); arr->values_.push_back(getValue());
tok = peek(); tok = peek();
++p_; ++p_;
} while(tok == ValueSeparator); } while(tok == ValueSeparator);
} }
if(tok != ArrayEnd) { if(tok != ArrayEnd) {
throwError(QJsonParseError::MissingValueSeparator); throwError(QJsonParseError::MissingValueSeparator);
} }
return arr.take(); return arr.take();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getPair // Name: getPair
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QPair<QString, QJsonValue> QJsonParser::getPair() { QPair<QString, QJsonValue> QJsonParser::getPair() {
QString key = getString(); QString key = getString();
if(peek() != NameSeparator) { if(peek() != NameSeparator) {
throwError(QJsonParseError::MissingNameSeparator); throwError(QJsonParseError::MissingNameSeparator);
} }
++p_; ++p_;
return qMakePair(key, getValue()); return qMakePair(key, getValue());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getString // Name: getString
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonParser::getString() { QString QJsonParser::getString() {
if(peek() != Quote) { if(peek() != Quote) {
throwError(QJsonParseError::IllegalUTF8String); throwError(QJsonParseError::IllegalUTF8String);
} }
++p_; ++p_;
QByteArray s; QByteArray s;
while(p_ != end_ && *p_ != Quote && *p_ != '\n') { while(p_ != end_ && *p_ != Quote && *p_ != '\n') {
if(*p_ == '\\') { if(*p_ == '\\') {
++p_; ++p_;
if(p_ != end_) { if(p_ != end_) {
switch(*p_) { switch(*p_) {
case '"': s.append('"'); break; case '"': s.append('"'); break;
case '\\': s.append('\\'); break; case '\\': s.append('\\'); break;
case '/': s.append('/'); break; case '/': s.append('/'); break;
case 'b': s.append('\b'); break; case 'b': s.append('\b'); break;
case 'f': s.append('\f'); break; case 'f': s.append('\f'); break;
case 'n': s.append('\n'); break; case 'n': s.append('\n'); break;
case 'r': s.append('\r'); break; case 'r': s.append('\r'); break;
case 't': s.append('\t'); break; case 't': s.append('\t'); break;
case 'u': case 'u':
{ {
QString hexChar; QString hexChar;
// convert \uXXXX escape sequences to UTF-8 // convert \uXXXX escape sequences to UTF-8
char hex[4]; char hex[4];
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[0] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[0] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[1] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[1] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[2] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[2] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[3] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[3] = *++p_;
if(!std::isxdigit(hex[0])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[0])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[1])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[1])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[2])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[2])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[3])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[3])) throwError(QJsonParseError::IllegalUTF8String);
quint16 w1 = 0; quint16 w1 = 0;
quint16 w2 = 0; quint16 w2 = 0;
w1 |= (to_hex(hex[0]) << 12); w1 |= (to_hex(hex[0]) << 12);
w1 |= (to_hex(hex[1]) << 8); w1 |= (to_hex(hex[1]) << 8);
w1 |= (to_hex(hex[2]) << 4); w1 |= (to_hex(hex[2]) << 4);
w1 |= (to_hex(hex[3])); w1 |= (to_hex(hex[3]));
hexChar.append(QChar(w1)); hexChar.append(QChar(w1));
if((w1 & 0xfc00) == 0xdc00) { if((w1 & 0xfc00) == 0xdc00) {
throwError(QJsonParseError::IllegalUTF8String); throwError(QJsonParseError::IllegalUTF8String);
} }
if((w1 & 0xfc00) == 0xd800) { if((w1 & 0xfc00) == 0xd800) {
// part of a surrogate pair // part of a surrogate pair
if(p_ == end_ || *++p_ != '\\') { throwError(QJsonParseError::IllegalEscapeSequence); } if(p_ == end_ || *++p_ != '\\') { throwError(QJsonParseError::IllegalEscapeSequence); }
if(p_ == end_ || *++p_ != 'u') { throwError(QJsonParseError::IllegalEscapeSequence); } if(p_ == end_ || *++p_ != 'u') { throwError(QJsonParseError::IllegalEscapeSequence); }
// convert \uXXXX escape sequences to UTF-8 // convert \uXXXX escape sequences to UTF-8
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[0] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[0] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[1] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[1] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[2] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[2] = *++p_;
if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[3] = *++p_; if(p_ == end_) { throwError(QJsonParseError::IllegalEscapeSequence); } hex[3] = *++p_;
if(!std::isxdigit(hex[0])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[0])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[1])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[1])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[2])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[2])) throwError(QJsonParseError::IllegalUTF8String);
if(!std::isxdigit(hex[3])) throwError(QJsonParseError::IllegalUTF8String); if(!std::isxdigit(hex[3])) throwError(QJsonParseError::IllegalUTF8String);
w2 |= (to_hex(hex[0]) << 12); w2 |= (to_hex(hex[0]) << 12);
w2 |= (to_hex(hex[1]) << 8); w2 |= (to_hex(hex[1]) << 8);
w2 |= (to_hex(hex[2]) << 4); w2 |= (to_hex(hex[2]) << 4);
w2 |= (to_hex(hex[3])); w2 |= (to_hex(hex[3]));
hexChar.append(QChar(w2)); hexChar.append(QChar(w2));
} }
s.append(hexChar.toUtf8()); s.append(hexChar.toUtf8());
} }
break; break;
default: default:
s.append('\\'); s.append('\\');
break; break;
} }
} }
} else { } else {
s.append(*p_); s.append(*p_);
} }
++p_; ++p_;
} }
if(*p_ != Quote || p_ == end_) { if(*p_ != Quote || p_ == end_) {
throwError(QJsonParseError::UnterminatedString); throwError(QJsonParseError::UnterminatedString);
} }
++p_; ++p_;
return QString::fromUtf8(s, s.size()); return QString::fromUtf8(s, s.size());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getNull // Name: getNull
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonParser::getNull() { QJsonValue QJsonParser::getNull() {
if(p_ == end_ || *p_++ != 'n') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'n') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'u') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'u') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); }
return QJsonValue(); return QJsonValue();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getTrue // Name: getTrue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonParser::getTrue() { QJsonValue QJsonParser::getTrue() {
if(p_ == end_ || *p_++ != 't') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 't') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'r') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'r') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'u') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'u') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'e') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'e') { throwError(QJsonParseError::IllegalValue); }
return QJsonValue(true); return QJsonValue(true);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getFalse // Name: getFalse
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonParser::getFalse() { QJsonValue QJsonParser::getFalse() {
if(p_ == end_ || *p_++ != 'f') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'f') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'a') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'a') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'l') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 's') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 's') { throwError(QJsonParseError::IllegalValue); }
if(p_ == end_ || *p_++ != 'e') { throwError(QJsonParseError::IllegalValue); } if(p_ == end_ || *p_++ != 'e') { throwError(QJsonParseError::IllegalValue); }
return QJsonValue(false); return QJsonValue(false);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: getNumber // Name: getNumber
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonParser::getNumber() { QJsonValue QJsonParser::getNumber() {
// JSON numbers fit the regex: -?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)? // JSON numbers fit the regex: -?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?
const char *const first = p_; const char *const first = p_;
// -? // -?
if(p_ != end_ && *p_ == '-') { if(p_ != end_ && *p_ == '-') {
++p_; ++p_;
} }
// (0|[1-9][0-9]*) // (0|[1-9][0-9]*)
if(p_ != end_) { if(p_ != end_) {
if(*p_ >= '1' && *p_ <= '9') { if(*p_ >= '1' && *p_ <= '9') {
while(p_ != end_ && std::isdigit(*p_)) { while(p_ != end_ && std::isdigit(*p_)) {
++p_; ++p_;
} }
} else if(*p_ == '0') { } else if(*p_ == '0') {
++p_; ++p_;
} else { } else {
throwError(QJsonParseError::IllegalNumber); throwError(QJsonParseError::IllegalNumber);
} }
} }
// (\.[0-9]+)? // (\.[0-9]+)?
if(p_ != end_ && *p_ == '.') { if(p_ != end_ && *p_ == '.') {
++p_; ++p_;
if(!std::isdigit(*p_)) { if(!std::isdigit(*p_)) {
throwError(QJsonParseError::IllegalNumber); throwError(QJsonParseError::IllegalNumber);
} }
while(p_ != end_ && std::isdigit(*p_)) { while(p_ != end_ && std::isdigit(*p_)) {
++p_; ++p_;
} }
} }
// ([eE][+-]?[0-9]+)? // ([eE][+-]?[0-9]+)?
if(p_ != end_ && (*p_ == 'e' || *p_ == 'E')) { if(p_ != end_ && (*p_ == 'e' || *p_ == 'E')) {
++p_; ++p_;
if(p_ != end_ && (*p_ == '+' || *p_ == '-')) { if(p_ != end_ && (*p_ == '+' || *p_ == '-')) {
++p_; ++p_;
} }
if(!std::isdigit(*p_)) { if(!std::isdigit(*p_)) {
throwError(QJsonParseError::IllegalNumber); throwError(QJsonParseError::IllegalNumber);
} }
while(p_ != end_ && std::isdigit(*p_)) { while(p_ != end_ && std::isdigit(*p_)) {
++p_; ++p_;
} }
} }
if(p_ == end_) { if(p_ == end_) {
throwError(QJsonParseError::TerminationByNumber); throwError(QJsonParseError::TerminationByNumber);
} }
return QJsonValue(QByteArray::fromRawData(first, p_ - first).toDouble()); return QJsonValue(QByteArray::fromRawData(first, p_ - first).toDouble());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: state // Name: state
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonParseError QJsonParser::state() const { QJsonParseError QJsonParser::state() const {
return state_; return state_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: throwError // Name: throwError
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonParser::throwError(QJsonParseError::ParseError e) { void QJsonParser::throwError(QJsonParseError::ParseError e) {
QJsonParseError err; QJsonParseError err;
err.error = e; err.error = e;
err.offset = p_ - begin_; err.offset = p_ - begin_;
throw err; throw err;
} }
#endif #endif

View File

@ -1,81 +1,81 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
// NOTE: this is not part of the "public" Qt API, so using this class directly // NOTE: this is not part of the "public" Qt API, so using this class directly
// is not recomended // is not recomended
#ifndef QJSON_PARSER_H_ #ifndef QJSON_PARSER_H_
#define QJSON_PARSER_H_ #define QJSON_PARSER_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
#include "QJsonParseError.h" #include "QJsonParseError.h"
#include <QPair> #include <QPair>
class QJsonRoot; class QJsonRoot;
class QJsonObject; class QJsonObject;
class QJsonArray; class QJsonArray;
class QJsonValue; class QJsonValue;
class QJsonParser { class QJsonParser {
friend class QJsonDocument; friend class QJsonDocument;
public: public:
QJsonParser(const char *begin, const char *end); QJsonParser(const char *begin, const char *end);
public: public:
QJsonRoot *parse(); QJsonRoot *parse();
public: public:
QJsonParseError state() const; QJsonParseError state() const;
private: private:
static const char ArrayBegin = '['; static const char ArrayBegin = '[';
static const char ArrayEnd = ']'; static const char ArrayEnd = ']';
static const char NameSeparator = ':'; static const char NameSeparator = ':';
static const char ValueSeparator = ','; static const char ValueSeparator = ',';
static const char ObjectBegin = '{'; static const char ObjectBegin = '{';
static const char ObjectEnd = '}'; static const char ObjectEnd = '}';
static const char Quote = '"'; static const char Quote = '"';
private: private:
char peek(); char peek();
QJsonObject *getObject(); QJsonObject *getObject();
QJsonArray *getArray(); QJsonArray *getArray();
QJsonValue getValue(); QJsonValue getValue();
QString getString(); QString getString();
QJsonValue getTrue(); QJsonValue getTrue();
QJsonValue getFalse(); QJsonValue getFalse();
QJsonValue getNull(); QJsonValue getNull();
QJsonValue getNumber(); QJsonValue getNumber();
QPair<QString, QJsonValue> getPair(); QPair<QString, QJsonValue> getPair();
private: private:
void throwError(QJsonParseError::ParseError e); void throwError(QJsonParseError::ParseError e);
private: private:
QJsonParseError state_; QJsonParseError state_;
const char *const begin_; const char *const begin_;
const char *const end_; const char *const end_;
const char * p_; const char * p_;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonRoot.h" #include "QJsonRoot.h"

View File

@ -1,45 +1,45 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_ROOT_H_ #ifndef QJSON_ROOT_H_
#define QJSON_ROOT_H_ #define QJSON_ROOT_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
class QJsonObject; class QJsonObject;
class QJsonArray; class QJsonArray;
class QJsonRoot { class QJsonRoot {
public: public:
virtual ~QJsonRoot() {}; virtual ~QJsonRoot() {};
public: public:
virtual QJsonRoot *clone() const = 0; virtual QJsonRoot *clone() const = 0;
public: public:
virtual QJsonArray *toArray() = 0; virtual QJsonArray *toArray() = 0;
virtual QJsonObject *toObject() = 0; virtual QJsonObject *toObject() = 0;
virtual const QJsonArray *toArray() const = 0; virtual const QJsonArray *toArray() const = 0;
virtual const QJsonObject *toObject() const = 0; virtual const QJsonObject *toObject() const = 0;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonValue.h" #include "QJsonValue.h"

View File

@ -1,391 +1,391 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonValue.h" #include "QJsonValue.h"
#include "QJsonArray.h" #include "QJsonArray.h"
#include "QJsonObject.h" #include "QJsonObject.h"
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
#include <QtCore/QtAlgorithms> #include <QtCore/QtAlgorithms>
#include <QtCore/qmath.h> #include <QtCore/qmath.h>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(Type type) : type_(type) { QJsonValue::QJsonValue(Type type) : type_(type) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(bool b) : type_(Bool) { QJsonValue::QJsonValue(bool b) : type_(Bool) {
value_.b = b; value_.b = b;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(double n) : type_(Double) { QJsonValue::QJsonValue(double n) : type_(Double) {
value_.n = n; value_.n = n;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(const QString &s) : type_(String) { QJsonValue::QJsonValue(const QString &s) : type_(String) {
value_.s = new QString(s); value_.s = new QString(s);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(QLatin1String s) : type_(String) { QJsonValue::QJsonValue(QLatin1String s) : type_(String) {
value_.s = new QString(s); value_.s = new QString(s);
} }
#ifndef QT_NO_CAST_FROM_ASCII #ifndef QT_NO_CAST_FROM_ASCII
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(const char *s) : type_(String) { QJsonValue::QJsonValue(const char *s) : type_(String) {
value_.s = new QString(QString::fromUtf8(s)); value_.s = new QString(QString::fromUtf8(s));
} }
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(const QJsonArray &a) : type_(Array) { QJsonValue::QJsonValue(const QJsonArray &a) : type_(Array) {
value_.r = a.clone(); value_.r = a.clone();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(const QJsonObject &o) : type_(Object) { QJsonValue::QJsonValue(const QJsonObject &o) : type_(Object) {
value_.r = o.clone(); value_.r = o.clone();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(int n) : type_(Double) { QJsonValue::QJsonValue(int n) : type_(Double) {
value_.n = n; value_.n = n;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(qint64 n) : type_(Double) { QJsonValue::QJsonValue(qint64 n) : type_(Double) {
value_.n = n; value_.n = n;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: QJsonValue // Name: QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::QJsonValue(const QJsonValue &other) : type_(other.type_) { QJsonValue::QJsonValue(const QJsonValue &other) : type_(other.type_) {
switch(other.type_) { switch(other.type_) {
case Bool: case Bool:
value_.b = other.value_.b; value_.b = other.value_.b;
break; break;
case Double: case Double:
value_.n = other.value_.n; value_.n = other.value_.n;
break; break;
case String: case String:
value_.s = new QString(*other.value_.s); value_.s = new QString(*other.value_.s);
break; break;
case Array: case Array:
case Object: case Object:
value_.r = other.value_.r->clone(); value_.r = other.value_.r->clone();
break; break;
case Undefined: case Undefined:
case Null: case Null:
value_ = other.value_; value_ = other.value_;
break; break;
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: ~QJsonValue // Name: ~QJsonValue
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::~QJsonValue() { QJsonValue::~QJsonValue() {
switch(type_) { switch(type_) {
case Null: case Null:
case Bool: case Bool:
case Double: case Double:
case Undefined: case Undefined:
break; break;
case String: case String:
delete value_.s; delete value_.s;
break; break;
case Object: case Object:
case Array: case Array:
delete value_.r; delete value_.r;
break; break;
} }
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator= // Name: operator=
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue &QJsonValue::operator=(const QJsonValue &other) { QJsonValue &QJsonValue::operator=(const QJsonValue &other) {
QJsonValue(other).swap(*this); QJsonValue(other).swap(*this);
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator!= // Name: operator!=
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::operator!=(const QJsonValue &other) const { bool QJsonValue::operator!=(const QJsonValue &other) const {
return !(*this == other); return !(*this == other);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator== // Name: operator==
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::operator==(const QJsonValue &other) const { bool QJsonValue::operator==(const QJsonValue &other) const {
if(type_ == other.type_) { if(type_ == other.type_) {
switch(type_) { switch(type_) {
case Null: case Null:
return true; return true;
case Bool: case Bool:
return value_.b == other.value_.b; return value_.b == other.value_.b;
case Double: case Double:
return value_.n == other.value_.n; return value_.n == other.value_.n;
case Undefined: case Undefined:
return true; return true;
case String: case String:
return *value_.s == *other.value_.s; return *value_.s == *other.value_.s;
case Array: case Array:
return *(value_.r->toArray()) == *(other.value_.r->toArray()); return *(value_.r->toArray()) == *(other.value_.r->toArray());
case Object: case Object:
return *(value_.r->toObject()) == *(other.value_.r->toObject()); return *(value_.r->toObject()) == *(other.value_.r->toObject());
} }
} }
return false; return false;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isArray // Name: isArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isArray() const { bool QJsonValue::isArray() const {
return type_ == Array; return type_ == Array;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isBool // Name: isBool
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isBool() const { bool QJsonValue::isBool() const {
return type_ == Bool; return type_ == Bool;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isDouble // Name: isDouble
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isDouble() const { bool QJsonValue::isDouble() const {
return type_ == Double; return type_ == Double;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isNull // Name: isNull
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isNull() const { bool QJsonValue::isNull() const {
return type_ == Null; return type_ == Null;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isObject // Name: isObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isObject() const { bool QJsonValue::isObject() const {
return type_ == Object; return type_ == Object;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isString // Name: isString
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isString() const { bool QJsonValue::isString() const {
return type_ == String; return type_ == String;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isUndefined // Name: isUndefined
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::isUndefined() const { bool QJsonValue::isUndefined() const {
return type_ == Undefined; return type_ == Undefined;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: type // Name: type
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::Type QJsonValue::type() const { QJsonValue::Type QJsonValue::type() const {
return type_; return type_;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toArray // Name: toArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonValue::toArray(const QJsonArray &defaultValue) const { QJsonArray QJsonValue::toArray(const QJsonArray &defaultValue) const {
if(isArray()) { if(isArray()) {
return *(value_.r->toArray()); return *(value_.r->toArray());
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toArray // Name: toArray
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonValue::toArray() const { QJsonArray QJsonValue::toArray() const {
return toArray(QJsonArray()); return toArray(QJsonArray());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toBool // Name: toBool
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValue::toBool(bool defaultValue) const { bool QJsonValue::toBool(bool defaultValue) const {
if(isBool()) { if(isBool()) {
return value_.b; return value_.b;
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toDouble // Name: toDouble
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
double QJsonValue::toDouble(double defaultValue) const { double QJsonValue::toDouble(double defaultValue) const {
if(isDouble()) { if(isDouble()) {
return value_.n; return value_.n;
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toInt // Name: toInt
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonValue::toInt(int defaultValue) const { int QJsonValue::toInt(int defaultValue) const {
if(isDouble() && qFloor(value_.n) == value_.n) { if(isDouble() && qFloor(value_.n) == value_.n) {
return value_.n; return value_.n;
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toObject // Name: toObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonValue::toObject(const QJsonObject &defaultValue) const { QJsonObject QJsonValue::toObject(const QJsonObject &defaultValue) const {
if(isObject()) { if(isObject()) {
return *(value_.r->toObject()); return *(value_.r->toObject());
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toObject // Name: toObject
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonValue::toObject() const { QJsonObject QJsonValue::toObject() const {
return toObject(QJsonObject()); return toObject(QJsonObject());
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toString // Name: toString
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonValue::toString(const QString &defaultValue) const { QString QJsonValue::toString(const QString &defaultValue) const {
if(isString()) { if(isString()) {
return *value_.s; return *value_.s;
} }
return defaultValue; return defaultValue;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toVariant // Name: toVariant
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QVariant QJsonValue::toVariant() const { QVariant QJsonValue::toVariant() const {
switch(type_) { switch(type_) {
case Null: case Null:
return QVariant(); return QVariant();
case Bool: case Bool:
return QVariant::fromValue(value_.b); return QVariant::fromValue(value_.b);
case Double: case Double:
return QVariant::fromValue(value_.n); return QVariant::fromValue(value_.n);
case String: case String:
return QVariant::fromValue(*value_.s); return QVariant::fromValue(*value_.s);
case Array: case Array:
return value_.r->toArray()->toVariantList(); return value_.r->toArray()->toVariantList();
case Object: case Object:
return value_.r->toObject()->toVariantMap(); return value_.r->toObject()->toVariantMap();
case Undefined: case Undefined:
return QVariant(); return QVariant();
} }
return QVariant(); return QVariant();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: fromVariant // Name: fromVariant
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonValue::fromVariant(const QVariant &variant) { QJsonValue QJsonValue::fromVariant(const QVariant &variant) {
if(variant.isNull()) { if(variant.isNull()) {
return QJsonValue(Null); return QJsonValue(Null);
} }
switch(variant.type()) { switch(variant.type()) {
case QVariant::Bool: case QVariant::Bool:
return QJsonValue(variant.toBool()); return QJsonValue(variant.toBool());
case QVariant::Int: case QVariant::Int:
return QJsonValue(variant.toInt()); return QJsonValue(variant.toInt());
case QVariant::Double: case QVariant::Double:
case QVariant::LongLong: case QVariant::LongLong:
case QVariant::ULongLong: case QVariant::ULongLong:
case QVariant::UInt: case QVariant::UInt:
return QJsonValue(variant.toDouble()); return QJsonValue(variant.toDouble());
case QVariant::String: case QVariant::String:
return QJsonValue(variant.toString()); return QJsonValue(variant.toString());
case QVariant::List: case QVariant::List:
return QJsonArray::fromVariantList(variant.toList()); return QJsonArray::fromVariantList(variant.toList());
case QVariant::StringList: case QVariant::StringList:
return QJsonArray::fromStringList(variant.toStringList()); return QJsonArray::fromStringList(variant.toStringList());
case QVariant::Map: case QVariant::Map:
return QJsonObject::fromVariantMap(variant.toMap()); return QJsonObject::fromVariantMap(variant.toMap());
default: default:
const QString s = variant.toString(); const QString s = variant.toString();
if(!s.isEmpty()) { if(!s.isEmpty()) {
return QJsonValue(s); return QJsonValue(s);
} }
break; break;
} }
return QJsonValue(Null); return QJsonValue(Null);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: swap // Name: swap
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonValue::swap(QJsonValue &other) { void QJsonValue::swap(QJsonValue &other) {
qSwap(type_, other.type_); qSwap(type_, other.type_);
qSwap(value_, other.value_); qSwap(value_, other.value_);
} }
#endif #endif

View File

@ -1,120 +1,120 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_VALUE_H_ #ifndef QJSON_VALUE_H_
#define QJSON_VALUE_H_ #define QJSON_VALUE_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonValue> #include <QtCore/QJsonValue>
#else #else
class QString; class QString;
#include <QtCore/QVariant> #include <QtCore/QVariant>
class QJsonRoot; class QJsonRoot;
class QJsonArray; class QJsonArray;
class QJsonObject; class QJsonObject;
class QJsonValue { class QJsonValue {
public: public:
enum Type { enum Type {
Null = 0x0, Null = 0x0,
Bool = 0x1, Bool = 0x1,
Double = 0x2, Double = 0x2,
String = 0x3, String = 0x3,
Array = 0x4, Array = 0x4,
Object = 0x5, Object = 0x5,
Undefined = 0x80 Undefined = 0x80
}; };
public: public:
QJsonValue(Type type = Null); QJsonValue(Type type = Null);
QJsonValue(bool b); QJsonValue(bool b);
QJsonValue(double n); QJsonValue(double n);
QJsonValue(int n); QJsonValue(int n);
QJsonValue(qint64 n); QJsonValue(qint64 n);
QJsonValue(const QString &s); QJsonValue(const QString &s);
QJsonValue(QLatin1String s); QJsonValue(QLatin1String s);
#ifndef QT_NO_CAST_FROM_ASCII #ifndef QT_NO_CAST_FROM_ASCII
QJsonValue(const char *s); QJsonValue(const char *s);
#endif #endif
QJsonValue(const QJsonArray &a); QJsonValue(const QJsonArray &a);
QJsonValue(const QJsonObject &o); QJsonValue(const QJsonObject &o);
QJsonValue(const QJsonValue &other); QJsonValue(const QJsonValue &other);
~QJsonValue(); ~QJsonValue();
private: private:
// to protect against incorrect usage due to passing a const char * // to protect against incorrect usage due to passing a const char *
QJsonValue(const void *); QJsonValue(const void *);
public: public:
QJsonValue &operator=(const QJsonValue &other); QJsonValue &operator=(const QJsonValue &other);
public: public:
bool operator!=(const QJsonValue &other) const; bool operator!=(const QJsonValue &other) const;
bool operator==(const QJsonValue &other) const; bool operator==(const QJsonValue &other) const;
public: public:
bool isArray() const; bool isArray() const;
bool isBool() const; bool isBool() const;
bool isDouble() const; bool isDouble() const;
bool isNull() const; bool isNull() const;
bool isObject() const; bool isObject() const;
bool isString() const; bool isString() const;
bool isUndefined() const; bool isUndefined() const;
public: public:
QJsonArray toArray(const QJsonArray &defaultValue) const; QJsonArray toArray(const QJsonArray &defaultValue) const;
QJsonArray toArray() const; QJsonArray toArray() const;
bool toBool(bool defaultValue = false) const; bool toBool(bool defaultValue = false) const;
double toDouble(double defaultValue = 0) const; double toDouble(double defaultValue = 0) const;
int toInt(int defaultValue = 0) const; int toInt(int defaultValue = 0) const;
QJsonObject toObject(const QJsonObject &defaultValue) const; QJsonObject toObject(const QJsonObject &defaultValue) const;
QJsonObject toObject() const; QJsonObject toObject() const;
QString toString(const QString &defaultValue = QString()) const; QString toString(const QString &defaultValue = QString()) const;
QVariant toVariant() const; QVariant toVariant() const;
public: public:
Type type() const; Type type() const;
public: public:
static QJsonValue fromVariant(const QVariant &variant); static QJsonValue fromVariant(const QVariant &variant);
private: private:
void swap(QJsonValue &other); void swap(QJsonValue &other);
private: private:
Type type_; Type type_;
union ValueType { union ValueType {
bool b; bool b;
double n; double n;
QString *s; QString *s;
QJsonRoot *r; // OJsonObject or QJsonArray QJsonRoot *r; // OJsonObject or QJsonArray
}; };
ValueType value_; ValueType value_;
}; };
#endif #endif
#endif #endif

View File

@ -1 +1 @@
#include "QJsonValueRef.h" #include "QJsonValueRef.h"

View File

@ -1,228 +1,228 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#include "QJsonValueRef.h" #include "QJsonValueRef.h"
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
#include "QJsonArray.h" #include "QJsonArray.h"
#include "QJsonObject.h" #include "QJsonObject.h"
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef::QJsonValueRef(QJsonArray *array, int idx) : p_(array), index_(idx) { QJsonValueRef::QJsonValueRef(QJsonArray *array, int idx) : p_(array), index_(idx) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef::QJsonValueRef(QJsonObject *object, const QString &key) : p_(object), index_(0), key_(key) { QJsonValueRef::QJsonValueRef(QJsonObject *object, const QString &key) : p_(object), index_(0), key_(key) {
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef::operator QJsonValue() const { QJsonValueRef::operator QJsonValue() const {
return toValue(); return toValue();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef &QJsonValueRef::operator=(const QJsonValue &val) { QJsonValueRef &QJsonValueRef::operator=(const QJsonValue &val) {
if(QJsonObject *const o = p_->toObject()) { if(QJsonObject *const o = p_->toObject()) {
o->values_[key_] = val; o->values_[key_] = val;
} else if(QJsonArray *const a = p_->toArray()) { } else if(QJsonArray *const a = p_->toArray()) {
a->values_[index_] = val; a->values_[index_] = val;
} }
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: // Name:
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValueRef &QJsonValueRef::operator=(const QJsonValueRef &ref) { QJsonValueRef &QJsonValueRef::operator=(const QJsonValueRef &ref) {
if(QJsonObject *const o = p_->toObject()) { if(QJsonObject *const o = p_->toObject()) {
o->values_[key_] = ref; o->values_[key_] = ref;
} else if(QJsonArray *const a = p_->toArray()) { } else if(QJsonArray *const a = p_->toArray()) {
a->values_[index_] = ref; a->values_[index_] = ref;
} }
return *this; return *this;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: type // Name: type
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue::Type QJsonValueRef::type() const { QJsonValue::Type QJsonValueRef::type() const {
return toValue().type(); return toValue().type();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isNull // Name: isNull
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isNull() const { bool QJsonValueRef::isNull() const {
return toValue().isNull(); return toValue().isNull();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isBool // Name: isBool
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isBool() const { bool QJsonValueRef::isBool() const {
return toValue().isBool(); return toValue().isBool();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isDouble // Name: isDouble
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isDouble() const { bool QJsonValueRef::isDouble() const {
return toValue().isDouble(); return toValue().isDouble();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isString // Name: isString
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isString() const { bool QJsonValueRef::isString() const {
return toValue().isString(); return toValue().isString();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isArray // Name: isArray
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isArray() const { bool QJsonValueRef::isArray() const {
return toValue().isArray(); return toValue().isArray();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isObject // Name: isObject
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isObject() const { bool QJsonValueRef::isObject() const {
return toValue().isObject(); return toValue().isObject();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: isUndefined // Name: isUndefined
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::isUndefined() const { bool QJsonValueRef::isUndefined() const {
return toValue().isUndefined(); return toValue().isUndefined();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toBool // Name: toBool
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::toBool() const { bool QJsonValueRef::toBool() const {
return toValue().toBool(); return toValue().toBool();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toDouble // Name: toDouble
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
double QJsonValueRef::toDouble() const { double QJsonValueRef::toDouble() const {
return toValue().toDouble(); return toValue().toDouble();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toInt // Name: toInt
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
int QJsonValueRef::toInt(int defaultValue) const { int QJsonValueRef::toInt(int defaultValue) const {
return toValue().toInt(defaultValue); return toValue().toInt(defaultValue);
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toString // Name: toString
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QString QJsonValueRef::toString() const { QString QJsonValueRef::toString() const {
return toValue().toString(); return toValue().toString();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toArray // Name: toArray
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonArray QJsonValueRef::toArray() const { QJsonArray QJsonValueRef::toArray() const {
return toValue().toArray(); return toValue().toArray();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toObject // Name: toObject
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonObject QJsonValueRef::toObject() const { QJsonObject QJsonValueRef::toObject() const {
return toValue().toObject(); return toValue().toObject();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator== // Name: operator==
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::operator==(const QJsonValue &other) const { bool QJsonValueRef::operator==(const QJsonValue &other) const {
return toValue() == other; return toValue() == other;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: operator!= // Name: operator!=
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
bool QJsonValueRef::operator!=(const QJsonValue &other) const { bool QJsonValueRef::operator!=(const QJsonValue &other) const {
return toValue() != other; return toValue() != other;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: toValue // Name: toValue
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
QJsonValue QJsonValueRef::toValue() const { QJsonValue QJsonValueRef::toValue() const {
if(QJsonObject *const o = p_->toObject()) { if(QJsonObject *const o = p_->toObject()) {
return o->values_[key_]; return o->values_[key_];
} else if(QJsonArray *const a = p_->toArray()) { } else if(QJsonArray *const a = p_->toArray()) {
return a->values_[index_]; return a->values_[index_];
} }
return QJsonValue(); return QJsonValue();
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Name: swap // Name: swap
// Desc: // Desc:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
void QJsonValueRef::swap(QJsonValueRef &other) { void QJsonValueRef::swap(QJsonValueRef &other) {
qSwap(p_, other.p_); qSwap(p_, other.p_);
qSwap(key_, other.key_); qSwap(key_, other.key_);
qSwap(index_, other.index_); qSwap(index_, other.index_);
} }
#endif #endif

View File

@ -1,79 +1,79 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/ *****************************************************************************/
#ifndef QJSON_VALUEREF_H_ #ifndef QJSON_VALUEREF_H_
#define QJSON_VALUEREF_H_ #define QJSON_VALUEREF_H_
#include <QtCore/QtGlobal> #include <QtCore/QtGlobal>
#if QT_VERSION >= 0x050000 #if QT_VERSION >= 0x050000
#include <QtCore/QJsonValueRef> #include <QtCore/QJsonValueRef>
#else #else
#include "QJsonValue.h" #include "QJsonValue.h"
class QJsonRoot; class QJsonRoot;
class QJsonValueRef { class QJsonValueRef {
public: public:
QJsonValueRef(QJsonArray *array, int idx); QJsonValueRef(QJsonArray *array, int idx);
// slight variant from official APIs implementation // slight variant from official APIs implementation
QJsonValueRef(QJsonObject *object, const QString &key); QJsonValueRef(QJsonObject *object, const QString &key);
public: public:
operator QJsonValue() const; operator QJsonValue() const;
public: public:
QJsonValueRef &operator=(const QJsonValue &val); QJsonValueRef &operator=(const QJsonValue &val);
QJsonValueRef &operator=(const QJsonValueRef &val); QJsonValueRef &operator=(const QJsonValueRef &val);
public: public:
QJsonValue::Type type() const; QJsonValue::Type type() const;
bool isNull() const; bool isNull() const;
bool isBool() const; bool isBool() const;
bool isDouble() const; bool isDouble() const;
bool isString() const; bool isString() const;
bool isArray() const; bool isArray() const;
bool isObject() const; bool isObject() const;
bool isUndefined() const; bool isUndefined() const;
public: public:
bool toBool() const; bool toBool() const;
double toDouble() const; double toDouble() const;
QString toString() const; QString toString() const;
QJsonArray toArray() const; QJsonArray toArray() const;
QJsonObject toObject() const; QJsonObject toObject() const;
int toInt(int defaultValue = 0) const; int toInt(int defaultValue = 0) const;
public: public:
bool operator==(const QJsonValue &other) const; bool operator==(const QJsonValue &other) const;
bool operator!=(const QJsonValue &other) const; bool operator!=(const QJsonValue &other) const;
private: private:
QJsonValue toValue() const; QJsonValue toValue() const;
void swap(QJsonValueRef &other); void swap(QJsonValueRef &other);
private: private:
QJsonRoot *p_; QJsonRoot *p_;
int index_; int index_;
QString key_; QString key_;
}; };
#endif #endif
#endif #endif

View File

@ -7,8 +7,8 @@ CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "gta5view.exe.manifest"
#include <windows.h> #include <windows.h>
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 1, 3, 3, 0 FILEVERSION 1, 4, 0, 0
PRODUCTVERSION 1, 3, 3, 0 PRODUCTVERSION 1, 4, 0, 0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
FILEFLAGS 0 FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32 FILEOS VOS_NT_WINDOWS32
@ -25,12 +25,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Syping" VALUE "CompanyName", "Syping"
VALUE "FileDescription", "gta5view\0" VALUE "FileDescription", "gta5view\0"
VALUE "FileVersion", "1.3.3\0" VALUE "FileVersion", "1.4.0-dev1\0"
VALUE "InternalName", "gta5view\0" VALUE "InternalName", "gta5view\0"
VALUE "LegalCopyright", "Copyright © 2016-2017 Syping\0" VALUE "LegalCopyright", "Copyright © 2016-2017 Syping\0"
VALUE "OriginalFilename", "gta5view.exe\0" VALUE "OriginalFilename", "gta5view.exe\0"
VALUE "ProductName", "gta5view\0" VALUE "ProductName", "gta5view\0"
VALUE "ProductVersion", "1.3.3\0" VALUE "ProductVersion", "1.4.0-dev1\0"
END END
END END
END END

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -1,102 +1,102 @@
[Global] [Global]
AIRP="Internationaler Flughafen von LS" AIRP="Internationaler Flughafen von LS"
ALAMO="Alamosee" ALAMO="Alamosee"
ALTA="Alta" ALTA="Alta"
ARMYB="Fort Zancudo" ARMYB="Fort Zancudo"
BANNING="Banning" BANNING="Banning"
BAYTRE="Baytree Canyon" BAYTRE="Baytree Canyon"
BEACH="Vespucci Beach" BEACH="Vespucci Beach"
BHAMCA="Banham Canyon" BHAMCA="Banham Canyon"
BRADP="Braddock-Pass" BRADP="Braddock-Pass"
BRADT="Braddock-Tunnel" BRADT="Braddock-Tunnel"
BURTON="Burton" BURTON="Burton"
CALAFB="Calafia-Brücke" CALAFB="Calafia-Brücke"
CANNY="Raton Canyon" CANNY="Raton Canyon"
CCREAK="Cassidy Creek" CCREAK="Cassidy Creek"
CHAMH="Chamberlain Hills" CHAMH="Chamberlain Hills"
CHIL="Vinewood Hills" CHIL="Vinewood Hills"
CHU="Chumash" CHU="Chumash"
CMSW="Chiliad-Mountain-Naturschutzgebiet" CMSW="Chiliad-Mountain-Naturschutzgebiet"
COSI="Vorstädte" COSI="Vorstädte"
CYPRE="Cypress Flats" CYPRE="Cypress Flats"
DAVIS="Davis" DAVIS="Davis"
DELBE="Del Perro Beach" DELBE="Del Perro Beach"
DELPE="Del Perro" DELPE="Del Perro"
DELSOL="La Puerta" DELSOL="La Puerta"
DESRT="Grand-Senora-Wüste" DESRT="Grand-Senora-Wüste"
DOWNT="Innenstadt" DOWNT="Innenstadt"
DTVINE="Vinewood Mitte" DTVINE="Vinewood Mitte"
EAST_V="East Vinewood" EAST_V="East Vinewood"
EBURO="El Burro Heights" EBURO="El Burro Heights"
ECLIPS="Eclipse" ECLIPS="Eclipse"
ELGORL="Leuchtturm El Gordo" ELGORL="Leuchtturm El Gordo"
ELSANT="East Los Santos" ELSANT="East Los Santos"
ELYSIAN="Elysian Island" ELYSIAN="Elysian Island"
GALFISH="Galilee" GALFISH="Galilee"
GALLI="Galileo-Park" GALLI="Galileo-Park"
GOLF="GWC und Golfclub" GOLF="GWC und Golfclub"
GRAPES="Grapeseed" GRAPES="Grapeseed"
GREATC="Great Chaparral" GREATC="Great Chaparral"
HARMO="Harmony" HARMO="Harmony"
HAWICK="Hawick" HAWICK="Hawick"
HEART="Heart Attacks Beach" HEART="Heart Attacks Beach"
HORS="Vinewood-Rennbahn" HORS="Vinewood-Rennbahn"
HUD_MG_TRI_ALA="Alamosee" HUD_MG_TRI_ALA="Alamosee"
HUD_MG_TRI_VES="Vespucci" HUD_MG_TRI_VES="Vespucci"
HUMLAB="Humane Labs and Research" HUMLAB="Humane Labs and Research"
JAIL="Bolingbroke-Strafanstalt" JAIL="Bolingbroke-Strafanstalt"
KOREAT="Little Seoul" KOREAT="Little Seoul"
LACT="Land-Act-Stausee" LACT="Land-Act-Stausee"
LAGO="Lago Zancudo" LAGO="Lago Zancudo"
LDAM="Land-Act-Staudamm" LDAM="Land-Act-Staudamm"
LMESA="La Mesa" LMESA="La Mesa"
LOSPUER="La Puerta" LOSPUER="La Puerta"
LOSSF="Los Santos Freeway" LOSSF="Los Santos Freeway"
MGCR_1="South Los Santos" MGCR_1="South Los Santos"
MGSR_3="Raton Canyon" MGSR_3="Raton Canyon"
MIRR="Mirror Park" MIRR="Mirror Park"
MORN="Morningwood" MORN="Morningwood"
MOVIE="Richards Majestic" MOVIE="Richards Majestic"
MTCHIL="Mount Chiliad" MTCHIL="Mount Chiliad"
MTGORDO="Mount Gordo" MTGORDO="Mount Gordo"
MTJOSE="Mount Josiah" MTJOSE="Mount Josiah"
MURRI="Murrieta Heights" MURRI="Murrieta Heights"
NCHU="North Chumash" NCHU="North Chumash"
OBSERV="Galileo-Observatorium" OBSERV="Galileo-Observatorium"
OCEANA="Pazifik" OCEANA="Pazifik"
PALCOV="Paleto Cove" PALCOV="Paleto Cove"
PALETO="Paleto Bay" PALETO="Paleto Bay"
PALFOR="Paleto Forest" PALFOR="Paleto Forest"
PALHIGH="Palomino-Hochland" PALHIGH="Palomino-Hochland"
PALMPOW="Palmer-Taylor-Elektrizitätswerk" PALMPOW="Palmer-Taylor-Elektrizitätswerk"
PBLUFF="Pacific Bluffs" PBLUFF="Pacific Bluffs"
PBOX="Pillbox Hill" PBOX="Pillbox Hill"
PROCOB="Procopio Beach" PROCOB="Procopio Beach"
PROL="North Yankton" PROL="North Yankton"
RANCHO="Rancho" RANCHO="Rancho"
RGLEN="Richman Glen" RGLEN="Richman Glen"
RICHM="Richman" RICHM="Richman"
ROCKF="Rockford Hills" ROCKF="Rockford Hills"
RTRAK="Redwood-Lights-Rennstrecke" RTRAK="Redwood-Lights-Rennstrecke"
SANAND="San Andreas" SANAND="San Andreas"
SANCHIA="San-Chianski-Bergkette" SANCHIA="San-Chianski-Bergkette"
SANDY="Sandy Shores" SANDY="Sandy Shores"
SKID="Mission Row" SKID="Mission Row"
SLAB="Stab City" SLAB="Stab City"
SLSANT="South Los Santos" SLSANT="South Los Santos"
STAD="Maze Bank Arena" STAD="Maze Bank Arena"
STRAW="Strawberry" STRAW="Strawberry"
TATAMO="Tataviam-Bergkette" TATAMO="Tataviam-Bergkette"
TERMINA="Terminal" TERMINA="Terminal"
TEXTI="Textilbezirk" TEXTI="Textilbezirk"
TONGVAH="Tongva Hills" TONGVAH="Tongva Hills"
TONGVAV="Tongva Valley" TONGVAV="Tongva Valley"
UTOPIAG="Utopia Gardens" UTOPIAG="Utopia Gardens"
VCANA="Vespucci-Kanäle" VCANA="Vespucci-Kanäle"
VESP="Vespucci" VESP="Vespucci"
VINE="Vinewood" VINE="Vinewood"
WINDF="Ron-Alternates-Windpark" WINDF="Ron-Alternates-Windpark"
WMIRROR="West Mirror Drive" WMIRROR="West Mirror Drive"
WVINE="Vinewood West" WVINE="Vinewood West"
ZANCUDO="Zancudo River" ZANCUDO="Zancudo River"
ZENORA="Senora Freeway" ZENORA="Senora Freeway"

View File

@ -1,103 +1,103 @@
[Global] [Global]
AIRP="Los Santos International Airport" AIRP="Los Santos International Airport"
ALAMO="Alamo Sea" ALAMO="Alamo Sea"
ALTA="Alta" ALTA="Alta"
ARMYB="Fort Zancudo" ARMYB="Fort Zancudo"
BANNING="Banning" BANNING="Banning"
BAYTRE="Baytree Canyon" BAYTRE="Baytree Canyon"
BEACH="Vespucci Beach" BEACH="Vespucci Beach"
BHAMCA="Banham Canyon" BHAMCA="Banham Canyon"
BRADP="Braddock Pass" BRADP="Braddock Pass"
BRADT="Braddock Tunnel" BRADT="Braddock Tunnel"
BURTON="Burton" BURTON="Burton"
CALAFB="Calafia Bridge" CALAFB="Calafia Bridge"
CANNY="Raton Canyon" CANNY="Raton Canyon"
CCREAK="Cassidy Creek" CCREAK="Cassidy Creek"
CHAMH="Chamberlain Hills" CHAMH="Chamberlain Hills"
CHIL="Vinewood Hills" CHIL="Vinewood Hills"
CHU="Chumash" CHU="Chumash"
CMSW="Chiliad Mountain State Wilderness" CMSW="Chiliad Mountain State Wilderness"
COSI="Countryside" COSI="Countryside"
CYPRE="Cypress Flats" CYPRE="Cypress Flats"
DAVIS="Davis" DAVIS="Davis"
DELBE="Del Perro Beach" DELBE="Del Perro Beach"
DELPE="Del Perro" DELPE="Del Perro"
DELSOL="La Puerta" DELSOL="La Puerta"
DESRT="Grand Senora Desert" DESRT="Grand Senora Desert"
DOWNT="Downtown" DOWNT="Downtown"
DTVINE="Downtown Vinewood" DTVINE="Downtown Vinewood"
EAST_V="East Vinewood" EAST_V="East Vinewood"
EBURO="El Burro Heights" EBURO="El Burro Heights"
ECLIPS="Eclipse" ECLIPS="Eclipse"
ELGORL="El Gordo Lighthouse" ELGORL="El Gordo Lighthouse"
ELSANT="East Los Santos" ELSANT="East Los Santos"
ELYSIAN="Elysian Island" ELYSIAN="Elysian Island"
GALFISH="Galilee" GALFISH="Galilee"
GALLI="Galileo Park" GALLI="Galileo Park"
GOLF="GWC and Golfing Society" GOLF="GWC and Golfing Society"
GRAPES="Grapeseed" GRAPES="Grapeseed"
GREATC="Great Chaparral" GREATC="Great Chaparral"
HARMO="Harmony" HARMO="Harmony"
HAWICK="Hawick" HAWICK="Hawick"
HEART="Heart Attacks Beach" HEART="Heart Attacks Beach"
HORS="Vinewood Racetrack" HORS="Vinewood Racetrack"
HUD_MG_TRI_ALA="Alamo Sea" HUD_MG_TRI_ALA="Alamo Sea"
HUD_MG_TRI_VES="Vespucci" HUD_MG_TRI_VES="Vespucci"
HUMLAB="Humane Labs and Research" HUMLAB="Humane Labs and Research"
JAIL="Bolingbroke Penitentiary" JAIL="Bolingbroke Penitentiary"
KOREAT="Little Seoul" KOREAT="Little Seoul"
LACT="Land Act Reservoir" LACT="Land Act Reservoir"
LAGO="Lago Zancudo" LAGO="Lago Zancudo"
LDAM="Land Act Dam" LDAM="Land Act Dam"
LMESA="La Mesa" LMESA="La Mesa"
LOSPUER="La Puerta" LOSPUER="La Puerta"
LOSSF="Los Santos Freeway" LOSSF="Los Santos Freeway"
MGCR_1="South Los Santos" MGCR_1="South Los Santos"
MGCR_6="Vespucci Canals" MGCR_6="Vespucci Canals"
MGSR_3="Raton Canyon" MGSR_3="Raton Canyon"
MIRR="Mirror Park" MIRR="Mirror Park"
MORN="Morningwood" MORN="Morningwood"
MOVIE="Richards Majestic" MOVIE="Richards Majestic"
MTCHIL="Mount Chiliad" MTCHIL="Mount Chiliad"
MTGORDO="Mount Gordo" MTGORDO="Mount Gordo"
MTJOSE="Mount Josiah" MTJOSE="Mount Josiah"
MURRI="Murrieta Heights" MURRI="Murrieta Heights"
NCHU="North Chumash" NCHU="North Chumash"
OBSERV="Galileo Observatory" OBSERV="Galileo Observatory"
OCEANA="Pacific Ocean" OCEANA="Pacific Ocean"
PALCOV="Paleto Cove" PALCOV="Paleto Cove"
PALETO="Paleto Bay" PALETO="Paleto Bay"
PALFOR="Paleto Forest" PALFOR="Paleto Forest"
PALHIGH="Palomino Highlands" PALHIGH="Palomino Highlands"
PALMPOW="Palmer-Taylor Power Station" PALMPOW="Palmer-Taylor Power Station"
PBLUFF="Pacific Bluffs" PBLUFF="Pacific Bluffs"
PBOX="Pillbox Hill" PBOX="Pillbox Hill"
PROCOB="Procopio Beach" PROCOB="Procopio Beach"
PROL="North Yankton" PROL="North Yankton"
RANCHO="Rancho" RANCHO="Rancho"
RGLEN="Richman Glen" RGLEN="Richman Glen"
RICHM="Richman" RICHM="Richman"
ROCKF="Rockford Hills" ROCKF="Rockford Hills"
RTRAK="Redwood Lights Track" RTRAK="Redwood Lights Track"
SANAND="San Andreas" SANAND="San Andreas"
SANCHIA="San Chianski Mountain Range" SANCHIA="San Chianski Mountain Range"
SANDY="Sandy Shores" SANDY="Sandy Shores"
SKID="Mission Row" SKID="Mission Row"
SLAB="Stab City" SLAB="Stab City"
SLSANT="South Los Santos" SLSANT="South Los Santos"
STAD="Maze Bank Arena" STAD="Maze Bank Arena"
STRAW="Strawberry" STRAW="Strawberry"
TATAMO="Tataviam Mountains" TATAMO="Tataviam Mountains"
TERMINA="Terminal" TERMINA="Terminal"
TEXTI="Textile City" TEXTI="Textile City"
TONGVAH="Tongva Hills" TONGVAH="Tongva Hills"
TONGVAV="Tongva Valley" TONGVAV="Tongva Valley"
UTOPIAG="Utopia Gardens" UTOPIAG="Utopia Gardens"
VCANA="Vespucci Canals" VCANA="Vespucci Canals"
VESP="Vespucci" VESP="Vespucci"
VINE="Vinewood" VINE="Vinewood"
WINDF="Ron Alternates Wind Farm" WINDF="Ron Alternates Wind Farm"
WMIRROR="West Mirror Drive" WMIRROR="West Mirror Drive"
WVINE="West Vinewood" WVINE="West Vinewood"
ZANCUDO="Zancudo River" ZANCUDO="Zancudo River"
ZENORA="Senora Freeway" ZENORA="Senora Freeway"

View File

@ -1,107 +1,107 @@
[Global] [Global]
AIRP="Aeropuerto Intl. de Los Santos" AIRP="Aeropuerto Intl. de Los Santos"
ALAMO="Alamo Sea" ALAMO="Alamo Sea"
ALTA="Alta" ALTA="Alta"
ARMYB="Fort Zancudo" ARMYB="Fort Zancudo"
BANNING="Banning" BANNING="Banning"
BAYTRE="Baytree Canyon" BAYTRE="Baytree Canyon"
BEACH="Vespucci Beach" BEACH="Vespucci Beach"
BHAMCA="Banham Canyon" BHAMCA="Banham Canyon"
BRADP="Braddock Pass" BRADP="Braddock Pass"
BRADT="Túnel de Braddock" BRADT="Túnel de Braddock"
BURTON="Burton" BURTON="Burton"
CALAFB="Puente de Calafia" CALAFB="Puente de Calafia"
CANNY="Raton Canyon" CANNY="Raton Canyon"
CCREAK="Cassidy Creek" CCREAK="Cassidy Creek"
CHAMH="Chamberlain Hills" CHAMH="Chamberlain Hills"
CHIL="Vinewood Hills" CHIL="Vinewood Hills"
CHU="Chumash" CHU="Chumash"
CMSW="Parque natural del monte Chiliad" CMSW="Parque natural del monte Chiliad"
COSI="Zona rural" COSI="Zona rural"
CYPRE="Cypress Flats" CYPRE="Cypress Flats"
DAVIS="Davis" DAVIS="Davis"
DELBE="Del Perro Beach" DELBE="Del Perro Beach"
DELPE="Del Perro" DELPE="Del Perro"
DELSOL="La Puerta" DELSOL="La Puerta"
DESRT="Desierto de Grand Señora" DESRT="Desierto de Grand Señora"
DOWNT="Centro" DOWNT="Centro"
DTVINE="Centro de Vinewood" DTVINE="Centro de Vinewood"
EAST_V="Vinewood Este" EAST_V="Vinewood Este"
EBURO="El Burro Heights" EBURO="El Burro Heights"
ECLIPS="Eclipse" ECLIPS="Eclipse"
ELGORL="Faro de El Gordo" ELGORL="Faro de El Gordo"
ELSANT="Los Santos Este" ELSANT="Los Santos Este"
ELYSIAN="Elysian Island" ELYSIAN="Elysian Island"
GALFISH="Galilee" GALFISH="Galilee"
GALLI="Galileo Park" GALLI="Galileo Park"
GOLF="Club de campo y de golf GW" GOLF="Club de campo y de golf GW"
GRAPES="Grapeseed" GRAPES="Grapeseed"
GREATC="Great Chaparral" GREATC="Great Chaparral"
HARMO="Harmony" HARMO="Harmony"
HAWICK="Hawick" HAWICK="Hawick"
HEART="Heart Attacks Beach" HEART="Heart Attacks Beach"
HORS="Circuito de Vinewood" HORS="Circuito de Vinewood"
HUD_MG_TRI_ALA="Alamo Sea" HUD_MG_TRI_ALA="Alamo Sea"
HUD_MG_TRI_VES="Vespucci" HUD_MG_TRI_VES="Vespucci"
HUMLAB="Laboratorios Humane" HUMLAB="Laboratorios Humane"
JAIL="Penitenciaría de Bolingbroke" JAIL="Penitenciaría de Bolingbroke"
KOREAT="Little Seoul" KOREAT="Little Seoul"
LACT="Embalse de Land Act" LACT="Embalse de Land Act"
LAGO="Lago Zancudo" LAGO="Lago Zancudo"
LDAM="Presa de Land Act" LDAM="Presa de Land Act"
LMESA="La Mesa" LMESA="La Mesa"
LOSPFY="Autopista de La Puerta" LOSPFY="Autopista de La Puerta"
LOSPUER="La Puerta" LOSPUER="La Puerta"
LOSSF="Autopista de Los Santos" LOSSF="Autopista de Los Santos"
MGCR_1="Los Santos Sur" MGCR_1="Los Santos Sur"
MGCR_6="Canales de Vespucci" MGCR_6="Canales de Vespucci"
MGSR_3="Raton Canyon" MGSR_3="Raton Canyon"
MIRR="Mirror Park" MIRR="Mirror Park"
MORN="Morningwood" MORN="Morningwood"
MOVIE="Richards Majestic" MOVIE="Richards Majestic"
MO_CS_HIGH="Alta" MO_CS_HIGH="Alta"
MO_HIGH="Alta" MO_HIGH="Alta"
MTCHIL="Monte Chiliad" MTCHIL="Monte Chiliad"
MTGORDO="Monte Gordo" MTGORDO="Monte Gordo"
MTJOSE="Monte Josiah" MTJOSE="Monte Josiah"
MURRI="Murrieta Heights" MURRI="Murrieta Heights"
NCHU="Chumash Norte" NCHU="Chumash Norte"
OBSERV="Observatorio Galileo" OBSERV="Observatorio Galileo"
OCEANA="Océano Pacífico" OCEANA="Océano Pacífico"
PALCOV="Paleto Cove" PALCOV="Paleto Cove"
PALETO="Paleto Bay" PALETO="Paleto Bay"
PALFOR="Bosque de Paleto" PALFOR="Bosque de Paleto"
PALHIGH="Palomino Highlands" PALHIGH="Palomino Highlands"
PALMPOW="Central eléctrica Palmer-Taylor" PALMPOW="Central eléctrica Palmer-Taylor"
PBLUFF="Pacific Bluffs" PBLUFF="Pacific Bluffs"
PBOX="Pillbox Hill" PBOX="Pillbox Hill"
PROCOB="Procopio Beach" PROCOB="Procopio Beach"
PROL="North Yankton" PROL="North Yankton"
RANCHO="Rancho" RANCHO="Rancho"
RGLEN="Richman Glen" RGLEN="Richman Glen"
RICHM="Richman" RICHM="Richman"
ROCKF="Rockford Hills" ROCKF="Rockford Hills"
RTRAK="Circuito Redwood Lights" RTRAK="Circuito Redwood Lights"
SANAND="San Andreas" SANAND="San Andreas"
SANCHIA="Cordillera San Chianski" SANCHIA="Cordillera San Chianski"
SANDY="Sandy Shores" SANDY="Sandy Shores"
SENORA="Autopista de Señora" SENORA="Autopista de Señora"
SKID="Mission Row" SKID="Mission Row"
SLAB="Stab City" SLAB="Stab City"
SLSANT="Los Santos Sur" SLSANT="Los Santos Sur"
STAD="Maze Bank Arena" STAD="Maze Bank Arena"
STRAW="Strawberry" STRAW="Strawberry"
TATAMO="Montañas Tataviam" TATAMO="Montañas Tataviam"
TERMINA="Terminal" TERMINA="Terminal"
TEXTI="Textile City" TEXTI="Textile City"
TONGVAH="Colinas de Tongva" TONGVAH="Colinas de Tongva"
TONGVAV="Valle de Tongva" TONGVAV="Valle de Tongva"
UTOPIAG="Utopia Gardens" UTOPIAG="Utopia Gardens"
VCANA="Canales de Vespucci" VCANA="Canales de Vespucci"
VESP="Vespucci" VESP="Vespucci"
VINE="Vinewood" VINE="Vinewood"
WINDF="Granja eólica de Ron Alternates" WINDF="Granja eólica de Ron Alternates"
WMIRROR="West Mirror Drive" WMIRROR="West Mirror Drive"
WVINE="Vinewood Oeste" WVINE="Vinewood Oeste"
ZANCUDO="Río Zancudo" ZANCUDO="Río Zancudo"
ZENORA="Autopista de Señora" ZENORA="Autopista de Señora"

View File

@ -1,103 +1,103 @@
[Global] [Global]
AIRP="Aéroport international de LS" AIRP="Aéroport international de LS"
ALAMO="Alamo Sea" ALAMO="Alamo Sea"
ALTA="Alta" ALTA="Alta"
ARMYB="Fort Zancudo" ARMYB="Fort Zancudo"
BANNING="Banning" BANNING="Banning"
BAYTRE="Baytree Canyon" BAYTRE="Baytree Canyon"
BEACH="Vespucci Beach" BEACH="Vespucci Beach"
BHAMCA="Banham Canyon" BHAMCA="Banham Canyon"
BRADP="Braddock Pass" BRADP="Braddock Pass"
BRADT="Braddock Tunnel" BRADT="Braddock Tunnel"
BURTON="Burton" BURTON="Burton"
CALAFB="Calafia Bridge" CALAFB="Calafia Bridge"
CANNY="Raton Canyon" CANNY="Raton Canyon"
CCREAK="Cassidy Creek" CCREAK="Cassidy Creek"
CHAMH="Chamberlain Hills" CHAMH="Chamberlain Hills"
CHIL="Vinewood Hills" CHIL="Vinewood Hills"
CHU="Chumash" CHU="Chumash"
CMSW="Parc national du Mont Chiliad" CMSW="Parc national du Mont Chiliad"
CYPRE="Cypress Flats" CYPRE="Cypress Flats"
DAVIS="Davis" DAVIS="Davis"
DELBE="Del Perro Beach" DELBE="Del Perro Beach"
DELPE="Del Perro" DELPE="Del Perro"
DELSOL="La Puerta" DELSOL="La Puerta"
DESRT="Grand Señora Desert" DESRT="Grand Señora Desert"
DOWNT="Centre-ville" DOWNT="Centre-ville"
DTVINE="Centre de Vinewood" DTVINE="Centre de Vinewood"
EAST_V="Vinewood East" EAST_V="Vinewood East"
EBURO="El Burro Heights" EBURO="El Burro Heights"
ECLIPS="Eclipse" ECLIPS="Eclipse"
ELGORL="Phare d'El Gordo" ELGORL="Phare d'El Gordo"
ELSANT="East Los Santos" ELSANT="East Los Santos"
ELYSIAN="Elysian Island" ELYSIAN="Elysian Island"
GALFISH="Galilee" GALFISH="Galilee"
GALLI="Galileo Park" GALLI="Galileo Park"
GOLF="Club de golf et de détente du Grand Ouest" GOLF="Club de golf et de détente du Grand Ouest"
GRAPES="Grapeseed" GRAPES="Grapeseed"
GREATC="Great Chaparral" GREATC="Great Chaparral"
HARMO="Harmony" HARMO="Harmony"
HAWICK="Hawick" HAWICK="Hawick"
HEART="Heart Attacks Beach" HEART="Heart Attacks Beach"
HORS="Hippodrome de Vinewood" HORS="Hippodrome de Vinewood"
HUD_MG_TRI_ALA="Alamo Sea" HUD_MG_TRI_ALA="Alamo Sea"
HUD_MG_TRI_VES="Vespucci" HUD_MG_TRI_VES="Vespucci"
HUMLAB="Laboratoires Humane" HUMLAB="Laboratoires Humane"
JAIL="Pénitencier de Bolingbroke" JAIL="Pénitencier de Bolingbroke"
KOREAT="Little Seoul" KOREAT="Little Seoul"
LACT="Land Act Reservoir" LACT="Land Act Reservoir"
LAGO="Lago Zancudo" LAGO="Lago Zancudo"
LDAM="Land Act Dam" LDAM="Land Act Dam"
LMESA="La Mesa" LMESA="La Mesa"
LOSPFY="La Puerta Freeway" LOSPFY="La Puerta Freeway"
LOSPUER="La Puerta" LOSPUER="La Puerta"
LOSSF="Los Santos Freeway" LOSSF="Los Santos Freeway"
MGCR_1="South Los Santos" MGCR_1="South Los Santos"
MGCR_6="Canaux de Vespucci" MGCR_6="Canaux de Vespucci"
MGSR_3="Raton Canyon" MGSR_3="Raton Canyon"
MIRR="Mirror Park" MIRR="Mirror Park"
MORN="Morningwood" MORN="Morningwood"
MOVIE="Richards Majestic" MOVIE="Richards Majestic"
MTCHIL="Mont Chiliad" MTCHIL="Mont Chiliad"
MTGORDO="Mont Gordo" MTGORDO="Mont Gordo"
MTJOSE="Mont Josiah" MTJOSE="Mont Josiah"
MURRI="Murrieta Heights" MURRI="Murrieta Heights"
NCHU="North Chumash" NCHU="North Chumash"
OBSERV="Observatoire Galileo" OBSERV="Observatoire Galileo"
OCEANA="Océan pacifique" OCEANA="Océan pacifique"
PALCOV="Paleto Cove" PALCOV="Paleto Cove"
PALETO="Paleto Bay" PALETO="Paleto Bay"
PALFOR="Paleto Forest" PALFOR="Paleto Forest"
PALHIGH="Palomino Highlands" PALHIGH="Palomino Highlands"
PALMPOW="Centrale Palmer-Taylor" PALMPOW="Centrale Palmer-Taylor"
PBLUFF="Pacific Bluffs" PBLUFF="Pacific Bluffs"
PBOX="Pillbox Hill" PBOX="Pillbox Hill"
PROCOB="Procopio Beach" PROCOB="Procopio Beach"
PROL="North Yankton" PROL="North Yankton"
RANCHO="Rancho" RANCHO="Rancho"
RGLEN="Richman Glen" RGLEN="Richman Glen"
RICHM="Richman" RICHM="Richman"
ROCKF="Rockford Hills" ROCKF="Rockford Hills"
RTRAK="Circuit Redwood Lights" RTRAK="Circuit Redwood Lights"
SANAND="San Andreas" SANAND="San Andreas"
SANCHIA="Monts de San Chianski" SANCHIA="Monts de San Chianski"
SANDY="Sandy Shores" SANDY="Sandy Shores"
SKID="Mission Row" SKID="Mission Row"
SLAB="Stab City" SLAB="Stab City"
SLSANT="South Los Santos" SLSANT="South Los Santos"
STAD="Maze Bank Arena" STAD="Maze Bank Arena"
STRAW="Strawberry" STRAW="Strawberry"
TATAMO="Monts Tataviam" TATAMO="Monts Tataviam"
TERMINA="Terminal" TERMINA="Terminal"
TEXTI="Textile City" TEXTI="Textile City"
TONGVAH="Tongva Hills" TONGVAH="Tongva Hills"
TONGVAV="Tongva Valley" TONGVAV="Tongva Valley"
UTOPIAG="Utopia Gardens" UTOPIAG="Utopia Gardens"
VCANA="Canaux de Vespucci" VCANA="Canaux de Vespucci"
VESP="Vespucci" VESP="Vespucci"
VINE="Vinewood" VINE="Vinewood"
WINDF="Parc d'éoliennes Ron Alternates" WINDF="Parc d'éoliennes Ron Alternates"
WMIRROR="Mirror Drive West" WMIRROR="Mirror Drive West"
WVINE="Vinewood West" WVINE="Vinewood West"
ZANCUDO="Zancudo River" ZANCUDO="Zancudo River"
ZENORA="Señora Freeway" ZENORA="Señora Freeway"

View File

@ -1,106 +1,106 @@
[Global] [Global]
AIRP="ロスサントス国際空港" AIRP="ロスサントス国際空港"
ALAMO="アラモ海" ALAMO="アラモ海"
ALTA="アルタ" ALTA="アルタ"
ARMYB="フォート・ザンクード" ARMYB="フォート・ザンクード"
BANNING="バニング" BANNING="バニング"
BAYTRE="ベイツリー・キャニオン" BAYTRE="ベイツリー・キャニオン"
BEACH="ベスプッチ・ビーチ" BEACH="ベスプッチ・ビーチ"
BHAMCA="バンナムキャニオン" BHAMCA="バンナムキャニオン"
BRADP="ブラドック・パス" BRADP="ブラドック・パス"
BRADT="ブラドック・トンネル" BRADT="ブラドック・トンネル"
BSS_BSTR_131="リチャーズ・マジェスティック" BSS_BSTR_131="リチャーズ・マジェスティック"
BURTON="バートン" BURTON="バートン"
CALAFB="カラフィア橋" CALAFB="カラフィア橋"
CANNY="ラトン・キャニオン" CANNY="ラトン・キャニオン"
CCREAK="キャシディ・クリーク" CCREAK="キャシディ・クリーク"
CHAMH="チェンバーレイン・ヒルズ" CHAMH="チェンバーレイン・ヒルズ"
CHIL="バインウッド・ヒルズ" CHIL="バインウッド・ヒルズ"
CHU="チュマシュ" CHU="チュマシュ"
CMSW="チリアド山自然保護区" CMSW="チリアド山自然保護区"
COSI="農園地帯" COSI="農園地帯"
CYPRE="サイプレス・フラット" CYPRE="サイプレス・フラット"
DAVIS="デイビス" DAVIS="デイビス"
DELBE="デル・ペロ・ビーチ" DELBE="デル・ペロ・ビーチ"
DELPE="デル・ペロ" DELPE="デル・ペロ"
DELSOL="ラ・プエルタ" DELSOL="ラ・プエルタ"
DESRT="グランド・セノーラ砂漠" DESRT="グランド・セノーラ砂漠"
DOWNT="ダウンタウン" DOWNT="ダウンタウン"
DTVINE="ダウンタウン・バインウッド" DTVINE="ダウンタウン・バインウッド"
EAST_V="イースト・バインウッド" EAST_V="イースト・バインウッド"
EBURO="エル・ブロ・ハイツ" EBURO="エル・ブロ・ハイツ"
ECLIPS="イクリプス" ECLIPS="イクリプス"
ELGORL="エル・ゴルド灯台" ELGORL="エル・ゴルド灯台"
ELSANT="イースト・ロスサントス" ELSANT="イースト・ロスサントス"
ELYSIAN="エリシアン島" ELYSIAN="エリシアン島"
GALFISH="ガリラヤ" GALFISH="ガリラヤ"
GALLI="ガリレオ・パーク" GALLI="ガリレオ・パーク"
GOLF="GWC&ゴルフ協会" GOLF="GWC&ゴルフ協会"
GRAPES="グレイプシード" GRAPES="グレイプシード"
GREATC="グレート・チャパレル" GREATC="グレート・チャパレル"
HARMO="ハーモニー" HARMO="ハーモニー"
HAWICK="ハウィック" HAWICK="ハウィック"
HEART="ハートアタック・ビーチ" HEART="ハートアタック・ビーチ"
HORS="バインウッド・レーストラック" HORS="バインウッド・レーストラック"
HUD_MG_TRI_ALA="アラモ海" HUD_MG_TRI_ALA="アラモ海"
HUD_MG_TRI_VES="ベスプッチ" HUD_MG_TRI_VES="ベスプッチ"
HUMLAB="ヒューメイン研究所" HUMLAB="ヒューメイン研究所"
JAIL="ボーリングブローク刑務所" JAIL="ボーリングブローク刑務所"
KOREAT="リトル・ソウル" KOREAT="リトル・ソウル"
LACT="ランド・アクト貯水池" LACT="ランド・アクト貯水池"
LAGO="ラゴ・ザンクード" LAGO="ラゴ・ザンクード"
LDAM="ランド・アクト・ダム" LDAM="ランド・アクト・ダム"
LMESA="ラ・メサ" LMESA="ラ・メサ"
LOSPFY="ラ・プエルタ高速道路" LOSPFY="ラ・プエルタ高速道路"
LOSPUER="ラ・プエルタ" LOSPUER="ラ・プエルタ"
LOSSF="ロスサントス高速道路" LOSSF="ロスサントス高速道路"
MGCR_1="サウス・ロスサントス" MGCR_1="サウス・ロスサントス"
MGCR_6="ベスプッチ運河" MGCR_6="ベスプッチ運河"
MGSR_3="ラトン・キャニオン" MGSR_3="ラトン・キャニオン"
MIRR="ミラー・パーク" MIRR="ミラー・パーク"
MORN="モーニングウッド" MORN="モーニングウッド"
MOVIE="リチャーズ・マジェスティック" MOVIE="リチャーズ・マジェスティック"
MTCHIL="チリアド山" MTCHIL="チリアド山"
MTGORDO="ゴルド山" MTGORDO="ゴルド山"
MTJOSE="ジョサイア山" MTJOSE="ジョサイア山"
MURRI="ムリエタ・ハイツ" MURRI="ムリエタ・ハイツ"
NCHU="北チュマシュ" NCHU="北チュマシュ"
OBSERV="ガリレオ観測所" OBSERV="ガリレオ観測所"
OCEANA="太平洋" OCEANA="太平洋"
PALCOV="パレト・コーブ" PALCOV="パレト・コーブ"
PALETO="パレト・ベイ" PALETO="パレト・ベイ"
PALFOR="パレト・フォレスト" PALFOR="パレト・フォレスト"
PALHIGH="パロミノ高地" PALHIGH="パロミノ高地"
PALMPOW="パーマー・テイラー発電所" PALMPOW="パーマー・テイラー発電所"
PBLUFF="パシフィック・ブラフス" PBLUFF="パシフィック・ブラフス"
PBOX="ピルボックス・ヒル" PBOX="ピルボックス・ヒル"
PROCOB="プロコピオ・ビーチ" PROCOB="プロコピオ・ビーチ"
PROL="ノース・ヤンクトン" PROL="ノース・ヤンクトン"
RANCHO="ランチョ" RANCHO="ランチョ"
RGLEN="リッチマン・グレン" RGLEN="リッチマン・グレン"
RICHM="リッチマン" RICHM="リッチマン"
ROCKF="ロックフォード・ヒルズ" ROCKF="ロックフォード・ヒルズ"
RTRAK="レッドウッド・ライト・トラック" RTRAK="レッドウッド・ライト・トラック"
SANAND="サンアンドレアス" SANAND="サンアンドレアス"
SANCHIA="サン・チアンスキー山脈" SANCHIA="サン・チアンスキー山脈"
SANDY="サンディ海岸" SANDY="サンディ海岸"
SENORA="セノーラ高速道路" SENORA="セノーラ高速道路"
SKID="ミッション・ロウ" SKID="ミッション・ロウ"
SLAB="スタブシティ" SLAB="スタブシティ"
SLSANT="サウス・ロスサントス" SLSANT="サウス・ロスサントス"
STAD="メイズバンク・アリーナ" STAD="メイズバンク・アリーナ"
STRAW="ストロベリー" STRAW="ストロベリー"
TATAMO="タタヴィアム山地" TATAMO="タタヴィアム山地"
TERMINA="ターミナル" TERMINA="ターミナル"
TEXTI="テキスタイルシティ" TEXTI="テキスタイルシティ"
TONGVAH="トングバ・ヒルズ" TONGVAH="トングバ・ヒルズ"
TONGVAV="トングバ・バレー" TONGVAV="トングバ・バレー"
UTOPIAG="ユートピア・ガーデンズ" UTOPIAG="ユートピア・ガーデンズ"
VCANA="ベスプッチ運河" VCANA="ベスプッチ運河"
VESP="ベスプッチ" VESP="ベスプッチ"
VINE="バインウッド" VINE="バインウッド"
WINDF="ロン・オルタネット・ウィンドファーム" WINDF="ロン・オルタネット・ウィンドファーム"
WMIRROR="ウエスト・ミラー・ドライブ" WMIRROR="ウエスト・ミラー・ドライブ"
WVINE="ウエスト・バインウッド" WVINE="ウエスト・バインウッド"
ZANCUDO="ザンクード川" ZANCUDO="ザンクード川"
ZENORA="セノーラ高速道路" ZENORA="セノーラ高速道路"

View File

@ -1,104 +1,104 @@
[Global] [Global]
AIRP="洛聖都國際機場" AIRP="洛聖都國際機場"
ALAMO="阿拉莫海" ALAMO="阿拉莫海"
ALTA="艾爾塔" ALTA="艾爾塔"
ARMYB="桑庫多堡壘" ARMYB="桑庫多堡壘"
BANNING="班寧" BANNING="班寧"
BAYTRE="貝特里峽谷" BAYTRE="貝特里峽谷"
BEACH="威斯普奇海灘" BEACH="威斯普奇海灘"
BHAMCA="班漢峽谷" BHAMCA="班漢峽谷"
BRADP="布萊杜要道" BRADP="布萊杜要道"
BRADT="布萊杜隧道" BRADT="布萊杜隧道"
BURTON="巴頓" BURTON="巴頓"
CALAFB="卡拉非橋" CALAFB="卡拉非橋"
CANNY="雷通峽谷" CANNY="雷通峽谷"
CCREAK="加斯迪小溪" CCREAK="加斯迪小溪"
CHAMH="張伯倫山" CHAMH="張伯倫山"
CHIL="好麥塢山" CHIL="好麥塢山"
CHU="丘瑪墟" CHU="丘瑪墟"
CMSW="奇力耶德山國家生態保護區" CMSW="奇力耶德山國家生態保護區"
CYPRE="扁柏平地" CYPRE="扁柏平地"
DAVIS="戴維斯" DAVIS="戴維斯"
DELBE="佩羅海灘" DELBE="佩羅海灘"
DELPE="佩羅" DELPE="佩羅"
DELSOL="洛波塔" DELSOL="洛波塔"
DESRT="塞諾拉大沙漠" DESRT="塞諾拉大沙漠"
DOWNT="市中心" DOWNT="市中心"
DTVINE="好麥塢市中心" DTVINE="好麥塢市中心"
EAST_V="東好麥塢" EAST_V="東好麥塢"
EBURO="布羅高地" EBURO="布羅高地"
ECLIPS="日蝕" ECLIPS="日蝕"
ELGORL="戈多燈塔" ELGORL="戈多燈塔"
ELSANT="東洛聖都" ELSANT="東洛聖都"
ELYSIAN="安樂島" ELYSIAN="安樂島"
GALFISH="加利利" GALFISH="加利利"
GALLI="伽利略公園" GALLI="伽利略公園"
GOLF="西部鄉村高爾夫俱樂部" GOLF="西部鄉村高爾夫俱樂部"
GRAPES="葡萄籽" GRAPES="葡萄籽"
GREATC="大叢林" GREATC="大叢林"
HARMO="和美尼" HARMO="和美尼"
HAWICK="霍伊克" HAWICK="霍伊克"
HEART="驚心海灘" HEART="驚心海灘"
HORS="好麥塢賽馬場" HORS="好麥塢賽馬場"
HUD_MG_TRI_ALA="阿拉莫海" HUD_MG_TRI_ALA="阿拉莫海"
HUD_MG_TRI_VES="威斯普奇" HUD_MG_TRI_VES="威斯普奇"
HUMLAB="人道研究實驗室" HUMLAB="人道研究實驗室"
JAIL="博林布魯克監獄" JAIL="博林布魯克監獄"
KOREAT="小首爾" KOREAT="小首爾"
LACT="蘭艾水庫" LACT="蘭艾水庫"
LAGO="桑庫多沼地" LAGO="桑庫多沼地"
LDAM="蘭艾水壩" LDAM="蘭艾水壩"
LMESA="梅薩" LMESA="梅薩"
LOSPFY="洛波塔高速公路" LOSPFY="洛波塔高速公路"
LOSPUER="洛波塔" LOSPUER="洛波塔"
LOSSF="洛聖都高速公路" LOSSF="洛聖都高速公路"
MGCR_1="南洛聖都" MGCR_1="南洛聖都"
MGCR_6="威斯普奇運河" MGCR_6="威斯普奇運河"
MGSR_3="雷通峽谷" MGSR_3="雷通峽谷"
MIRR="米羅公園" MIRR="米羅公園"
MORN="摩寧塢" MORN="摩寧塢"
MOVIE="李察尊爵" MOVIE="李察尊爵"
MTCHIL="奇力耶德山" MTCHIL="奇力耶德山"
MTGORDO="戈多山" MTGORDO="戈多山"
MTJOSE="尤夏山" MTJOSE="尤夏山"
MURRI="穆瑞塔高地" MURRI="穆瑞塔高地"
NCHU="北丘瑪墟" NCHU="北丘瑪墟"
OBSERV="伽利略天文台" OBSERV="伽利略天文台"
OCEANA="太平洋" OCEANA="太平洋"
PALCOV="佩立托小海灣" PALCOV="佩立托小海灣"
PALETO="佩立托灣" PALETO="佩立托灣"
PALFOR="佩立托森林" PALFOR="佩立托森林"
PALHIGH="巴洛米諾高地" PALHIGH="巴洛米諾高地"
PALMPOW="帕莫泰勒發電站" PALMPOW="帕莫泰勒發電站"
PBLUFF="太平崖" PBLUFF="太平崖"
PBOX="圓帽山" PBOX="圓帽山"
PROCOB="普羅科皮奧海灘" PROCOB="普羅科皮奧海灘"
PROL="北揚克頓" PROL="北揚克頓"
RANCHO="藍丘" RANCHO="藍丘"
RGLEN="利金漫幽谷" RGLEN="利金漫幽谷"
RICHM="利金漫" RICHM="利金漫"
ROCKF="羅克福德山" ROCKF="羅克福德山"
RTRAK="紅木賽道" RTRAK="紅木賽道"
SANAND="聖安地列斯" SANAND="聖安地列斯"
SANCHIA="聖強斯基山脈" SANCHIA="聖強斯基山脈"
SANDY="沙灘海岸" SANDY="沙灘海岸"
SENORA="塞諾拉高速公路" SENORA="塞諾拉高速公路"
SKID="密申羅" SKID="密申羅"
SLAB="背刺城" SLAB="背刺城"
SLSANT="南洛聖都" SLSANT="南洛聖都"
STAD="花園銀行體育場" STAD="花園銀行體育場"
STRAW="斯卓貝利" STRAW="斯卓貝利"
TATAMO="塔塔維昂山" TATAMO="塔塔維昂山"
TERMINA="碼頭" TERMINA="碼頭"
TEXTI="紡織城" TEXTI="紡織城"
TONGVAH="通瓦山" TONGVAH="通瓦山"
TONGVAV="通瓦谷地" TONGVAV="通瓦谷地"
UTOPIAG="烏托邦花園" UTOPIAG="烏托邦花園"
VCANA="威斯普奇運河" VCANA="威斯普奇運河"
VESP="威斯普奇" VESP="威斯普奇"
VINE="好麥塢" VINE="好麥塢"
WINDF="朗恩.艾特梅茲風車農場" WINDF="朗恩.艾特梅茲風車農場"
WMIRROR="米羅車道西段" WMIRROR="米羅車道西段"
WVINE="西好麥塢" WVINE="西好麥塢"
ZANCUDO="桑庫多河" ZANCUDO="桑庫多河"
ZENORA="塞諾拉高速公路" ZENORA="塞諾拉高速公路"

Binary file not shown.

View File

@ -196,32 +196,32 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
<translation>Importieren...</translation> <translation>Importieren...</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="87"/> <location filename="../ImportDialog.ui" line="90"/>
<source>Settings</source> <source>Settings</source>
<translation>Einstellungen</translation> <translation>Einstellungen</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="93"/> <location filename="../ImportDialog.ui" line="96"/>
<source>&amp;Keep Aspect Ratio</source> <source>&amp;Keep Aspect Ratio</source>
<translation>Seitenverhältnis &amp;behalten</translation> <translation>Seitenverhältnis &amp;behalten</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="100"/> <location filename="../ImportDialog.ui" line="103"/>
<source>&amp;Ignore Aspect Ratio</source> <source>&amp;Ignore Aspect Ratio</source>
<translation>Seitenverhältnis &amp;ignorieren</translation> <translation>Seitenverhältnis &amp;ignorieren</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="107"/> <location filename="../ImportDialog.ui" line="110"/>
<source>&amp;Avatar</source> <source>&amp;Avatar</source>
<translation>&amp;Avatar</translation> <translation>&amp;Avatar</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="145"/> <location filename="../ImportDialog.ui" line="154"/>
<source>&amp;OK</source> <source>&amp;OK</source>
<translation>&amp;OK</translation> <translation>&amp;OK</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="152"/> <location filename="../ImportDialog.ui" line="167"/>
<source>&amp;Cancel</source> <source>&amp;Cancel</source>
<translation>Abbre&amp;chen</translation> <translation>Abbre&amp;chen</translation>
</message> </message>
@ -559,17 +559,17 @@ Grand Theft Auto V Snapmatic Bilder und Spielständen</translation>
<translation>Schließen</translation> <translation>Schließen</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="95"/> <location filename="../PictureDialog.cpp" line="128"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation>Exportiere als &amp;JPG Bild...</translation> <translation>Exportiere als &amp;JPG Bild...</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="96"/> <location filename="../PictureDialog.cpp" line="129"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation>Exportiere als &amp;GTA Snapmatic...</translation> <translation>Exportiere als &amp;GTA Snapmatic...</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="297"/> <location filename="../PictureDialog.cpp" line="343"/>
<source>Key 1 - Avatar Preview Mode <source>Key 1 - Avatar Preview Mode
Key 2 - Toggle Overlay Key 2 - Toggle Overlay
Arrow Keys - Navigate</source> Arrow Keys - Navigate</source>
@ -578,19 +578,19 @@ Taste 2 - Overlay umschalten
Pfeiltasten - Navigieren</translation> Pfeiltasten - Navigieren</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="357"/> <location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="414"/> <location filename="../PictureDialog.cpp" line="474"/>
<source>Snapmatic Picture Viewer</source> <source>Snapmatic Picture Viewer</source>
<translation>Snapmatic Bildansicht</translation> <translation>Snapmatic Bildansicht</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="357"/> <location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="414"/> <location filename="../PictureDialog.cpp" line="474"/>
<source>Failed at %1</source> <source>Failed at %1</source>
<translation>Fehlgeschlagen bei %1</translation> <translation>Fehlgeschlagen bei %1</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="469"/> <location filename="../PictureDialog.cpp" line="529"/>
<source>Avatar Preview Mode <source>Avatar Preview Mode
Press 1 for Default View</source> Press 1 for Default View</source>
<translation>Avatar Vorschaumodus <translation>Avatar Vorschaumodus
@ -627,19 +627,19 @@ Drücke A für Standardansicht</translation>
<translation type="vanished">Avatar Vorschaumodus&lt;br&gt;Drücke A für Standardansicht</translation> <translation type="vanished">Avatar Vorschaumodus&lt;br&gt;Drücke A für Standardansicht</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="403"/> <location filename="../PictureDialog.cpp" line="463"/>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>No player</source> <source>No player</source>
<translation>Keine Spieler</translation> <translation>Keine Spieler</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="406"/> <location filename="../PictureDialog.cpp" line="466"/>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>No crew</source> <source>No crew</source>
<translation>Keine Crew</translation> <translation>Keine Crew</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>Unknown Location</source> <source>Unknown Location</source>
<translation>Unbekannter Standort</translation> <translation>Unbekannter Standort</translation>
</message> </message>
@ -864,13 +864,13 @@ Drücke A für Standardansicht</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="375"/> <location filename="../ProfileInterface.cpp" line="375"/>
<location filename="../UserInterface.cpp" line="316"/> <location filename="../UserInterface.cpp" line="335"/>
<source>Savegames files (SGTA*)</source> <source>Savegames files (SGTA*)</source>
<translation>Spielstanddateien (SGTA*)</translation> <translation>Spielstanddateien (SGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="376"/> <location filename="../ProfileInterface.cpp" line="376"/>
<location filename="../UserInterface.cpp" line="317"/> <location filename="../UserInterface.cpp" line="336"/>
<source>Snapmatic pictures (PGTA*)</source> <source>Snapmatic pictures (PGTA*)</source>
<translation>Snapmatic Bilder (PGTA*)</translation> <translation>Snapmatic Bilder (PGTA*)</translation>
</message> </message>
@ -881,7 +881,7 @@ Drücke A für Standardansicht</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="378"/> <location filename="../ProfileInterface.cpp" line="378"/>
<location filename="../UserInterface.cpp" line="318"/> <location filename="../UserInterface.cpp" line="337"/>
<source>All files (**)</source> <source>All files (**)</source>
<translation>Alle Dateien (**)</translation> <translation>Alle Dateien (**)</translation>
</message> </message>
@ -902,13 +902,13 @@ Drücke A für Standardansicht</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="492"/> <location filename="../ProfileInterface.cpp" line="492"/>
<location filename="../UserInterface.cpp" line="358"/> <location filename="../UserInterface.cpp" line="377"/>
<source>Failed to read Snapmatic picture</source> <source>Failed to read Snapmatic picture</source>
<translation>Fehler beim Lesen vom Snapmatic Bild</translation> <translation>Fehler beim Lesen vom Snapmatic Bild</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="508"/> <location filename="../ProfileInterface.cpp" line="508"/>
<location filename="../UserInterface.cpp" line="374"/> <location filename="../UserInterface.cpp" line="393"/>
<source>Failed to read Savegame file</source> <source>Failed to read Savegame file</source>
<translation>Fehler beim Lesen von Spielstanddatei</translation> <translation>Fehler beim Lesen von Spielstanddatei</translation>
</message> </message>
@ -935,7 +935,7 @@ Drücke A für Standardansicht</translation>
<message> <message>
<location filename="../ProfileInterface.cpp" line="465"/> <location filename="../ProfileInterface.cpp" line="465"/>
<location filename="../ProfileInterface.cpp" line="663"/> <location filename="../ProfileInterface.cpp" line="663"/>
<location filename="../UserInterface.cpp" line="406"/> <location filename="../UserInterface.cpp" line="425"/>
<source>No valid file is selected</source> <source>No valid file is selected</source>
<translation>Keine gültige Datei wurde ausgewählt</translation> <translation>Keine gültige Datei wurde ausgewählt</translation>
</message> </message>
@ -1096,20 +1096,20 @@ Exportieren als:</translation>
<translation type="obsolete">Aktueller Exportiervorgang: %1</translation> <translation type="obsolete">Aktueller Exportiervorgang: %1</translation>
</message> </message>
<message> <message>
<location filename="../ExportThread.cpp" line="95"/> <location filename="../ExportThread.cpp" line="96"/>
<location filename="../ExportThread.cpp" line="134"/> <location filename="../ExportThread.cpp" line="135"/>
<location filename="../ExportThread.cpp" line="155"/> <location filename="../ExportThread.cpp" line="156"/>
<source>Export file %1 of %2 files</source> <source>Export file %1 of %2 files</source>
<translation>Exportiere Datei %1 von %2 Dateien</translation> <translation>Exportiere Datei %1 von %2 Dateien</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="314"/> <location filename="../UserInterface.cpp" line="333"/>
<source>All profile files (*.g5e SGTA* PGTA*)</source> <source>All profile files (*.g5e SGTA* PGTA*)</source>
<translation>Alle Profildateien (*.g5e SGTA* PGTA*)</translation> <translation>Alle Profildateien (*.g5e SGTA* PGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="374"/> <location filename="../ProfileInterface.cpp" line="374"/>
<location filename="../UserInterface.cpp" line="315"/> <location filename="../UserInterface.cpp" line="334"/>
<source>GTA V Export (*.g5e)</source> <source>GTA V Export (*.g5e)</source>
<translation>GTA V Export (*.g5e)</translation> <translation>GTA V Export (*.g5e)</translation>
</message> </message>
@ -1211,13 +1211,13 @@ Exportieren als:</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="118"/> <location filename="../SavegameWidget.ui" line="118"/>
<location filename="../SavegameWidget.cpp" line="132"/> <location filename="../SavegameWidget.cpp" line="131"/>
<location filename="../SavegameWidget.cpp" line="145"/> <location filename="../SavegameWidget.cpp" line="144"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Savegame löschen</translation> <translation>Savegame löschen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="50"/> <location filename="../SavegameWidget.cpp" line="49"/>
<source>Export Savegame...</source> <source>Export Savegame...</source>
<translation>Spielstand exportieren...</translation> <translation>Spielstand exportieren...</translation>
</message> </message>
@ -1227,8 +1227,8 @@ Exportieren als:</translation>
<translation>SPIELSTAND %3 - %1&lt;br&gt;%2</translation> <translation>SPIELSTAND %3 - %1&lt;br&gt;%2</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="93"/>
<location filename="../SavegameWidget.cpp" line="94"/> <location filename="../SavegameWidget.cpp" line="94"/>
<location filename="../SavegameWidget.cpp" line="95"/>
<source>WRONG FORMAT</source> <source>WRONG FORMAT</source>
<translation>FALSCHES FORMAT</translation> <translation>FALSCHES FORMAT</translation>
</message> </message>
@ -1237,63 +1237,63 @@ Exportieren als:</translation>
<translation type="vanished">AUTO</translation> <translation type="vanished">AUTO</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="57"/> <location filename="../SavegameWidget.cpp" line="56"/>
<source>AUTOSAVE - %1 <source>AUTOSAVE - %1
%2</source> %2</source>
<translation>AUTOSAVE - %1 <translation>AUTOSAVE - %1
%2</translation> %2</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="58"/> <location filename="../SavegameWidget.cpp" line="57"/>
<source>SAVE %3 - %1 <source>SAVE %3 - %1
%2</source> %2</source>
<translation>SPIELSTAND %3 - %1 <translation>SPIELSTAND %3 - %1
%2</translation> %2</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="118"/> <location filename="../SavegameWidget.cpp" line="117"/>
<source>UNKNOWN</source> <source>UNKNOWN</source>
<translation>UNKNOWN</translation> <translation>UNKNOWN</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="132"/> <location filename="../SavegameWidget.cpp" line="131"/>
<source>Are you sure to delete %1 from your savegames?</source> <source>Are you sure to delete %1 from your savegames?</source>
<translation>Bist du sicher %1 von deinen Spielständen zu löschen?</translation> <translation>Bist du sicher %1 von deinen Spielständen zu löschen?</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="145"/> <location filename="../SavegameWidget.cpp" line="144"/>
<source>Failed at deleting %1 from your savegames</source> <source>Failed at deleting %1 from your savegames</source>
<translation>Fehlgeschlagen beim Löschen %1 von deinen Spielständen</translation> <translation>Fehlgeschlagen beim Löschen %1 von deinen Spielständen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="209"/> <location filename="../ProfileInterface.cpp" line="1106"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>A&amp;nsehen</translation> <translation>A&amp;nsehen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="211"/> <location filename="../ProfileInterface.cpp" line="1108"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>Entfe&amp;rnen</translation> <translation>Entfe&amp;rnen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="215"/> <location filename="../ProfileInterface.cpp" line="1112"/>
<location filename="../SavegameWidget.cpp" line="227"/> <location filename="../ProfileInterface.cpp" line="1123"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>Au&amp;swählen</translation> <translation>Au&amp;swählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="216"/> <location filename="../ProfileInterface.cpp" line="1113"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>A&amp;bwählen</translation> <translation>A&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="217"/> <location filename="../ProfileInterface.cpp" line="1114"/>
<location filename="../SavegameWidget.cpp" line="228"/> <location filename="../ProfileInterface.cpp" line="1124"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>&amp;Alles auswählen</translation> <translation>&amp;Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="221"/> <location filename="../ProfileInterface.cpp" line="1117"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>
@ -1332,7 +1332,7 @@ Exportieren als:</translation>
<translation>Spielstand kopieren</translation> <translation>Spielstand kopieren</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="210"/> <location filename="../ProfileInterface.cpp" line="1107"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exportieren</translation> <translation>&amp;Exportieren</translation>
</message> </message>
@ -1408,7 +1408,7 @@ Exportieren als:</translation>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="14"/> <location filename="../SnapmaticEditor.ui" line="14"/>
<location filename="../SnapmaticEditor.ui" line="81"/> <location filename="../SnapmaticEditor.ui" line="81"/>
<location filename="../SnapmaticEditor.cpp" line="216"/> <location filename="../SnapmaticEditor.cpp" line="247"/>
<source>Snapmatic Properties</source> <source>Snapmatic Properties</source>
<translation>Snapmatic Eigenschaften</translation> <translation>Snapmatic Eigenschaften</translation>
</message> </message>
@ -1456,26 +1456,45 @@ Exportieren als:</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="125"/> <location filename="../SnapmaticEditor.ui" line="125"/>
<location filename="../SnapmaticEditor.cpp" line="297"/>
<source>Snapmatic Title</source>
<translation>Snapmatic Titel</translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="140"/>
<location filename="../SnapmaticEditor.cpp" line="200"/>
<source>Title: %1 (%2)</source>
<translation>Titel: %1 (%2)</translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="156"/>
<location filename="../SnapmaticEditor.cpp" line="204"/>
<location filename="../SnapmaticEditor.cpp" line="208"/>
<source>Appropriate: %1</source>
<translation>Angemessen: %1</translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="169"/>
<source>Extras</source> <source>Extras</source>
<translation>Extras</translation> <translation>Extras</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="131"/> <location filename="../SnapmaticEditor.ui" line="175"/>
<source>Qualify as Avatar automatically at apply</source> <source>Qualify as Avatar automatically at apply</source>
<translation>Beim Übernehmen als Avatar qualifizieren </translation> <translation>Beim Übernehmen als Avatar qualifizieren </translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="144"/> <location filename="../SnapmaticEditor.ui" line="188"/>
<source>Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture</source> <source>Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture</source>
<translation>Das Qualifizieren als Avatar erlaubt dir dieses Snapmatic als Social Club Profilbild zu nutzen</translation> <translation>Das Qualifizieren als Avatar erlaubt dir dieses Snapmatic als Social Club Profilbild zu nutzen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="194"/> <location filename="../SnapmaticEditor.ui" line="238"/>
<source>&amp;Apply</source> <source>&amp;Apply</source>
<translation>&amp;Übernehmen</translation> <translation>&amp;Übernehmen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="207"/> <location filename="../SnapmaticEditor.ui" line="251"/>
<source>&amp;Cancel</source> <source>&amp;Cancel</source>
<translation>Abbre&amp;chen</translation> <translation>Abbre&amp;chen</translation>
</message> </message>
@ -1488,15 +1507,37 @@ Exportieren als:</translation>
<translation type="vanished">Cancel</translation> <translation type="vanished">Cancel</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.cpp" line="216"/> <location filename="../SnapmaticEditor.cpp" line="199"/>
<source>Edit</source>
<translation>Bearbeiten</translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="204"/>
<source>Yes</source>
<comment>Yes, should work fine</comment>
<translation>Ja</translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="208"/>
<source>No</source>
<comment>No, could lead to issues</comment>
<translation>Nein</translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="247"/>
<source>Patching of Snapmatic Properties failed because of I/O Error</source> <source>Patching of Snapmatic Properties failed because of I/O Error</source>
<translation>Patchen von Snapmatic Eigenschaften fehlgeschlagen wegen I/O Fehler</translation> <translation>Patchen von Snapmatic Eigenschaften fehlgeschlagen wegen I/O Fehler</translation>
</message> </message>
<message>
<location filename="../SnapmaticEditor.cpp" line="297"/>
<source>New Snapmatic title:</source>
<translation>Neuer Snapmatic Titel:</translation>
</message>
</context> </context>
<context> <context>
<name>SnapmaticPicture</name> <name>SnapmaticPicture</name>
<message> <message>
<location filename="../SnapmaticPicture.cpp" line="349"/> <location filename="../SnapmaticPicture.cpp" line="370"/>
<source>PHOTO - %1</source> <source>PHOTO - %1</source>
<translation>FOTO - %1</translation> <translation>FOTO - %1</translation>
</message> </message>
@ -1535,18 +1576,18 @@ Exportieren als:</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.ui" line="149"/> <location filename="../SnapmaticWidget.ui" line="149"/>
<location filename="../SnapmaticWidget.cpp" line="140"/> <location filename="../SnapmaticWidget.cpp" line="150"/>
<location filename="../SnapmaticWidget.cpp" line="153"/> <location filename="../SnapmaticWidget.cpp" line="163"/>
<source>Delete picture</source> <source>Delete picture</source>
<translation>Bild löschen</translation> <translation>Bild löschen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="140"/> <location filename="../SnapmaticWidget.cpp" line="150"/>
<source>Are you sure to delete %1 from your Snapmatic pictures?</source> <source>Are you sure to delete %1 from your Snapmatic pictures?</source>
<translation>Bist du sicher %1 von deinen Snapmatic Bilder zu löschen?</translation> <translation>Bist du sicher %1 von deinen Snapmatic Bilder zu löschen?</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="205"/> <location filename="../ProfileInterface.cpp" line="1065"/>
<source>Edi&amp;t</source> <source>Edi&amp;t</source>
<translation>Bearbei&amp;ten</translation> <translation>Bearbei&amp;ten</translation>
</message> </message>
@ -1559,7 +1600,7 @@ Exportieren als:</translation>
<translation type="vanished">&amp;Im Spiel deaktivieren</translation> <translation type="vanished">&amp;Im Spiel deaktivieren</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="215"/> <location filename="../ProfileInterface.cpp" line="1075"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exportieren</translation> <translation>&amp;Exportieren</translation>
</message> </message>
@ -1572,12 +1613,12 @@ Exportieren als:</translation>
<translation type="obsolete">Exportiere als &amp;GTA Snapmatic</translation> <translation type="obsolete">Exportiere als &amp;GTA Snapmatic</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="208"/> <location filename="../ProfileInterface.cpp" line="1068"/>
<source>Show &amp;In-game</source> <source>Show &amp;In-game</source>
<translation>&amp;Im Spiel anzeigen</translation> <translation>&amp;Im Spiel anzeigen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="212"/> <location filename="../ProfileInterface.cpp" line="1072"/>
<source>Hide &amp;In-game</source> <source>Hide &amp;In-game</source>
<translation>&amp;Im Spiel ausblenden</translation> <translation>&amp;Im Spiel ausblenden</translation>
</message> </message>
@ -1590,49 +1631,49 @@ Exportieren als:</translation>
<translation type="vanished">FOTO - %1</translation> <translation type="vanished">FOTO - %1</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="214"/> <location filename="../ProfileInterface.cpp" line="1074"/>
<source>&amp;Edit Properties...</source> <source>&amp;Edit Properties...</source>
<translation>&amp;Eigenschaften bearbeiten...</translation> <translation>&amp;Eigenschaften bearbeiten...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="216"/> <location filename="../ProfileInterface.cpp" line="1076"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation>Exportiere als &amp;JPG Bild...</translation> <translation>Exportiere als &amp;JPG Bild...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="217"/> <location filename="../ProfileInterface.cpp" line="1077"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation>Exportiere als &amp;GTA Snapmatic...</translation> <translation>Exportiere als &amp;GTA Snapmatic...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="218"/> <location filename="../ProfileInterface.cpp" line="1078"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>A&amp;nsehen</translation> <translation>A&amp;nsehen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="221"/> <location filename="../ProfileInterface.cpp" line="1081"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>Entfe&amp;rnen</translation> <translation>Entfe&amp;rnen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="225"/> <location filename="../ProfileInterface.cpp" line="1085"/>
<location filename="../SnapmaticWidget.cpp" line="237"/> <location filename="../ProfileInterface.cpp" line="1096"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>Au&amp;swählen</translation> <translation>Au&amp;swählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="226"/> <location filename="../ProfileInterface.cpp" line="1086"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>A&amp;bwählen</translation> <translation>A&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="227"/> <location filename="../ProfileInterface.cpp" line="1087"/>
<location filename="../SnapmaticWidget.cpp" line="238"/> <location filename="../ProfileInterface.cpp" line="1097"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>Alles &amp;auswählen</translation> <translation>Alles &amp;auswählen</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="231"/> <location filename="../ProfileInterface.cpp" line="1090"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>
@ -1680,7 +1721,7 @@ Exportieren als:</translation>
<translation type="obsolete">Bist du sicher %1 von deinen Snapmatic Bilder zu löschen?</translation> <translation type="obsolete">Bist du sicher %1 von deinen Snapmatic Bilder zu löschen?</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="153"/> <location filename="../SnapmaticWidget.cpp" line="163"/>
<source>Failed at deleting %1 from your Snapmatic pictures</source> <source>Failed at deleting %1 from your Snapmatic pictures</source>
<translation>Fehlgeschlagen beim Löschen %1 von deinen Snapmatic Bildern</translation> <translation>Fehlgeschlagen beim Löschen %1 von deinen Snapmatic Bildern</translation>
</message> </message>
@ -1720,7 +1761,7 @@ Exportieren als:</translation>
<translation type="obsolete">Über gta5sync</translation> <translation type="obsolete">Über gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="266"/> <location filename="../UserInterface.ui" line="258"/>
<source>Ctrl+A</source> <source>Ctrl+A</source>
<translation>Strg+A</translation> <translation>Strg+A</translation>
</message> </message>
@ -1733,7 +1774,7 @@ Exportieren als:</translation>
<translation type="obsolete">Optionen</translation> <translation type="obsolete">Optionen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="306"/> <location filename="../UserInterface.ui" line="298"/>
<source>Ctrl+O</source> <source>Ctrl+O</source>
<translation>Strg+O</translation> <translation>Strg+O</translation>
</message> </message>
@ -1742,7 +1783,7 @@ Exportieren als:</translation>
<translation type="obsolete">Alles auswählen</translation> <translation type="obsolete">Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="258"/> <location filename="../UserInterface.ui" line="250"/>
<source>Ctrl+S</source> <source>Ctrl+S</source>
<translation>Strg+S</translation> <translation>Strg+S</translation>
</message> </message>
@ -1759,7 +1800,7 @@ Exportieren als:</translation>
<translation type="obsolete">Auswahl exportieren</translation> <translation type="obsolete">Auswahl exportieren</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="282"/> <location filename="../UserInterface.ui" line="274"/>
<source>Ctrl+E</source> <source>Ctrl+E</source>
<translation>Strg+E</translation> <translation>Strg+E</translation>
</message> </message>
@ -1768,12 +1809,12 @@ Exportieren als:</translation>
<translation type="obsolete">Auswahl löschen</translation> <translation type="obsolete">Auswahl löschen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="274"/> <location filename="../UserInterface.ui" line="266"/>
<source>Ctrl+D</source> <source>Ctrl+D</source>
<translation>Strg+D</translation> <translation>Strg+D</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="235"/> <location filename="../UserInterface.ui" line="231"/>
<source>Exit</source> <source>Exit</source>
<translation>Beenden</translation> <translation>Beenden</translation>
</message> </message>
@ -1787,12 +1828,12 @@ Exportieren als:</translation>
<translation type="vanished">&amp;Über Produkt</translation> <translation type="vanished">&amp;Über Produkt</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="232"/> <location filename="../UserInterface.ui" line="228"/>
<source>&amp;Exit</source> <source>&amp;Exit</source>
<translation>B&amp;eenden</translation> <translation>B&amp;eenden</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="238"/> <location filename="../UserInterface.ui" line="234"/>
<source>Ctrl+Q</source> <source>Ctrl+Q</source>
<translation>Strg+Q</translation> <translation>Strg+Q</translation>
</message> </message>
@ -1835,43 +1876,43 @@ Exportieren als:</translation>
<translation type="vanished">&amp;Über gta5sync</translation> <translation type="vanished">&amp;Über gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="243"/> <location filename="../UserInterface.ui" line="239"/>
<source>Close &amp;Profile</source> <source>Close &amp;Profile</source>
<translation>&amp;Profil schließen</translation> <translation>&amp;Profil schließen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="246"/> <location filename="../UserInterface.ui" line="242"/>
<source>Ctrl+End</source> <source>Ctrl+End</source>
<translation>Strg+Ende</translation> <translation>Strg+Ende</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="290"/> <location filename="../UserInterface.ui" line="282"/>
<source>Ctrl+Del</source> <source>Ctrl+Del</source>
<translation>Strg+Entf</translation> <translation>Strg+Entf</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="303"/> <location filename="../UserInterface.ui" line="295"/>
<source>&amp;Open File...</source> <source>&amp;Open File...</source>
<translation>Datei &amp;öffnen...</translation> <translation>Datei &amp;öffnen...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="311"/> <location filename="../UserInterface.ui" line="303"/>
<location filename="../UserInterface.cpp" line="131"/> <location filename="../UserInterface.cpp" line="144"/>
<source>Select &amp;GTA V Folder...</source> <source>Select &amp;GTA V Folder...</source>
<translation>Wähle &amp;GTA V Ordner...</translation> <translation>Wähle &amp;GTA V Ordner...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="317"/> <location filename="../UserInterface.ui" line="309"/>
<source>Ctrl+G</source> <source>Ctrl+G</source>
<translation>Strg+G</translation> <translation>Strg+G</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="322"/> <location filename="../UserInterface.ui" line="314"/>
<source>Show In-gam&amp;e</source> <source>Show In-gam&amp;e</source>
<translation>Im Spiel anzeig&amp;en</translation> <translation>Im Spiel anzeig&amp;en</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="330"/> <location filename="../UserInterface.ui" line="322"/>
<source>Hi&amp;de In-game</source> <source>Hi&amp;de In-game</source>
<translation>Im Spiel ausblen&amp;den</translation> <translation>Im Spiel ausblen&amp;den</translation>
</message> </message>
@ -1884,7 +1925,7 @@ Exportieren als:</translation>
<translation type="vanished">Im Spiel aktivier&amp;en</translation> <translation type="vanished">Im Spiel aktivier&amp;en</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="325"/> <location filename="../UserInterface.ui" line="317"/>
<source>Shift+E</source> <source>Shift+E</source>
<translation>Umschalt+E</translation> <translation>Umschalt+E</translation>
</message> </message>
@ -1893,7 +1934,7 @@ Exportieren als:</translation>
<translation type="vanished">Im Spiel &amp;deaktivieren</translation> <translation type="vanished">Im Spiel &amp;deaktivieren</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="333"/> <location filename="../UserInterface.ui" line="325"/>
<source>Shift+D</source> <source>Shift+D</source>
<translation>Umschalt+D</translation> <translation>Umschalt+D</translation>
</message> </message>
@ -1916,27 +1957,27 @@ Exportieren als:</translation>
<translation type="obsolete">&amp;Optionen</translation> <translation type="obsolete">&amp;Optionen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="255"/> <location filename="../UserInterface.ui" line="247"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>Ein&amp;stellungen</translation> <translation>Ein&amp;stellungen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="263"/> <location filename="../UserInterface.ui" line="255"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>&amp;Alles auswählen</translation> <translation>&amp;Alles auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="271"/> <location filename="../UserInterface.ui" line="263"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>Alles a&amp;bwählen</translation> <translation>Alles a&amp;bwählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="279"/> <location filename="../UserInterface.ui" line="271"/>
<source>&amp;Export selected...</source> <source>&amp;Export selected...</source>
<translation>Auswahl &amp;exportieren...</translation> <translation>Auswahl &amp;exportieren...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="287"/> <location filename="../UserInterface.ui" line="279"/>
<source>&amp;Remove selected</source> <source>&amp;Remove selected</source>
<translation>Auswahl entfe&amp;rnen</translation> <translation>Auswahl entfe&amp;rnen</translation>
</message> </message>
@ -1945,12 +1986,12 @@ Exportieren als:</translation>
<translation type="obsolete">Strg+R</translation> <translation type="obsolete">Strg+R</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="295"/> <location filename="../UserInterface.ui" line="287"/>
<source>&amp;Import files...</source> <source>&amp;Import files...</source>
<translation>Dateien &amp;importieren...</translation> <translation>Dateien &amp;importieren...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="298"/> <location filename="../UserInterface.ui" line="290"/>
<source>Ctrl+I</source> <source>Ctrl+I</source>
<translation>Strg+I</translation> <translation>Strg+I</translation>
</message> </message>
@ -1959,16 +2000,16 @@ Exportieren als:</translation>
<translation type="obsolete">GTA V Ordner nicht gefunden!</translation> <translation type="obsolete">GTA V Ordner nicht gefunden!</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="61"/> <location filename="../UserInterface.cpp" line="62"/>
<location filename="../UserInterface.cpp" line="201"/> <location filename="../UserInterface.cpp" line="214"/>
<source>Select Profile</source> <source>Select Profile</source>
<translation>Profil auswählen</translation> <translation>Profil auswählen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="314"/> <location filename="../UserInterface.ui" line="306"/>
<location filename="../OptionsDialog.cpp" line="444"/> <location filename="../OptionsDialog.cpp" line="444"/>
<location filename="../UserInterface.cpp" line="80"/> <location filename="../UserInterface.cpp" line="93"/>
<location filename="../UserInterface.cpp" line="455"/> <location filename="../UserInterface.cpp" line="474"/>
<source>Select GTA V Folder...</source> <source>Select GTA V Folder...</source>
<translation>Wähle GTA V Ordner...</translation> <translation>Wähle GTA V Ordner...</translation>
</message> </message>
@ -1977,7 +2018,7 @@ Exportieren als:</translation>
<translation type="vanished">Wähle GTA V &amp;Ordner...</translation> <translation type="vanished">Wähle GTA V &amp;Ordner...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="311"/> <location filename="../UserInterface.cpp" line="330"/>
<source>Open File...</source> <source>Open File...</source>
<translation>Datei öffnen...</translation> <translation>Datei öffnen...</translation>
</message> </message>
@ -1987,26 +2028,26 @@ Exportieren als:</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="20"/> <location filename="../UserInterface.ui" line="20"/>
<location filename="../UserInterface.cpp" line="59"/> <location filename="../UserInterface.cpp" line="60"/>
<source>%2 - %1</source> <source>%2 - %1</source>
<translation>%2 - %1</translation> <translation>%2 - %1</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="220"/> <location filename="../UserInterface.ui" line="220"/>
<location filename="../UserInterface.cpp" line="58"/> <location filename="../UserInterface.cpp" line="59"/>
<source>&amp;About %1</source> <source>&amp;About %1</source>
<translation>&amp;Über %1</translation> <translation>&amp;Über %1</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="358"/> <location filename="../UserInterface.cpp" line="377"/>
<location filename="../UserInterface.cpp" line="374"/> <location filename="../UserInterface.cpp" line="393"/>
<location filename="../UserInterface.cpp" line="401"/> <location filename="../UserInterface.cpp" line="420"/>
<location filename="../UserInterface.cpp" line="406"/> <location filename="../UserInterface.cpp" line="425"/>
<source>Open File</source> <source>Open File</source>
<translation>Datei öffnen</translation> <translation>Datei öffnen</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="401"/> <location filename="../UserInterface.cpp" line="420"/>
<source>Can&apos;t open %1 because of not valid file format</source> <source>Can&apos;t open %1 because of not valid file format</source>
<translation>Kann nicht %1 öffnen weil Dateiformat nicht gültig ist</translation> <translation>Kann nicht %1 öffnen weil Dateiformat nicht gültig ist</translation>
</message> </message>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.0" language="fr_FR"> <TS version="2.1" language="fr_FR">
<context> <context>
<name>AboutDialog</name> <name>AboutDialog</name>
<message> <message>
<source>About gta5sync</source> <source>About gta5sync</source>
<translation>À propos de gta5sync</translation> <translation type="vanished">À propos de gta5sync</translation>
</message> </message>
<message> <message>
<source>&lt;span style=&quot; font-weight:600;&quot;&gt;gta5sync&lt;/span&gt;&lt;br/&gt; <source>&lt;span style=&quot; font-weight:600;&quot;&gt;gta5sync&lt;/span&gt;&lt;br/&gt;
@ -19,7 +19,7 @@ Compiled with Qt %2&lt;br/&gt;
Running with Qt %3&lt;br/&gt; Running with Qt %3&lt;br/&gt;
&lt;br/&gt; &lt;br/&gt;
Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping&lt;/a&gt; 2016&lt;br/&gt;gta5sync is licensed under &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html#content&quot;&gt;GNU GPLv3&lt;/a&gt;</source> Copyright &amp;copy; &lt;a href=&quot;https://github.com/Syping/&quot;&gt;Syping&lt;/a&gt; 2016&lt;br/&gt;gta5sync is licensed under &lt;a href=&quot;https://www.gnu.org/licenses/gpl-3.0.html#content&quot;&gt;GNU GPLv3&lt;/a&gt;</source>
<translation>&lt;span style=&quot; font-weight:600;&quot;&gt;gta5sync&lt;/span&gt;&lt;br/&gt; <translation type="vanished">&lt;span style=&quot; font-weight:600;&quot;&gt;gta5sync&lt;/span&gt;&lt;br/&gt;
&lt;br/&gt; &lt;br/&gt;
Un outil pour gérer et synchroniser les photos Snapmatic&lt;br/&gt; Un outil pour gérer et synchroniser les photos Snapmatic&lt;br/&gt;
et les fichiers de sauvegarde de Grand Theft Auto V&lt;br/&gt; et les fichiers de sauvegarde de Grand Theft Auto V&lt;br/&gt;
@ -152,32 +152,32 @@ et les fichiers de sauvegarde de Grand Theft Auto V</translation>
<translation>Importer...</translation> <translation>Importer...</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="87"/> <location filename="../ImportDialog.ui" line="90"/>
<source>Settings</source> <source>Settings</source>
<translation>Paramètres</translation> <translation>Paramètres</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="93"/> <location filename="../ImportDialog.ui" line="96"/>
<source>&amp;Keep Aspect Ratio</source> <source>&amp;Keep Aspect Ratio</source>
<translation>&amp;Conserver le rapport d&apos;aspect</translation> <translation>&amp;Conserver le rapport d&apos;aspect</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="100"/> <location filename="../ImportDialog.ui" line="103"/>
<source>&amp;Ignore Aspect Ratio</source> <source>&amp;Ignore Aspect Ratio</source>
<translation>&amp;Ignorer le rapport d&apos;aspect</translation> <translation>&amp;Ignorer le rapport d&apos;aspect</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="107"/> <location filename="../ImportDialog.ui" line="110"/>
<source>&amp;Avatar</source> <source>&amp;Avatar</source>
<translation>&amp;Avatar</translation> <translation>&amp;Avatar</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="145"/> <location filename="../ImportDialog.ui" line="154"/>
<source>&amp;OK</source> <source>&amp;OK</source>
<translation>&amp;OK</translation> <translation>&amp;OK</translation>
</message> </message>
<message> <message>
<location filename="../ImportDialog.ui" line="152"/> <location filename="../ImportDialog.ui" line="167"/>
<source>&amp;Cancel</source> <source>&amp;Cancel</source>
<translation>A&amp;nnuler</translation> <translation>A&amp;nnuler</translation>
</message> </message>
@ -452,7 +452,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V</translation>
</message> </message>
<message> <message>
<source>All files (**)</source> <source>All files (**)</source>
<translation>Tous les fichiers (**)</translation> <translation type="vanished">Tous les fichiers (**)</translation>
</message> </message>
<message> <message>
<location filename="../PictureExport.cpp" line="246"/> <location filename="../PictureExport.cpp" line="246"/>
@ -478,7 +478,7 @@ et les fichiers de sauvegarde de Grand Theft Auto V</translation>
</message> </message>
<message> <message>
<source>Failed to copy current Snapmatic picture</source> <source>Failed to copy current Snapmatic picture</source>
<translation>Echec de la copie</translation> <translation type="vanished">Echec de la copie</translation>
</message> </message>
<message> <message>
<location filename="../PictureExport.cpp" line="187"/> <location filename="../PictureExport.cpp" line="187"/>
@ -487,17 +487,17 @@ et les fichiers de sauvegarde de Grand Theft Auto V</translation>
<translation>Fichier invalide</translation> <translation>Fichier invalide</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="95"/> <location filename="../PictureDialog.cpp" line="128"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation>Exporter comme image &amp;JPG...</translation> <translation>Exporter comme image &amp;JPG...</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="96"/> <location filename="../PictureDialog.cpp" line="129"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation>Exporter comme &amp;GTA Snapmatic...</translation> <translation>Exporter comme &amp;GTA Snapmatic...</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="297"/> <location filename="../PictureDialog.cpp" line="343"/>
<source>Key 1 - Avatar Preview Mode <source>Key 1 - Avatar Preview Mode
Key 2 - Toggle Overlay Key 2 - Toggle Overlay
Arrow Keys - Navigate</source> Arrow Keys - Navigate</source>
@ -506,19 +506,19 @@ Touche 2 - Activer/désactiver l&apos;overlay
Touches fléchées - Naviguer</translation> Touches fléchées - Naviguer</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="357"/> <location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="414"/> <location filename="../PictureDialog.cpp" line="474"/>
<source>Snapmatic Picture Viewer</source> <source>Snapmatic Picture Viewer</source>
<translation>Visionneuse de photo Snapmatic</translation> <translation>Visionneuse de photo Snapmatic</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="357"/> <location filename="../PictureDialog.cpp" line="402"/>
<location filename="../PictureDialog.cpp" line="414"/> <location filename="../PictureDialog.cpp" line="474"/>
<source>Failed at %1</source> <source>Failed at %1</source>
<translation>Echec de %1</translation> <translation>Echec de %1</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="469"/> <location filename="../PictureDialog.cpp" line="529"/>
<source>Avatar Preview Mode <source>Avatar Preview Mode
Press 1 for Default View</source> Press 1 for Default View</source>
<translation>Mode Aperçu Avatar <translation>Mode Aperçu Avatar
@ -526,22 +526,22 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<source>Avatar Preview Mode&lt;br&gt;Press A for Default View</source> <source>Avatar Preview Mode&lt;br&gt;Press A for Default View</source>
<translation>Aperçu avatar&lt;br&gt;Appuyer sur A pour la vue par défaut</translation> <translation type="vanished">Aperçu avatar&lt;br&gt;Appuyer sur A pour la vue par défaut</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="403"/> <location filename="../PictureDialog.cpp" line="463"/>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>No player</source> <source>No player</source>
<translation>Aucun joueur</translation> <translation>Aucun joueur</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="406"/> <location filename="../PictureDialog.cpp" line="466"/>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>No crew</source> <source>No crew</source>
<translation>Aucun crew</translation> <translation>Aucun crew</translation>
</message> </message>
<message> <message>
<location filename="../PictureDialog.cpp" line="413"/> <location filename="../PictureDialog.cpp" line="473"/>
<source>Unknown Location</source> <source>Unknown Location</source>
<translation>Emplacement inconnu</translation> <translation>Emplacement inconnu</translation>
</message> </message>
@ -619,9 +619,9 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>&amp;Fermer</translation> <translation>&amp;Fermer</translation>
</message> </message>
<message> <message>
<location filename="../ExportThread.cpp" line="95"/> <location filename="../ExportThread.cpp" line="96"/>
<location filename="../ExportThread.cpp" line="134"/> <location filename="../ExportThread.cpp" line="135"/>
<location filename="../ExportThread.cpp" line="155"/> <location filename="../ExportThread.cpp" line="156"/>
<source>Export file %1 of %2 files</source> <source>Export file %1 of %2 files</source>
<translation>Copie du fichier %1 sur %2</translation> <translation>Copie du fichier %1 sur %2</translation>
</message> </message>
@ -659,23 +659,23 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<source>All profile files (SGTA* PGTA*)</source> <source>All profile files (SGTA* PGTA*)</source>
<translation>Fichiers de profil GTA (SGTA* PGTA*)</translation> <translation type="vanished">Fichiers de profil GTA (SGTA* PGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="375"/> <location filename="../ProfileInterface.cpp" line="375"/>
<location filename="../UserInterface.cpp" line="316"/> <location filename="../UserInterface.cpp" line="335"/>
<source>Savegames files (SGTA*)</source> <source>Savegames files (SGTA*)</source>
<translation>Fichiers de sauvegarde GTA (SGTA*)</translation> <translation>Fichiers de sauvegarde GTA (SGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="376"/> <location filename="../ProfileInterface.cpp" line="376"/>
<location filename="../UserInterface.cpp" line="317"/> <location filename="../UserInterface.cpp" line="336"/>
<source>Snapmatic pictures (PGTA*)</source> <source>Snapmatic pictures (PGTA*)</source>
<translation>Photos Snapmatic (PGTA*)</translation> <translation>Photos Snapmatic (PGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="378"/> <location filename="../ProfileInterface.cpp" line="378"/>
<location filename="../UserInterface.cpp" line="318"/> <location filename="../UserInterface.cpp" line="337"/>
<source>All files (**)</source> <source>All files (**)</source>
<translation>Tous les fichiers (**)</translation> <translation>Tous les fichiers (**)</translation>
</message> </message>
@ -697,19 +697,19 @@ Appuyer sur 1 pour le mode par défaut</translation>
<message> <message>
<location filename="../ProfileInterface.cpp" line="465"/> <location filename="../ProfileInterface.cpp" line="465"/>
<location filename="../ProfileInterface.cpp" line="663"/> <location filename="../ProfileInterface.cpp" line="663"/>
<location filename="../UserInterface.cpp" line="406"/> <location filename="../UserInterface.cpp" line="425"/>
<source>No valid file is selected</source> <source>No valid file is selected</source>
<translation>Fichier invalide</translation> <translation>Fichier invalide</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="492"/> <location filename="../ProfileInterface.cpp" line="492"/>
<location filename="../UserInterface.cpp" line="358"/> <location filename="../UserInterface.cpp" line="377"/>
<source>Failed to read Snapmatic picture</source> <source>Failed to read Snapmatic picture</source>
<translation>Impossible d&apos;ouvrir la photo Snapmatic</translation> <translation>Impossible d&apos;ouvrir la photo Snapmatic</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="508"/> <location filename="../ProfileInterface.cpp" line="508"/>
<location filename="../UserInterface.cpp" line="374"/> <location filename="../UserInterface.cpp" line="393"/>
<source>Failed to read Savegame file</source> <source>Failed to read Savegame file</source>
<translation>Impossible de lire le fichier de sauvegarde</translation> <translation>Impossible de lire le fichier de sauvegarde</translation>
</message> </message>
@ -720,7 +720,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<source>Failed to import the Snapmatic picture, file not begin with PGTA</source> <source>Failed to import the Snapmatic picture, file not begin with PGTA</source>
<translation>Impossible d&apos;importer la photo Snapmatic,nom de fichier incorrect (PGTA*)</translation> <translation type="vanished">Impossible d&apos;importer la photo Snapmatic,nom de fichier incorrect (PGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="373"/> <location filename="../ProfileInterface.cpp" line="373"/>
@ -831,13 +831,13 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>Impossible de supprimer la sélection</translation> <translation>Impossible de supprimer la sélection</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="314"/> <location filename="../UserInterface.cpp" line="333"/>
<source>All profile files (*.g5e SGTA* PGTA*)</source> <source>All profile files (*.g5e SGTA* PGTA*)</source>
<translation>Tous les fichiers de profil (*.g5e SGTA* PGTA*)</translation> <translation>Tous les fichiers de profil (*.g5e SGTA* PGTA*)</translation>
</message> </message>
<message> <message>
<location filename="../ProfileInterface.cpp" line="374"/> <location filename="../ProfileInterface.cpp" line="374"/>
<location filename="../UserInterface.cpp" line="315"/> <location filename="../UserInterface.cpp" line="334"/>
<source>GTA V Export (*.g5e)</source> <source>GTA V Export (*.g5e)</source>
<translation>GTA V Export (*.g5e)</translation> <translation>GTA V Export (*.g5e)</translation>
</message> </message>
@ -919,8 +919,8 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.ui" line="118"/> <location filename="../SavegameWidget.ui" line="118"/>
<location filename="../SavegameWidget.cpp" line="132"/> <location filename="../SavegameWidget.cpp" line="131"/>
<location filename="../SavegameWidget.cpp" line="145"/> <location filename="../SavegameWidget.cpp" line="144"/>
<source>Delete savegame</source> <source>Delete savegame</source>
<translation>Supprimer la sauvegarde</translation> <translation>Supprimer la sauvegarde</translation>
</message> </message>
@ -930,7 +930,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>Supprimer</translation> <translation>Supprimer</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="210"/> <location filename="../ProfileInterface.cpp" line="1107"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exporter</translation> <translation>&amp;Exporter</translation>
</message> </message>
@ -973,74 +973,74 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>Fichier invalide</translation> <translation>Fichier invalide</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="50"/> <location filename="../SavegameWidget.cpp" line="49"/>
<source>Export Savegame...</source> <source>Export Savegame...</source>
<translation>Exporter la sauvegarde...</translation> <translation>Exporter la sauvegarde...</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="57"/> <location filename="../SavegameWidget.cpp" line="56"/>
<source>AUTOSAVE - %1 <source>AUTOSAVE - %1
%2</source> %2</source>
<translation>SAUVEGARDE AUTO - %1 <translation>SAUVEGARDE AUTO - %1
%2</translation> %2</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="58"/> <location filename="../SavegameWidget.cpp" line="57"/>
<source>SAVE %3 - %1 <source>SAVE %3 - %1
%2</source> %2</source>
<translation>SAUVEGARDE %3 - %1 <translation>SAUVEGARDE %3 - %1
%2</translation> %2</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="93"/>
<location filename="../SavegameWidget.cpp" line="94"/> <location filename="../SavegameWidget.cpp" line="94"/>
<location filename="../SavegameWidget.cpp" line="95"/>
<source>WRONG FORMAT</source> <source>WRONG FORMAT</source>
<translation>Format invalide</translation> <translation>Format invalide</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="118"/> <location filename="../SavegameWidget.cpp" line="117"/>
<source>UNKNOWN</source> <source>UNKNOWN</source>
<translation>Inconnu</translation> <translation>Inconnu</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="132"/> <location filename="../SavegameWidget.cpp" line="131"/>
<source>Are you sure to delete %1 from your savegames?</source> <source>Are you sure to delete %1 from your savegames?</source>
<translation>Supprimer %1 ?</translation> <translation>Supprimer %1 ?</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="145"/> <location filename="../SavegameWidget.cpp" line="144"/>
<source>Failed at deleting %1 from your savegames</source> <source>Failed at deleting %1 from your savegames</source>
<translation>Impossible de supprimer %1</translation> <translation>Impossible de supprimer %1</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="209"/> <location filename="../ProfileInterface.cpp" line="1106"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>&amp;Voir</translation> <translation>&amp;Voir</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="211"/> <location filename="../ProfileInterface.cpp" line="1108"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>&amp;Supprimer</translation> <translation>&amp;Supprimer</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="215"/> <location filename="../ProfileInterface.cpp" line="1112"/>
<location filename="../SavegameWidget.cpp" line="227"/> <location filename="../ProfileInterface.cpp" line="1123"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>&amp;Sélectionner</translation> <translation>&amp;Sélectionner</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="216"/> <location filename="../ProfileInterface.cpp" line="1113"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>&amp;Déselectionner</translation> <translation>&amp;Déselectionner</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="217"/> <location filename="../ProfileInterface.cpp" line="1114"/>
<location filename="../SavegameWidget.cpp" line="228"/> <location filename="../ProfileInterface.cpp" line="1124"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>Sélectionner to&amp;ut</translation> <translation>Sélectionner to&amp;ut</translation>
</message> </message>
<message> <message>
<location filename="../SavegameWidget.cpp" line="221"/> <location filename="../ProfileInterface.cpp" line="1117"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>&amp;Déselectionner tout</translation> <translation>&amp;Déselectionner tout</translation>
</message> </message>
@ -1050,7 +1050,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="14"/> <location filename="../SnapmaticEditor.ui" line="14"/>
<location filename="../SnapmaticEditor.ui" line="81"/> <location filename="../SnapmaticEditor.ui" line="81"/>
<location filename="../SnapmaticEditor.cpp" line="216"/> <location filename="../SnapmaticEditor.cpp" line="247"/>
<source>Snapmatic Properties</source> <source>Snapmatic Properties</source>
<translation>Propriétés Snapmatic</translation> <translation>Propriétés Snapmatic</translation>
</message> </message>
@ -1084,7 +1084,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<source>Custom</source> <source>Custom</source>
<translation>Personnalisé</translation> <translation type="vanished">Personnalisé</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="101"/> <location filename="../SnapmaticEditor.ui" line="101"/>
@ -1098,39 +1098,80 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="125"/> <location filename="../SnapmaticEditor.ui" line="125"/>
<location filename="../SnapmaticEditor.cpp" line="297"/>
<source>Snapmatic Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="140"/>
<location filename="../SnapmaticEditor.cpp" line="200"/>
<source>Title: %1 (%2)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="156"/>
<location filename="../SnapmaticEditor.cpp" line="204"/>
<location filename="../SnapmaticEditor.cpp" line="208"/>
<source>Appropriate: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.ui" line="169"/>
<source>Extras</source> <source>Extras</source>
<translation>Extras</translation> <translation>Extras</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="131"/> <location filename="../SnapmaticEditor.ui" line="175"/>
<source>Qualify as Avatar automatically at apply</source> <source>Qualify as Avatar automatically at apply</source>
<translation>Qualifier comme Avatar</translation> <translation>Qualifier comme Avatar</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="144"/> <location filename="../SnapmaticEditor.ui" line="188"/>
<source>Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture</source> <source>Qualify as Avatar allows you to use this Snapmatic as a Social Club profile picture</source>
<translation>Qualifier comme Avatar permet d&apos;utiliser cette image en tant que photo de profil sur le Social Club</translation> <translation>Qualifier comme Avatar permet d&apos;utiliser cette image en tant que photo de profil sur le Social Club</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="194"/> <location filename="../SnapmaticEditor.ui" line="238"/>
<source>&amp;Apply</source> <source>&amp;Apply</source>
<translation>A&amp;ppliquer</translation> <translation>A&amp;ppliquer</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.ui" line="207"/> <location filename="../SnapmaticEditor.ui" line="251"/>
<source>&amp;Cancel</source> <source>&amp;Cancel</source>
<translation>A&amp;nnuler</translation> <translation>A&amp;nnuler</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticEditor.cpp" line="216"/> <location filename="../SnapmaticEditor.cpp" line="199"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="204"/>
<source>Yes</source>
<comment>Yes, should work fine</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="208"/>
<source>No</source>
<comment>No, could lead to issues</comment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../SnapmaticEditor.cpp" line="247"/>
<source>Patching of Snapmatic Properties failed because of I/O Error</source> <source>Patching of Snapmatic Properties failed because of I/O Error</source>
<translation>La modification des propriétés Snapmatic a échoué : erreur d&apos;entrée/sortie</translation> <translation>La modification des propriétés Snapmatic a échoué : erreur d&apos;entrée/sortie</translation>
</message> </message>
<message>
<location filename="../SnapmaticEditor.cpp" line="297"/>
<source>New Snapmatic title:</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>SnapmaticPicture</name> <name>SnapmaticPicture</name>
<message> <message>
<location filename="../SnapmaticPicture.cpp" line="349"/> <location filename="../SnapmaticPicture.cpp" line="370"/>
<source>PHOTO - %1</source> <source>PHOTO - %1</source>
<translation>PHOTO - %1</translation> <translation>PHOTO - %1</translation>
</message> </message>
@ -1179,8 +1220,8 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.ui" line="149"/> <location filename="../SnapmaticWidget.ui" line="149"/>
<location filename="../SnapmaticWidget.cpp" line="140"/> <location filename="../SnapmaticWidget.cpp" line="150"/>
<location filename="../SnapmaticWidget.cpp" line="153"/> <location filename="../SnapmaticWidget.cpp" line="163"/>
<source>Delete picture</source> <source>Delete picture</source>
<translation>Supprimer la photo</translation> <translation>Supprimer la photo</translation>
</message> </message>
@ -1190,79 +1231,79 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>Supprimer</translation> <translation>Supprimer</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="140"/> <location filename="../SnapmaticWidget.cpp" line="150"/>
<source>Are you sure to delete %1 from your Snapmatic pictures?</source> <source>Are you sure to delete %1 from your Snapmatic pictures?</source>
<translation>Supprimer %1 ?</translation> <translation>Supprimer %1 ?</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="153"/> <location filename="../SnapmaticWidget.cpp" line="163"/>
<source>Failed at deleting %1 from your Snapmatic pictures</source> <source>Failed at deleting %1 from your Snapmatic pictures</source>
<translation>Impossible de supprimer %1</translation> <translation>Impossible de supprimer %1</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="205"/> <location filename="../ProfileInterface.cpp" line="1065"/>
<source>Edi&amp;t</source> <source>Edi&amp;t</source>
<translation>Édi&amp;ter</translation> <translation>Édi&amp;ter</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="208"/> <location filename="../ProfileInterface.cpp" line="1068"/>
<source>Show &amp;In-game</source> <source>Show &amp;In-game</source>
<translation>&amp;Visible en jeu</translation> <translation>&amp;Visible en jeu</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="212"/> <location filename="../ProfileInterface.cpp" line="1072"/>
<source>Hide &amp;In-game</source> <source>Hide &amp;In-game</source>
<translation>&amp;Invisible en jeu</translation> <translation>&amp;Invisible en jeu</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="214"/> <location filename="../ProfileInterface.cpp" line="1074"/>
<source>&amp;Edit Properties...</source> <source>&amp;Edit Properties...</source>
<translation>Modifier les &amp;propriétés...</translation> <translation>Modifier les &amp;propriétés...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="215"/> <location filename="../ProfileInterface.cpp" line="1075"/>
<source>&amp;Export</source> <source>&amp;Export</source>
<translation>&amp;Exporter</translation> <translation>&amp;Exporter</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="216"/> <location filename="../ProfileInterface.cpp" line="1076"/>
<source>Export as &amp;JPG picture...</source> <source>Export as &amp;JPG picture...</source>
<translation>Exporter comme image &amp;JPG...</translation> <translation>Exporter comme image &amp;JPG...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="217"/> <location filename="../ProfileInterface.cpp" line="1077"/>
<source>Export as &amp;GTA Snapmatic...</source> <source>Export as &amp;GTA Snapmatic...</source>
<translation>Exporter comme &amp;GTA Snapmatic...</translation> <translation>Exporter comme &amp;GTA Snapmatic...</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="218"/> <location filename="../ProfileInterface.cpp" line="1078"/>
<source>&amp;View</source> <source>&amp;View</source>
<translation>&amp;Voir</translation> <translation>&amp;Voir</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="221"/> <location filename="../ProfileInterface.cpp" line="1081"/>
<source>&amp;Remove</source> <source>&amp;Remove</source>
<translation>S&amp;upprimer</translation> <translation>S&amp;upprimer</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="225"/> <location filename="../ProfileInterface.cpp" line="1085"/>
<location filename="../SnapmaticWidget.cpp" line="237"/> <location filename="../ProfileInterface.cpp" line="1096"/>
<source>&amp;Select</source> <source>&amp;Select</source>
<translation>&amp;Sélectionner</translation> <translation>&amp;Sélectionner</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="226"/> <location filename="../ProfileInterface.cpp" line="1086"/>
<source>&amp;Deselect</source> <source>&amp;Deselect</source>
<translation>&amp;Déselectionner</translation> <translation>&amp;Déselectionner</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="227"/> <location filename="../ProfileInterface.cpp" line="1087"/>
<location filename="../SnapmaticWidget.cpp" line="238"/> <location filename="../ProfileInterface.cpp" line="1097"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>Sélectionner &amp;tout</translation> <translation>Sélectionner &amp;tout</translation>
</message> </message>
<message> <message>
<location filename="../SnapmaticWidget.cpp" line="231"/> <location filename="../ProfileInterface.cpp" line="1090"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>&amp;Déselectionner tout</translation> <translation>&amp;Déselectionner tout</translation>
</message> </message>
@ -1271,7 +1312,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
<name>UserInterface</name> <name>UserInterface</name>
<message> <message>
<source>gta5sync - %1</source> <source>gta5sync - %1</source>
<translation>gta5sync - %1</translation> <translation type="vanished">gta5sync - %1</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="74"/> <location filename="../UserInterface.ui" line="74"/>
@ -1315,7 +1356,7 @@ Appuyer sur 1 pour le mode par défaut</translation>
</message> </message>
<message> <message>
<source>&amp;About gta5sync</source> <source>&amp;About gta5sync</source>
<translation>&amp;À propos de gta5sync</translation> <translation type="vanished">&amp;À propos de gta5sync</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="223"/> <location filename="../UserInterface.ui" line="223"/>
@ -1323,126 +1364,126 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>Ctrl+P</translation> <translation>Ctrl+P</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="232"/> <location filename="../UserInterface.ui" line="228"/>
<source>&amp;Exit</source> <source>&amp;Exit</source>
<translation>&amp;Quitter</translation> <translation>&amp;Quitter</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="235"/> <location filename="../UserInterface.ui" line="231"/>
<source>Exit</source> <source>Exit</source>
<translation>Quitter</translation> <translation>Quitter</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="238"/> <location filename="../UserInterface.ui" line="234"/>
<source>Ctrl+Q</source> <source>Ctrl+Q</source>
<translation>Ctrl+Q</translation> <translation>Ctrl+Q</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="243"/> <location filename="../UserInterface.ui" line="239"/>
<source>Close &amp;Profile</source> <source>Close &amp;Profile</source>
<translation>Fermer le &amp;profil</translation> <translation>Fermer le &amp;profil</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="246"/> <location filename="../UserInterface.ui" line="242"/>
<source>Ctrl+End</source> <source>Ctrl+End</source>
<translation>Ctrl + Fin</translation> <translation>Ctrl + Fin</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="255"/> <location filename="../UserInterface.ui" line="247"/>
<source>&amp;Settings</source> <source>&amp;Settings</source>
<translation>Paramètre&amp;s</translation> <translation>Paramètre&amp;s</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="258"/> <location filename="../UserInterface.ui" line="250"/>
<source>Ctrl+S</source> <source>Ctrl+S</source>
<translation>Ctrl+S</translation> <translation>Ctrl+S</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="263"/> <location filename="../UserInterface.ui" line="255"/>
<source>Select &amp;All</source> <source>Select &amp;All</source>
<translation>Sélectionner &amp;tout</translation> <translation>Sélectionner &amp;tout</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="266"/> <location filename="../UserInterface.ui" line="258"/>
<source>Ctrl+A</source> <source>Ctrl+A</source>
<translation>Ctrl+A</translation> <translation>Ctrl+A</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="271"/> <location filename="../UserInterface.ui" line="263"/>
<source>&amp;Deselect All</source> <source>&amp;Deselect All</source>
<translation>&amp;Désélectionner tout</translation> <translation>&amp;Désélectionner tout</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="274"/> <location filename="../UserInterface.ui" line="266"/>
<source>Ctrl+D</source> <source>Ctrl+D</source>
<translation>Ctrl+D</translation> <translation>Ctrl+D</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="279"/> <location filename="../UserInterface.ui" line="271"/>
<source>&amp;Export selected...</source> <source>&amp;Export selected...</source>
<translation>&amp;Exporter la sélection...</translation> <translation>&amp;Exporter la sélection...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="282"/> <location filename="../UserInterface.ui" line="274"/>
<source>Ctrl+E</source> <source>Ctrl+E</source>
<translation>Ctrl+E</translation> <translation>Ctrl+E</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="287"/> <location filename="../UserInterface.ui" line="279"/>
<source>&amp;Remove selected</source> <source>&amp;Remove selected</source>
<translation>&amp;Supprimer la sélection</translation> <translation>&amp;Supprimer la sélection</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="290"/> <location filename="../UserInterface.ui" line="282"/>
<source>Ctrl+Del</source> <source>Ctrl+Del</source>
<translation>Ctrl+Del</translation> <translation>Ctrl+Del</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="295"/> <location filename="../UserInterface.ui" line="287"/>
<source>&amp;Import files...</source> <source>&amp;Import files...</source>
<translation>&amp;Importer...</translation> <translation>&amp;Importer...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="298"/> <location filename="../UserInterface.ui" line="290"/>
<source>Ctrl+I</source> <source>Ctrl+I</source>
<translation>Ctrl+I</translation> <translation>Ctrl+I</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="303"/> <location filename="../UserInterface.ui" line="295"/>
<source>&amp;Open File...</source> <source>&amp;Open File...</source>
<translation>&amp;Ouvrir...</translation> <translation>&amp;Ouvrir...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="306"/> <location filename="../UserInterface.ui" line="298"/>
<source>Ctrl+O</source> <source>Ctrl+O</source>
<translation>Ctrl+O</translation> <translation>Ctrl+O</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="311"/> <location filename="../UserInterface.ui" line="303"/>
<location filename="../UserInterface.cpp" line="131"/> <location filename="../UserInterface.cpp" line="144"/>
<source>Select &amp;GTA V Folder...</source> <source>Select &amp;GTA V Folder...</source>
<translation>Modifier l&apos;emplacement de &amp;GTA V...</translation> <translation>Modifier l&apos;emplacement de &amp;GTA V...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="314"/> <location filename="../UserInterface.ui" line="306"/>
<location filename="../OptionsDialog.cpp" line="444"/> <location filename="../OptionsDialog.cpp" line="444"/>
<location filename="../UserInterface.cpp" line="80"/> <location filename="../UserInterface.cpp" line="93"/>
<location filename="../UserInterface.cpp" line="455"/> <location filename="../UserInterface.cpp" line="474"/>
<source>Select GTA V Folder...</source> <source>Select GTA V Folder...</source>
<translation>Modifier l&apos;emplacement de GTA V...</translation> <translation>Modifier l&apos;emplacement de GTA V...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="317"/> <location filename="../UserInterface.ui" line="309"/>
<source>Ctrl+G</source> <source>Ctrl+G</source>
<translation>Ctrl+G</translation> <translation>Ctrl+G</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="322"/> <location filename="../UserInterface.ui" line="314"/>
<source>Show In-gam&amp;e</source> <source>Show In-gam&amp;e</source>
<translation>Rendre visible &amp;en jeu</translation> <translation>Rendre visible &amp;en jeu</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="325"/> <location filename="../UserInterface.ui" line="317"/>
<source>Shift+E</source> <source>Shift+E</source>
<translation>Shift+E</translation> <translation>Shift+E</translation>
</message> </message>
@ -1452,48 +1493,48 @@ Appuyer sur 1 pour le mode par défaut</translation>
<translation>&amp;Visibilité de la sélection</translation> <translation>&amp;Visibilité de la sélection</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="330"/> <location filename="../UserInterface.ui" line="322"/>
<source>Hi&amp;de In-game</source> <source>Hi&amp;de In-game</source>
<translation>Ren&amp;dre invisible en jeu</translation> <translation>Ren&amp;dre invisible en jeu</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="333"/> <location filename="../UserInterface.ui" line="325"/>
<source>Shift+D</source> <source>Shift+D</source>
<translation>Shift+D</translation> <translation>Shift+D</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="20"/> <location filename="../UserInterface.ui" line="20"/>
<location filename="../UserInterface.cpp" line="59"/> <location filename="../UserInterface.cpp" line="60"/>
<source>%2 - %1</source> <source>%2 - %1</source>
<translation>%2 - %1</translation> <translation>%2 - %1</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.ui" line="220"/> <location filename="../UserInterface.ui" line="220"/>
<location filename="../UserInterface.cpp" line="58"/> <location filename="../UserInterface.cpp" line="59"/>
<source>&amp;About %1</source> <source>&amp;About %1</source>
<translation>&amp;À propos de %1</translation> <translation>&amp;À propos de %1</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="61"/> <location filename="../UserInterface.cpp" line="62"/>
<location filename="../UserInterface.cpp" line="201"/> <location filename="../UserInterface.cpp" line="214"/>
<source>Select Profile</source> <source>Select Profile</source>
<translation>Sélectionner un profil</translation> <translation>Sélectionner un profil</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="311"/> <location filename="../UserInterface.cpp" line="330"/>
<source>Open File...</source> <source>Open File...</source>
<translation>Ouvrir...</translation> <translation>Ouvrir...</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="358"/> <location filename="../UserInterface.cpp" line="377"/>
<location filename="../UserInterface.cpp" line="374"/> <location filename="../UserInterface.cpp" line="393"/>
<location filename="../UserInterface.cpp" line="401"/> <location filename="../UserInterface.cpp" line="420"/>
<location filename="../UserInterface.cpp" line="406"/> <location filename="../UserInterface.cpp" line="425"/>
<source>Open File</source> <source>Open File</source>
<translation>Ouvrir</translation> <translation>Ouvrir</translation>
</message> </message>
<message> <message>
<location filename="../UserInterface.cpp" line="401"/> <location filename="../UserInterface.cpp" line="420"/>
<source>Can&apos;t open %1 because of not valid file format</source> <source>Can&apos;t open %1 because of not valid file format</source>
<translation>Impossible d&apos;ouvrir %1, format invalide</translation> <translation>Impossible d&apos;ouvrir %1, format invalide</translation>
</message> </message>

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016-2017 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -17,6 +17,7 @@
*****************************************************************************/ *****************************************************************************/
#include "UiModLabel.h" #include "UiModLabel.h"
#include <QPaintEvent>
#include <QMouseEvent> #include <QMouseEvent>
UiModLabel::UiModLabel(const QString &text, QWidget *parent) : QLabel(parent) UiModLabel::UiModLabel(const QString &text, QWidget *parent) : QLabel(parent)
@ -37,6 +38,12 @@ UiModLabel::~UiModLabel()
{ {
} }
void UiModLabel::paintEvent(QPaintEvent *ev)
{
QLabel::paintEvent(ev);
emit labelPainted();
}
void UiModLabel::mouseMoveEvent(QMouseEvent *ev) void UiModLabel::mouseMoveEvent(QMouseEvent *ev)
{ {
QLabel::mouseMoveEvent(ev); QLabel::mouseMoveEvent(ev);

View File

@ -1,6 +1,6 @@
/***************************************************************************** /*****************************************************************************
* gta5sync GRAND THEFT AUTO V SYNC * gta5sync GRAND THEFT AUTO V SYNC
* Copyright (C) 2016 Syping * Copyright (C) 2016-2017 Syping
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -38,6 +38,7 @@ protected:
void mousePressEvent(QMouseEvent *ev); void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev); void mouseReleaseEvent(QMouseEvent *ev);
void mouseDoubleClickEvent(QMouseEvent *ev); void mouseDoubleClickEvent(QMouseEvent *ev);
void paintEvent(QPaintEvent *ev);
void resizeEvent(QResizeEvent *ev); void resizeEvent(QResizeEvent *ev);
signals: signals:
@ -45,6 +46,7 @@ signals:
void mousePressed(Qt::MouseButton button); void mousePressed(Qt::MouseButton button);
void mouseReleased(Qt::MouseButton button); void mouseReleased(Qt::MouseButton button);
void mouseDoubleClicked(Qt::MouseButton button); void mouseDoubleClicked(Qt::MouseButton button);
void labelPainted();
void resized(QSize newSize); void resized(QSize newSize);
}; };