From 7d099291ad7115b25b078b661d35681721c6e1a4 Mon Sep 17 00:00:00 2001
From: Rafael <Syping@users.noreply.github.com>
Date: Sun, 27 Mar 2016 09:52:23 +0200
Subject: [PATCH] picture parsing is now on Thread, design changes

---
 CrewDatabase.cpp           |   4 +--
 CrewDatabase.h             |   2 +-
 DatabaseThread.cpp         |   2 +-
 DatabaseThread.h           |   2 +-
 PictureDialog.cpp          |   4 +--
 PictureDialog.h            |   2 +-
 ProfileDatabase.cpp        |   4 +--
 ProfileDatabase.h          |   2 +-
 ProfileInterface.cpp       |  53 +++++++++++------------------
 ProfileInterface.h         |   6 +++-
 ProfileInterface.ui        |  11 ++++---
 ProfileLoader.cpp          |  66 +++++++++++++++++++++++++++++++++++++
 ProfileLoader.h            |  46 ++++++++++++++++++++++++++
 SavegameData.cpp           |   2 +-
 SavegameData.h             |   2 +-
 SavegameWidget.cpp         |   2 +-
 SavegameWidget.h           |   2 +-
 SavegameWidget.ui          |  33 +++++++++++--------
 SnapmaticPicture.cpp       |  14 ++++----
 SnapmaticPicture.h         |  10 +++---
 SnapmaticWidget.cpp        |   4 +--
 SnapmaticWidget.h          |   2 +-
 SnapmaticWidget.ui         |  19 ++++-------
 SyncFramework.cpp          |   2 +-
 SyncFramework.h            |   2 +-
 UserInterface.cpp          |   4 +--
 UserInterface.h            |   2 +-
 UserInterface.ui           |  10 +++---
 app.qrc                    |   3 ++
 app.rc                     |   4 +--
 gta5sync.pro               |   8 +++--
 main.cpp                   |   4 +--
 qjson4/QJsonArray.cpp      |   2 +-
 qjson4/QJsonArray.h        |   2 +-
 qjson4/QJsonDocument.cpp   |   2 +-
 qjson4/QJsonDocument.h     |   2 +-
 qjson4/QJsonObject.cpp     |   2 +-
 qjson4/QJsonObject.h       |   2 +-
 qjson4/QJsonParseError.cpp |   2 +-
 qjson4/QJsonParseError.h   |   2 +-
 qjson4/QJsonParser.cpp     |   2 +-
 qjson4/QJsonParser.h       |   2 +-
 qjson4/QJsonRoot.h         |   2 +-
 qjson4/QJsonValue.cpp      |   2 +-
 qjson4/QJsonValue.h        |   2 +-
 qjson4/QJsonValueRef.cpp   |   2 +-
 qjson4/QJsonValueRef.h     |   2 +-
 savegame.png               | Bin 0 -> 1403 bytes
 48 files changed, 235 insertions(+), 128 deletions(-)
 create mode 100755 ProfileLoader.cpp
 create mode 100755 ProfileLoader.h
 create mode 100755 savegame.png

diff --git a/CrewDatabase.cpp b/CrewDatabase.cpp
index 09e5639..ab4f2f9 100755
--- a/CrewDatabase.cpp
+++ b/CrewDatabase.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -38,7 +38,7 @@ CrewDatabase::CrewDatabase(QObject *parent) : QObject(parent)
     QString dirPath = dir.absolutePath();
     QString defaultConfPath = dirPath + "/crews.ini";
 
-    QSettings confPathSettings("Syping Gaming Team","gta5sync");
+    QSettings confPathSettings("Syping","gta5sync");
     confPathSettings.beginGroup("Database");
     QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString();
     confPathSettings.endGroup();
diff --git a/CrewDatabase.h b/CrewDatabase.h
index e4e32d6..a480548 100755
--- a/CrewDatabase.h
+++ b/CrewDatabase.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/DatabaseThread.cpp b/DatabaseThread.cpp
index 379b2f6..8e5eeb8 100755
--- a/DatabaseThread.cpp
+++ b/DatabaseThread.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/DatabaseThread.h b/DatabaseThread.h
index 9ca9081..631c4be 100755
--- a/DatabaseThread.h
+++ b/DatabaseThread.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/PictureDialog.cpp b/PictureDialog.cpp
index 4213407..037500a 100755
--- a/PictureDialog.cpp
+++ b/PictureDialog.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -68,7 +68,7 @@ void PictureDialog::setSnapmaticPicture(SnapmaticPicture *picture, bool readOk)
 
     if (picture->isPicOk())
     {
-        ui->labPicture->setPixmap(picture->getPixmap());
+        ui->labPicture->setPixmap(QPixmap::fromImage(picture->getPicture(), Qt::AutoColor));
         ui->cmdExport->setEnabled(true);
     }
     if (picture->isJsonOk())
diff --git a/PictureDialog.h b/PictureDialog.h
index 1456859..93d728d 100755
--- a/PictureDialog.h
+++ b/PictureDialog.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/ProfileDatabase.cpp b/ProfileDatabase.cpp
index d737a9a..17829e2 100755
--- a/ProfileDatabase.cpp
+++ b/ProfileDatabase.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -38,7 +38,7 @@ ProfileDatabase::ProfileDatabase(QObject *parent) : QObject(parent)
     QString dirPath = dir.absolutePath();
     QString defaultConfPath = dirPath + "/players.ini";
 
-    QSettings confPathSettings("Syping Gaming Team","gta5sync");
+    QSettings confPathSettings("Syping","gta5sync");
     confPathSettings.beginGroup("Database");
     QString confPathFile = confPathSettings.value("Location", defaultConfPath).toString();
     confPathSettings.endGroup();
diff --git a/ProfileDatabase.h b/ProfileDatabase.h
index bbe1f26..4c4e463 100755
--- a/ProfileDatabase.h
+++ b/ProfileDatabase.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp
index b15f8b3..3c1d9fa 100755
--- a/ProfileInterface.cpp
+++ b/ProfileInterface.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -20,6 +20,7 @@
 #include "ui_ProfileInterface.h"
 #include "SnapmaticWidget.h"
 #include "SavegameWidget.h"
+#include "ProfileLoader.h"
 #include <QSpacerItem>
 #include <QFileInfo>
 #include <QRegExp>
@@ -50,42 +51,26 @@ void ProfileInterface::setProfileFolder(QString folder, QString profile)
 
 void ProfileInterface::setupProfileInterface()
 {
-    QDir profileDir;
-    profileDir.setPath(profileFolder);
     ui->labProfileContent->setText(contentStr.arg(profileName));
 
-    profileDir.setNameFilters(QStringList("PGTA*"));
-    QStringList SnapmaticPics = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
-    foreach(const QString &SnapmaticPic, SnapmaticPics)
-    {
-        QString picturePath = profileFolder + "/" + SnapmaticPic;
-        SnapmaticPicture *picture = new SnapmaticPicture(picturePath);
-        if (picture->readingPicture())
-        {
-            SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB);
-            picWidget->setSnapmaticPicture(picture, picturePath);
-            ui->vlSnapmatic->addWidget(picWidget);
-            crewDB->addCrew(picture->getCrewNumber());
-        }
-    }
-    QSpacerItem *snapmaticSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
-    ui->vlSnapmatic->addSpacerItem(snapmaticSpacer);
+    ProfileLoader *profileLoader = new ProfileLoader(profileFolder, crewDB);
+    QObject::connect(profileLoader, SIGNAL(savegameLoaded(SavegameData*, QString)), this, SLOT(on_savegameLoaded(SavegameData*, QString)));
+    QObject::connect(profileLoader, SIGNAL(pictureLoaded(SnapmaticPicture*, QString)), this, SLOT(on_pictureLoaded(SnapmaticPicture*, QString)));
+    profileLoader->start();
+}
 
-    profileDir.setNameFilters(QStringList("SGTA*"));
-    QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
-    foreach(const QString &SavegameFile, SavegameFiles)
-    {
-        QString sgdPath = profileFolder + "/" + SavegameFile;
-        SavegameData *savegame = new SavegameData(sgdPath);
-        if (savegame->readingSavegame())
-        {
-            SavegameWidget *sgdWidget = new SavegameWidget();
-            sgdWidget->setSavegameData(savegame, sgdPath);
-            ui->vlSavegame->addWidget(sgdWidget);
-        }
-    }
-    QSpacerItem *savegameSpacer = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding);
-    ui->vlSavegame->addSpacerItem(savegameSpacer);
+void ProfileInterface::on_savegameLoaded(SavegameData *savegame, QString savegamePath)
+{
+    SavegameWidget *sgdWidget = new SavegameWidget();
+    sgdWidget->setSavegameData(savegame, savegamePath);
+    ui->vlSavegame->addWidget(sgdWidget);
+}
+
+void ProfileInterface::on_pictureLoaded(SnapmaticPicture *picture, QString picturePath)
+{
+    SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB);
+    picWidget->setSnapmaticPicture(picture, picturePath);
+    ui->vlSnapmatic->addWidget(picWidget);
 }
 
 void ProfileInterface::on_cmdCloseProfile_clicked()
diff --git a/ProfileInterface.h b/ProfileInterface.h
index 2944412..8af4375 100755
--- a/ProfileInterface.h
+++ b/ProfileInterface.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -19,7 +19,9 @@
 #ifndef PROFILEINTERFACE_H
 #define PROFILEINTERFACE_H
 
+#include "SnapmaticPicture.h"
 #include "ProfileDatabase.h"
+#include "SavegameData.h"
 #include "CrewDatabase.h"
 #include <QWidget>
 
@@ -38,6 +40,8 @@ public:
 
 private slots:
     void on_cmdCloseProfile_clicked();
+    void on_pictureLoaded(SnapmaticPicture *picture, QString picturePath);
+    void on_savegameLoaded(SavegameData *savegame, QString savegamePath);
 
 private:
     ProfileDatabase *profileDB;
diff --git a/ProfileInterface.ui b/ProfileInterface.ui
index cbdc519..9c6fa19 100755
--- a/ProfileInterface.ui
+++ b/ProfileInterface.ui
@@ -64,13 +64,16 @@
         <number>0</number>
        </property>
        <item>
-        <layout class="QHBoxLayout" name="hlContent">
-         <item>
-          <layout class="QVBoxLayout" name="vlSnapmatic"/>
-         </item>
+        <layout class="QVBoxLayout" name="vlContent">
+         <property name="spacing">
+          <number>0</number>
+         </property>
          <item>
           <layout class="QVBoxLayout" name="vlSavegame"/>
          </item>
+         <item>
+          <layout class="QVBoxLayout" name="vlSnapmatic"/>
+         </item>
         </layout>
        </item>
       </layout>
diff --git a/ProfileLoader.cpp b/ProfileLoader.cpp
new file mode 100755
index 0000000..e7ad0c4
--- /dev/null
+++ b/ProfileLoader.cpp
@@ -0,0 +1,66 @@
+/*****************************************************************************
+* 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 "ProfileLoader.h"
+#include "SnapmaticPicture.h"
+#include "SavegameData.h"
+#include "CrewDatabase.h"
+#include <QStringList>
+#include <QString>
+#include <QFile>
+#include <QDir>
+
+ProfileLoader::ProfileLoader(QString profileFolder, CrewDatabase *crewDB, QObject *parent) : QThread(parent), profileFolder(profileFolder), crewDB(crewDB)
+{
+
+}
+
+void ProfileLoader::run()
+{
+    QDir profileDir;
+    profileDir.setPath(profileFolder);
+    profileDir.setNameFilters(QStringList("SGTA*"));
+    QStringList SavegameFiles = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
+    QStringList BackupFiles = SavegameFiles.filter(".bak", Qt::CaseInsensitive);
+    foreach(const QString &BackupFile, BackupFiles)
+    {
+        SavegameFiles.removeAll(BackupFile);
+    }
+    foreach(const QString &SavegameFile, SavegameFiles)
+    {
+        QString sgdPath = profileFolder + "/" + SavegameFile;
+        SavegameData *savegame = new SavegameData(sgdPath);
+        if (savegame->readingSavegame())
+        {
+            emit savegameLoaded(savegame, sgdPath);
+        }
+    }
+
+    profileDir.setNameFilters(QStringList("PGTA*"));
+    QStringList SnapmaticPics = profileDir.entryList(QDir::Files | QDir::NoDot, QDir::NoSort);
+    foreach(const QString &SnapmaticPic, SnapmaticPics)
+    {
+        QString picturePath = profileFolder + "/" + SnapmaticPic;
+        SnapmaticPicture *picture = new SnapmaticPicture(picturePath);
+        if (picture->readingPicture())
+        {
+            emit pictureLoaded(picture, picturePath);
+            crewDB->addCrew(picture->getCrewNumber());
+        }
+    }
+}
diff --git a/ProfileLoader.h b/ProfileLoader.h
new file mode 100755
index 0000000..d4fc99c
--- /dev/null
+++ b/ProfileLoader.h
@@ -0,0 +1,46 @@
+/*****************************************************************************
+* 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 PROFILELOADER_H
+#define PROFILELOADER_H
+
+#include "SnapmaticPicture.h"
+#include "SavegameData.h"
+#include "CrewDatabase.h"
+#include <QThread>
+#include <QDir>
+
+class ProfileLoader : public QThread
+{
+    Q_OBJECT
+public:
+    explicit ProfileLoader(QString profileFolder, CrewDatabase *crewDB, QObject *parent = 0);
+
+protected:
+    void run();
+
+private:
+    QString profileFolder;
+    CrewDatabase *crewDB;
+
+signals:
+    void pictureLoaded(SnapmaticPicture *picture, QString picturePath);
+    void savegameLoaded(SavegameData *savegame, QString savegamePath);
+};
+
+#endif // PROFILELOADER_H
diff --git a/SavegameData.cpp b/SavegameData.cpp
index cd6a435..37ebe42 100755
--- a/SavegameData.cpp
+++ b/SavegameData.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SavegameData.h b/SavegameData.h
index 4f9f058..0a3de6b 100755
--- a/SavegameData.h
+++ b/SavegameData.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SavegameWidget.cpp b/SavegameWidget.cpp
index fa3acd9..97865dd 100755
--- a/SavegameWidget.cpp
+++ b/SavegameWidget.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SavegameWidget.h b/SavegameWidget.h
index 29bd0f0..6083570 100755
--- a/SavegameWidget.h
+++ b/SavegameWidget.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SavegameWidget.ui b/SavegameWidget.ui
index c3e9b45..95a00d7 100755
--- a/SavegameWidget.ui
+++ b/SavegameWidget.ui
@@ -14,8 +14,24 @@
    <string>Savegame Widget</string>
   </property>
   <layout class="QHBoxLayout" name="hlSavegameContent">
+   <item>
+    <widget class="QLabel" name="labSavegamePic">
+     <property name="text">
+      <string/>
+     </property>
+     <property name="pixmap">
+      <pixmap resource="app.qrc">:/img/savegame.png</pixmap>
+     </property>
+    </widget>
+   </item>
    <item>
     <widget class="QLabel" name="labSavegameStr">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="text">
       <string>The Third Way (100%) - 00/00/00 00:00:00</string>
      </property>
@@ -24,19 +40,6 @@
      </property>
     </widget>
    </item>
-   <item>
-    <spacer name="hsSavegameWidget">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item>
     <widget class="QPushButton" name="cmdCopy">
      <property name="text">
@@ -53,6 +56,8 @@
    </item>
   </layout>
  </widget>
- <resources/>
+ <resources>
+  <include location="app.qrc"/>
+ </resources>
  <connections/>
 </ui>
diff --git a/SnapmaticPicture.cpp b/SnapmaticPicture.cpp
index 111ea18..04c6846 100755
--- a/SnapmaticPicture.cpp
+++ b/SnapmaticPicture.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -21,8 +21,8 @@
 #include <QJsonObject>
 #include <QVariantMap>
 #include <QJsonArray>
-#include <QPixmap>
 #include <QString>
+#include <QImage>
 #include <QFile>
 
 SnapmaticPicture::SnapmaticPicture(QString fileName, QObject *parent) : QObject(parent), picFileName(fileName)
@@ -36,7 +36,7 @@ SnapmaticPicture::SnapmaticPicture(QString fileName, QObject *parent) : QObject(
     jsonStreamLength = 3076;
 
     // INIT PIC
-    cachePicture = QPixmap(0,0);
+    cachePicture = QImage(0, 0, QImage::Format_RGB32);
     pictureStr = "";
     lastStep = "";
     picOk = 0;
@@ -95,7 +95,7 @@ bool SnapmaticPicture::readingPicture()
         return false;
     }
     QByteArray jpegRawContent = picFile->read(jpegPicStreamLength);
-    picOk = cachePicture.loadFromData(jpegRawContent);
+    picOk = cachePicture.loadFromData(jpegRawContent, "JPEG");
 
     // Read JSON Stream
     if (!picFile->isReadable())
@@ -145,9 +145,9 @@ bool SnapmaticPicture::readingPictureFromFile(QString fileName)
     }
 }
 
-void SnapmaticPicture::setPixmap(QPixmap pixmap)
+void SnapmaticPicture::setPicture(QImage picture)
 {
-    cachePicture = pixmap;
+    cachePicture = picture;
 }
 
 QString SnapmaticPicture::getPictureStr()
@@ -160,7 +160,7 @@ QString SnapmaticPicture::getLastStep()
     return lastStep;
 }
 
-QPixmap SnapmaticPicture::getPixmap()
+QImage SnapmaticPicture::getPicture()
 {
     return cachePicture;
 }
diff --git a/SnapmaticPicture.h b/SnapmaticPicture.h
index 8496583..bcfc86f 100755
--- a/SnapmaticPicture.h
+++ b/SnapmaticPicture.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -21,8 +21,8 @@
 
 #include <QStringList>
 #include <QObject>
-#include <QPixmap>
 #include <QString>
+#include <QImage>
 #include <QFile>
 
 class SnapmaticPicture : public QObject
@@ -32,9 +32,9 @@ public:
     explicit SnapmaticPicture(QString fileName = "", QObject *parent = 0);
     bool readingPictureFromFile(QString fileName);
     bool readingPicture();
-    void setPixmap(QPixmap pixmap);
+    void setPicture(QImage picture);
     bool isPicOk();
-    QPixmap getPixmap();
+    QImage getPicture();
     QString getLastStep();
     QString getPictureStr();
 
@@ -52,7 +52,7 @@ private:
     QString getSnapmaticJSONString(QByteArray jsonBytes);
     QString convertDrawStringForLog(QString inputStr);
     QString convertLogStringForDraw(QString inputStr);
-    QPixmap cachePicture;
+    QImage cachePicture;
     QString picFileName;
     QString pictureStr;
     QString lastStep;
diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp
index 9f9b706..8128c88 100755
--- a/SnapmaticWidget.cpp
+++ b/SnapmaticWidget.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -38,7 +38,7 @@ SnapmaticWidget::~SnapmaticWidget()
 
 void SnapmaticWidget::setSnapmaticPicture(SnapmaticPicture *picture, QString picturePath)
 {
-    QPixmap SnapmaticPixmap = picture->getPixmap();
+    QPixmap SnapmaticPixmap = QPixmap::fromImage(picture->getPicture(), Qt::AutoColor);
     SnapmaticPixmap.scaled(ui->labPicture->width(), ui->labPicture->height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
     ui->labPicStr->setText(picture->getPictureStr());
     ui->labPicture->setPixmap(SnapmaticPixmap);
diff --git a/SnapmaticWidget.h b/SnapmaticWidget.h
index 906f6a3..92f19f6 100755
--- a/SnapmaticWidget.h
+++ b/SnapmaticWidget.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SnapmaticWidget.ui b/SnapmaticWidget.ui
index 1065636..f2fcd92 100755
--- a/SnapmaticWidget.ui
+++ b/SnapmaticWidget.ui
@@ -41,6 +41,12 @@
    </item>
    <item>
     <widget class="QLabel" name="labPicStr">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
      <property name="text">
       <string>PHOTO - 00/00/00 00:00:00</string>
      </property>
@@ -49,19 +55,6 @@
      </property>
     </widget>
    </item>
-   <item>
-    <spacer name="hsView">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>0</width>
-       <height>0</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item>
     <widget class="QPushButton" name="cmdView">
      <property name="text">
diff --git a/SyncFramework.cpp b/SyncFramework.cpp
index 2ebc211..2576f7a 100755
--- a/SyncFramework.cpp
+++ b/SyncFramework.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/SyncFramework.h b/SyncFramework.h
index 8314440..b654cb8 100755
--- a/SyncFramework.h
+++ b/SyncFramework.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/UserInterface.cpp b/UserInterface.cpp
index 838df56..244b3ac 100755
--- a/UserInterface.cpp
+++ b/UserInterface.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -40,7 +40,7 @@ UserInterface::UserInterface(ProfileDatabase *profileDB, CrewDatabase *crewDB, Q
     ui->setupUi(this);
 
     // init settings
-    QSettings SyncSettings("Syping Gaming Team", "gta5sync");
+    QSettings SyncSettings("Syping", "gta5sync");
     SyncSettings.beginGroup("dir");
     bool forceDir = SyncSettings.value("force", false).toBool();
 
diff --git a/UserInterface.h b/UserInterface.h
index c45bfbc..85dfe0e 100755
--- a/UserInterface.h
+++ b/UserInterface.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/UserInterface.ui b/UserInterface.ui
index 77d812a..ba61eda 100755
--- a/UserInterface.ui
+++ b/UserInterface.ui
@@ -6,14 +6,14 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>800</width>
-    <height>600</height>
+    <width>625</width>
+    <height>500</height>
    </rect>
   </property>
   <property name="minimumSize">
    <size>
-    <width>800</width>
-    <height>600</height>
+    <width>625</width>
+    <height>500</height>
    </size>
   </property>
   <property name="windowTitle">
@@ -48,7 +48,7 @@
     <rect>
      <x>0</x>
      <y>0</y>
-     <width>800</width>
+     <width>625</width>
      <height>21</height>
     </rect>
    </property>
diff --git a/app.qrc b/app.qrc
index 1f91577..a56a748 100755
--- a/app.qrc
+++ b/app.qrc
@@ -4,4 +4,7 @@
         <file>qt_de.qm</file>
         <file>qtbase_de.qm</file>
     </qresource>
+    <qresource prefix="/img">
+        <file>savegame.png</file>
+    </qresource>
 </RCC>
diff --git a/app.rc b/app.rc
index 0950fc4..dde4315 100755
--- a/app.rc
+++ b/app.rc
@@ -19,11 +19,11 @@ BEGIN
     BEGIN
         BLOCK   "040904b0"
         BEGIN
-            VALUE   "CompanyName",      "Syping Gaming Team\0"
+            VALUE   "CompanyName",      "Syping"
             VALUE   "FileDescription",  "Grand Theft Auto V Sync\0"
             VALUE   "FileVersion",      "1.0.0.0\0"
             VALUE   "InternalName",     "gta5sync\0"
-            VALUE   "LegalCopyright",   "Copyright � 2015-2016 Syping Gaming Team\0"
+            VALUE   "LegalCopyright",   "Copyright � 2015-2016 Syping\0"
             VALUE   "OriginalFilename", "gta5sync.exe\0"
             VALUE   "ProductName",      "Grand Theft Auto V Sync\0"
             VALUE   "ProductVersion",   "1.0.0.0\0"
diff --git a/gta5sync.pro b/gta5sync.pro
index d38c25b..8f9edd3 100755
--- a/gta5sync.pro
+++ b/gta5sync.pro
@@ -1,6 +1,6 @@
 #/*****************************************************************************
 #* gta5sync GRAND THEFT AUTO V SYNC
-#* Copyright (C) 2015-2016 Syping Gaming Team
+#* Copyright (C) 2015-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
@@ -37,7 +37,8 @@ SOURCES += main.cpp \
     UserInterface.cpp \
     ProfileInterface.cpp \
     SnapmaticWidget.cpp \
-    SavegameWidget.cpp
+    SavegameWidget.cpp \
+    ProfileLoader.cpp
 
 HEADERS  += \
     SnapmaticPicture.h \
@@ -51,7 +52,8 @@ HEADERS  += \
     UserInterface.h \
     ProfileInterface.h \
     SnapmaticWidget.h \
-    SavegameWidget.h
+    SavegameWidget.h \
+    ProfileLoader.h
 
 FORMS    += \
     PictureDialog.ui \
diff --git a/main.cpp b/main.cpp
index 81bb218..a8c6ce7 100755
--- a/main.cpp
+++ b/main.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
@@ -40,7 +40,7 @@ int main(int argc, char *argv[])
     a.setApplicationVersion("1.0.0");
 
     // Loading translation settings
-    QSettings settings("Syping Gaming Team", "gta5sync");
+    QSettings settings("Syping", "gta5sync");
     settings.beginGroup("Interface");
     QString language = settings.value("Language","System").toString();
     settings.endGroup();
diff --git a/qjson4/QJsonArray.cpp b/qjson4/QJsonArray.cpp
index 8d370af..531941f 100755
--- a/qjson4/QJsonArray.cpp
+++ b/qjson4/QJsonArray.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonArray.h b/qjson4/QJsonArray.h
index e961ae3..94aab1b 100755
--- a/qjson4/QJsonArray.h
+++ b/qjson4/QJsonArray.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonDocument.cpp b/qjson4/QJsonDocument.cpp
index bccad4c..59adf32 100755
--- a/qjson4/QJsonDocument.cpp
+++ b/qjson4/QJsonDocument.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonDocument.h b/qjson4/QJsonDocument.h
index a133a40..12e8fc7 100755
--- a/qjson4/QJsonDocument.h
+++ b/qjson4/QJsonDocument.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonObject.cpp b/qjson4/QJsonObject.cpp
index f730822..55f8cf1 100755
--- a/qjson4/QJsonObject.cpp
+++ b/qjson4/QJsonObject.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonObject.h b/qjson4/QJsonObject.h
index fcfc758..ad657bc 100755
--- a/qjson4/QJsonObject.h
+++ b/qjson4/QJsonObject.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonParseError.cpp b/qjson4/QJsonParseError.cpp
index 1974513..6bcfd98 100755
--- a/qjson4/QJsonParseError.cpp
+++ b/qjson4/QJsonParseError.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonParseError.h b/qjson4/QJsonParseError.h
index eeaad33..b87d7aa 100755
--- a/qjson4/QJsonParseError.h
+++ b/qjson4/QJsonParseError.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonParser.cpp b/qjson4/QJsonParser.cpp
index 5a9730f..9b084f7 100755
--- a/qjson4/QJsonParser.cpp
+++ b/qjson4/QJsonParser.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonParser.h b/qjson4/QJsonParser.h
index 762e89f..d54a0d9 100755
--- a/qjson4/QJsonParser.h
+++ b/qjson4/QJsonParser.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonRoot.h b/qjson4/QJsonRoot.h
index 8f3799b..77b9751 100755
--- a/qjson4/QJsonRoot.h
+++ b/qjson4/QJsonRoot.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonValue.cpp b/qjson4/QJsonValue.cpp
index 508b4d7..68bf87f 100755
--- a/qjson4/QJsonValue.cpp
+++ b/qjson4/QJsonValue.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonValue.h b/qjson4/QJsonValue.h
index 47f502d..bf32898 100755
--- a/qjson4/QJsonValue.h
+++ b/qjson4/QJsonValue.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonValueRef.cpp b/qjson4/QJsonValueRef.cpp
index 9d1191a..7d67ef4 100755
--- a/qjson4/QJsonValueRef.cpp
+++ b/qjson4/QJsonValueRef.cpp
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/qjson4/QJsonValueRef.h b/qjson4/QJsonValueRef.h
index 8e23048..567c68a 100755
--- a/qjson4/QJsonValueRef.h
+++ b/qjson4/QJsonValueRef.h
@@ -1,6 +1,6 @@
 /*****************************************************************************
 * gta5sync GRAND THEFT AUTO V SYNC
-* Copyright (C) 2016 Syping Gaming Team
+* 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
diff --git a/savegame.png b/savegame.png
new file mode 100755
index 0000000000000000000000000000000000000000..a2c61b0ff0c90b768c3100c43965857ee7b6a8b7
GIT binary patch
literal 1403
zcmV->1%&#EP)<h;3K|Lk000e1NJLTq001xm000{Z1^@s6I%y1Y00006VoOIv0RI60
z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru-~$^5H3+g#Em{Bo1qew*
zK~z}7y_idjTvZf>zkSZFS9emC?qHjVI7$Wq9V_a<|Db}INPd7iGk-yxI(MQ|6$JeU
z5d;Um!AT+rqG^)0ySnN=&N+KKxR1KkX(17BF5G%hw@$5f_F8N2Tf!qA@4o%c&DqZE
zqvPXa%#0Uaew7zrdId2<oFE8@03agG3DT`#U{*h4m^i-p{4;+2<tMT%V?3E~aPZV?
z@7=ofDUWevk9y&Hy}owm&K=a0{Y!gHrc(}{zJjJ$<LVtXkA^@)q9x=6oOAe*!)F;q
zo->|ID9e&jmR;j9kL)q7O&8~LX45G}o&yk4<mlv-q#Fi8f7hi)XhUw2dG`0_V1}BK
zQmTKzR0kuVs*JLXs;UqXOqKc0n7!S-S`|IWCLnA}s80eQ0!bBB!>m5FAu<R7Gb78g
zMoudLyo2m4vVZ%2vxb^s2GJa*hN_~?#%odrtw8^^VXTV8@^nq=o4~q<#v3)@#=4k+
zcf$PQ1r*&TpaT+Ubt)ogQc_aPjPb~0Jq<}4Hd60+%cre?nbm8Up~+B9^@f-YOTf&!
zXEm+Or;2ymwzYn0HpsOpM@>Q+u-18?1)hfVz?OtkUG@;QF`k`6SenY%wv-wVWNss$
zCr>~XQ)9U<d2q7YROg(EZQi$qF`Nib?fV9NdNLlcEdq&ThVzca?&RFe=>Xey3e}P_
z5UC?nwOcz4nL=&S2%u)1E>AhUcSs1KH#$hae?4SgGf=CmH=VA?^L1_Jwh!o#eW1~&
z0a=#u{kPxn`)_v<CwS-ZKEpZLB4bSnHUPCru!NcM*B`$l;?R_^rm|1O15O;r_YXNb
z{A&}T_J|8LT^hi7Uq|YbkkEMs6X*JB;at~p{wyIqX>~Fk(!_cOkTj&qvaH7n?{Us`
z=f)F)nReMf9*+=L%cgB$oz!9+kieOYR#o;dU*^plZ?d>_sqV1!rnj~o_xf~IR($fw
z$Nc=`Pl$75-m_RN@ZMu)!}fuAW_L`L3%k3F#}l$F>p-;RRCU|Xja>Hj_L$9Pc<%`@
z5Mt=$8HcPuI;R3LMttV^`u1(U`tmExl*weu>u<cybI(6djIrBURi!A38f4Enno?(=
zFerf#9vY2X)0IWZ^5g_FsHTCuC`c($mL)MpRO{%>^PCtWsCAQQiV1V}&~N<z5;{|X
zq)Js)o8hi8Bxa;ogDr}J5JD%Zq9`b<nv^(4N{SGfOsAL`VNe1wx`$G!X-+Z5y8LE@
z7%8igJkKf1l9UoLMq-RLfwH6u0q-116_Jb>0tUE8ygB->1j^QoZO9}|6h*;mwc_yb
z9%jaTv7pFv*6TGzBc&K4Db?2&MM0=4lJ}@70#sJdMoz>ABM@TzOyGud?pm8DDJIsd
z6<4ob<*l1H(UizWBla&}X1QE;JKr~PS(a2)!28tP8%uMC2To)(7=iD8{NdLt2L~Tq
zS}Z=CPNp+eCC}IVeSFN$&JNeFUnhh>jFGY|xqttDr~S5SF-BsDq!d9s(t>Y3FGAQK
z@^2OW^WMGNr>oWb7j|~9`poMy&pvzcx4U;2)7fm|y&pU0Mk0~{l2Q^gQ!|TZ7E(%K
zd9qwpp*lG_{(I@1bAYwo+B<ie7sVG1rZ@zF2;5n%Rv)hOeB!+~Kg#@UXUEUyb2l1|
zWICNnJ-8<6-Q${b&hk9Blu{f|Ci>v$NC9_dK1!;33OrUj{s(s88v6eS{Q&>~002ov
JPDHLkV1f-cmL>oI

literal 0
HcmV?d00001