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),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
aboutStr = ui->labAbout->text();
titleStr = this->windowTitle();
// Set Window Flags
setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
// Build Strings
QString appVersion = qApp->applicationVersion();
QString buildType = GTA5SYNC_BUILDTYPE;
buildType.replace("_", " ");
@ -38,6 +39,11 @@ AboutDialog::AboutDialog(QWidget *parent) :
#else
QString projectDes = tr("A project for viewing Grand Theft Auto V Snapmatic<br/>\nPictures and Savegames");
#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));
this->setWindowTitle(titleStr.arg(GTA5SYNC_APPSTR));

View File

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

View File

@ -23,6 +23,15 @@
#include <QImage>
#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) :
QDialog(parent),
ui(new Ui::ImportDialog)
@ -51,7 +60,7 @@ ImportDialog::~ImportDialog()
void ImportDialog::processImage()
{
QImage snapmaticImage = workImage;
QPixmap snapmaticPixmap(960, 536);
QPixmap snapmaticPixmap(snapmaticResolutionW, snapmaticResolutionH);
snapmaticPixmap.fill(Qt::black);
QPainter snapmaticPainter(&snapmaticPixmap);
if (ui->cbAvatar->isChecked())
@ -61,24 +70,23 @@ void ImportDialog::processImage()
int diffHeight = 0;
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())
{
diffHeight = 470 - snapmaticImage.height();
diffHeight = snapmaticAvatarResolution - snapmaticImage.height();
diffHeight = diffHeight / 2;
}
else if (snapmaticImage.width() < snapmaticImage.height())
{
diffWidth = 470 - snapmaticImage.width();
diffWidth = snapmaticAvatarResolution - snapmaticImage.width();
diffWidth = diffWidth / 2;
}
}
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(145 + diffWidth, 66 + diffHeight, snapmaticImage);
snapmaticPainter.drawImage(snapmaticAvatarPlacementW + diffWidth, snapmaticAvatarPlacementH + diffHeight, snapmaticImage);
imageTitle = "Custom Avatar";
}
else
@ -88,28 +96,28 @@ void ImportDialog::processImage()
int diffHeight = 0;
if (ui->rbKeep->isChecked())
{
snapmaticImage = snapmaticImage.scaled(960, 536, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (snapmaticImage.width() != 960)
snapmaticImage = snapmaticImage.scaled(snapmaticResolutionW, snapmaticResolutionH, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (snapmaticImage.width() != snapmaticResolutionW)
{
diffWidth = 960 - snapmaticImage.width();
diffWidth = snapmaticResolutionW - snapmaticImage.width();
diffWidth = diffWidth / 2;
}
else if (snapmaticImage.height() != 536)
else if (snapmaticImage.height() != snapmaticResolutionH)
{
diffHeight = 536 - snapmaticImage.height();
diffHeight = snapmaticResolutionH - snapmaticImage.height();
diffHeight = diffHeight / 2;
}
}
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);
imageTitle = "Custom Picture";
}
snapmaticPainter.end();
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()
@ -162,3 +170,13 @@ void ImportDialog::on_cmdOK_clicked()
doImport = true;
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_cmdCancel_clicked();
void on_cmdOK_clicked();
void on_labPicture_labelPainted();
private:
Ui::ImportDialog *ui;

View File

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

View File

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

View File

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

View File

@ -76,7 +76,7 @@ void PictureExport::exportAsPicture(QWidget *parent, SnapmaticPicture *picture)
settings.beginGroup("FileDialogs");
settings.beginGroup("ExportAsPicture");
fileDialogPreSave:
fileDialogPreSave: //Work?
QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile);
fileDialog.setViewMode(QFileDialog::Detail);
@ -145,12 +145,12 @@ fileDialogPreSave:
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+"\""));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
else
{
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
@ -179,13 +179,13 @@ fileDialogPreSave:
if (!isSaved)
{
QMessageBox::warning(parent, PictureDialog::tr("Export as JPG picture"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
else
{
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);
}
fileDialogPreSave:
fileDialogPreSave: //Work?
QFileInfo sgdFileInfo(adjustedPicPath);
QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile);
@ -218,7 +218,7 @@ fileDialogPreSave:
fileDialog.setDefaultSuffix(".rem");
fileDialog.setWindowFlags(fileDialog.windowFlags()^Qt::WindowContextHelpButtonHint);
fileDialog.setWindowTitle(PictureDialog::tr("Export as GTA Snapmatic..."));
fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("&Export"));
fileDialog.setLabelText(QFileDialog::Accept, PictureDialog::tr("Export"));
QStringList filters;
filters << PictureDialog::tr("GTA V Export (*.g5e)");
@ -248,12 +248,12 @@ fileDialogPreSave:
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+"\""));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
else
{
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
@ -263,7 +263,7 @@ fileDialogPreSave:
if (!isExported)
{
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
else
@ -284,7 +284,7 @@ fileDialogPreSave:
if (!isCopied)
{
QMessageBox::warning(parent, PictureDialog::tr("Export as GTA Snapmatic"), PictureDialog::tr("Failed to export current Snapmatic picture"));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
else
{
@ -295,7 +295,7 @@ fileDialogPreSave:
else
{
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 <QPainter>
#include <QRegExp>
#include <QAction>
#include <QDebug>
#include <QColor>
#include <QTimer>
@ -79,22 +80,18 @@ ProfileInterface::~ProfileInterface()
foreach(ProfileWidget *widget, widgets.keys())
{
widgets.remove(widget);
widget->deleteLater();
delete widget;
}
foreach(SavegameData *savegame, savegames)
{
savegames.removeAll(savegame);
savegame->deleteLater();
delete savegame;
}
foreach(SnapmaticPicture *picture, pictures)
{
pictures.removeAll(picture);
picture->deleteLater();
delete picture;
}
profileLoader->deleteLater();
delete profileLoader;
delete ui;
@ -318,32 +315,50 @@ void ProfileInterface::profileLoaded_p()
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();
if (sgdWidget->isSelected()) { sgdWidget->setSelected(false); }
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);
delete savegame;
}
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();
if (picWidget->isSelected()) { picWidget->setSelected(false); }
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);
delete picture;
}
@ -359,7 +374,7 @@ void ProfileInterface::on_cmdImport_clicked()
settings.beginGroup("FileDialogs");
settings.beginGroup("ImportCopy");
fileDialogPreOpen:
fileDialogPreOpen: //Work?
QFileDialog fileDialog(this);
fileDialog.setFileMode(QFileDialog::ExistingFiles);
fileDialog.setViewMode(QFileDialog::Detail);
@ -390,7 +405,7 @@ fileDialogPreOpen:
if (selectedFiles.length() == 1)
{
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)
{
@ -463,7 +478,7 @@ fileDialogPreOpen:
else
{
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())
{
exportThread->deleteLater();
delete exportThread;
}
else
@ -928,7 +942,6 @@ void ProfileInterface::exportSelected()
QEventLoop threadFinishLoop;
QObject::connect(exportThread, SIGNAL(finished()), &threadFinishLoop, SLOT(quit()));
threadFinishLoop.exec();
exportThread->deleteLater();
delete exportThread;
}
}
@ -954,8 +967,7 @@ void ProfileInterface::deleteSelected()
if (widget->getWidgetType() == "SnapmaticWidget")
{
SnapmaticWidget *picWidget = (SnapmaticWidget*)widget;
QString fileName = picWidget->getPicturePath();
if (!QFile::exists(fileName) || QFile::remove(fileName))
if (picWidget->getPicture()->deletePicFile())
{
pictureDeleted(picWidget);
}

View File

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

View File

@ -34,7 +34,7 @@ void SavegameCopy::copySavegame(QWidget *parent, QString sgdPath)
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
settings.beginGroup("FileDialogs");
fileDialogPreSave:
fileDialogPreSave: //Work?
QFileInfo sgdFileInfo(sgdPath);
QFileDialog fileDialog(parent);
fileDialog.setFileMode(QFileDialog::AnyFile);
@ -72,12 +72,12 @@ fileDialogPreSave:
if (!QFile::remove(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
{
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
@ -85,13 +85,13 @@ fileDialogPreSave:
if (!isCopied)
{
QMessageBox::warning(parent, SavegameWidget::tr("Export Savegame"), SavegameWidget::tr("Failed to export current Savegame"));
goto fileDialogPreSave;
goto fileDialogPreSave; //Work?
}
}
else
{
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 "SavegameData.h"
#include <QTextCodec>
#include <QByteArray>
#include <QDebug>
#include <QFile>
#define savegameHeaderLength 260
#define verificationValue QByteArray::fromHex("00000001")
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
savegameStr = "";
savegameOk = 0;

View File

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

View File

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

View File

@ -19,6 +19,9 @@
#include "SnapmaticEditor.h"
#include "ui_SnapmaticEditor.h"
#include "SnapmaticPicture.h"
#include "StringParser.h"
#include <QTextDocument>
#include <QInputDialog>
#include <QMessageBox>
#include <QDebug>
#include <QFile>
@ -42,6 +45,7 @@ SnapmaticEditor::SnapmaticEditor(QWidget *parent) :
ui->cmdCancel->setIcon(QIcon::fromTheme("dialog-cancel"));
}
snapmaticTitle = "";
smpic = 0;
}
@ -179,6 +183,30 @@ void SnapmaticEditor::setSnapmaticPicture(SnapmaticPicture *picture)
{
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()
@ -210,10 +238,19 @@ void SnapmaticEditor::on_cmdApply_clicked()
{
QFile::copy(adjustedFileName, backupFileName);
}
SnapmaticProperties fallbackProperties = smpic->getSnapmaticProperties();
QString fallbackTitle = smpic->getPictureTitle();
smpic->setSnapmaticProperties(localSpJson);
smpic->setPictureTitle(snapmaticTitle);
if (!smpic->exportPicture(originalFileName))
{
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();
@ -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:
explicit SnapmaticEditor(QWidget *parent = 0);
void setSnapmaticPicture(SnapmaticPicture *picture);
void setSnapmaticTitle(const QString &title);
~SnapmaticEditor();
private slots:
@ -47,11 +48,13 @@ private slots:
void on_cmdCancel_clicked();
void on_cmdApply_clicked();
void on_cbQualify_toggled(bool checked);
void on_labTitle_linkActivated(const QString &link);
private:
Ui::SnapmaticEditor *ui;
SnapmaticProperties localSpJson;
SnapmaticPicture *smpic;
QString snapmaticTitle;
void qualifyAvatar();
};

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>375</width>
<height>319</height>
<width>400</width>
<height>350</height>
</rect>
</property>
<property name="windowTitle">
@ -119,6 +119,50 @@
</layout>
</widget>
</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>
<widget class="QGroupBox" name="gbExtras">
<property name="title">
@ -133,7 +177,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="labQualify">
<widget class="UiModLabel" name="labQualify">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
@ -212,6 +256,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>UiModLabel</class>
<extends>QLabel</extends>
<header>UiModLabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -29,6 +29,7 @@
#include <QBuffer>
#include <QDebug>
#include <QImage>
#include <QSize>
#include <QFile>
// PARSER ALLOCATIONS
@ -49,11 +50,13 @@
#define titlStreamEditorLength 256
#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)
{
// PREDEFINED PROPERTIES
snapmaticResolution = QSize(960, 536);
reset();
}
@ -65,7 +68,7 @@ void SnapmaticPicture::reset()
{
// INIT PIC
rawPicContent = "";
cachePicture = QImage(0, 0, QImage::Format_RGB888);
cachePicture = QImage();
jpegRawContentSize = 0;
picExportFileName = "";
isCustomFormat = 0;
@ -483,51 +486,6 @@ bool SnapmaticPicture::setPictureTitl(const QString &newTitle_)
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()
{
return picExportFileName;
@ -655,24 +613,34 @@ bool SnapmaticPicture::isPicOk()
return picOk;
}
void SnapmaticPicture::setPicFileName(QString picFileName_)
{
picFileName = picFileName_;
}
void SnapmaticPicture::setPicFilePath(QString picFilePath_)
{
picFilePath = picFilePath_;
}
void SnapmaticPicture::clearCache()
{
cacheEnabled = false;
cachePicture = QImage(0, 0, QImage::Format_RGB888);
cachePicture = QImage();
}
void SnapmaticPicture::emitUpdate()
{
emit updated();
}
// JSON part
bool SnapmaticPicture::isJsonOk()
{
return jsonOk;
}
QString SnapmaticPicture::getJsonStr()
{
return jsonStr;
}
SnapmaticProperties SnapmaticPicture::getSnapmaticProperties()
{
return localSpJson;
}
void SnapmaticPicture::parseJsonContent()
{
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8());
@ -733,21 +701,6 @@ void SnapmaticPicture::parseJsonContent()
jsonOk = true;
}
bool SnapmaticPicture::isJsonOk()
{
return jsonOk;
}
QString SnapmaticPicture::getJsonStr()
{
return jsonStr;
}
SnapmaticProperties SnapmaticPicture::getSnapmaticProperties()
{
return localSpJson;
}
bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson)
{
QJsonDocument jsonDocument = QJsonDocument::fromJson(jsonStr.toUtf8());
@ -811,6 +764,70 @@ bool SnapmaticPicture::setSnapmaticProperties(SnapmaticProperties newSpJson)
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
bool SnapmaticPicture::isHidden()

View File

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

View File

@ -23,6 +23,7 @@
#include "DatabaseThread.h"
#include "PictureDialog.h"
#include "PictureExport.h"
#include "StringParser.h"
#include "config.h"
#include <QMessageBox>
#include <QPixmap>
@ -84,6 +85,7 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
picPath = picture->getPictureFilePath();
picTitl = picture->getPictureTitl();
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);
ui->labPicStr->setText(picStr + "\n" + picTitl + "");
@ -94,6 +96,15 @@ void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture)
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()
{
QSettings settings(GTA5SYNC_APPVENDOR, GTA5SYNC_APPSTR);
@ -102,7 +113,6 @@ void SnapmaticWidget::on_cmdView_clicked()
settings.endGroup();
PictureDialog *picDialog = new PictureDialog(profileDB, crewDB, this);
picDialog->setWindowFlags(picDialog->windowFlags()^Qt::WindowContextHelpButtonHint);
picDialog->setSnapmaticPicture(smpic, true);
picDialog->setModal(true);
@ -135,23 +145,25 @@ void SnapmaticWidget::on_cmdExport_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);
if (uchoice == QMessageBox::Yes)
{
if (!QFile::exists(picPath))
if (smpic->deletePicFile())
{
emit pictureDeleted();
}
else if(QFile::remove(picPath))
{
emit pictureDeleted();
return true;
}
else
{
QMessageBox::warning(this, tr("Delete picture"), tr("Failed at deleting %1 from your Snapmatic pictures").arg("\""+picStr+"\""));
}
}
return false;
}
void SnapmaticWidget::mousePressEvent(QMouseEvent *ev)

View File

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

View File

@ -18,6 +18,7 @@
#include "StringParser.h"
#include "config.h"
#include <QTextDocument>
#include <QApplication>
#include <QTextCodec>
#include <QByteArray>
@ -60,3 +61,12 @@ QString StringParser::convertBuildedString(const QString &buildedStr)
outputStr.replace("$SEPARATOR", QDir::separator());
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 convertLogStringForDraw(const QString &inputStr);
static QString convertBuildedString(const QString &buildedStr);
static QString escapeString(const QString &toEscape);
};
#endif // STRINGPARSER_H

View File

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

View File

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

View File

@ -1,5 +1,5 @@
Community translation files
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
Community translation files
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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by
@ -17,6 +17,7 @@
*****************************************************************************/
#include "UiModLabel.h"
#include <QPaintEvent>
#include <QMouseEvent>
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)
{
QLabel::mouseMoveEvent(ev);

View File

@ -1,6 +1,6 @@
/*****************************************************************************
* 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
* it under the terms of the GNU General Public License as published by
@ -38,6 +38,7 @@ protected:
void mousePressEvent(QMouseEvent *ev);
void mouseReleaseEvent(QMouseEvent *ev);
void mouseDoubleClickEvent(QMouseEvent *ev);
void paintEvent(QPaintEvent *ev);
void resizeEvent(QResizeEvent *ev);
signals:
@ -45,6 +46,7 @@ signals:
void mousePressed(Qt::MouseButton button);
void mouseReleased(Qt::MouseButton button);
void mouseDoubleClicked(Qt::MouseButton button);
void labelPainted();
void resized(QSize newSize);
};