diff --git a/src/data/FF7Save.cpp b/src/data/FF7Save.cpp index dbc040647..73b0fa733 100644 --- a/src/data/FF7Save.cpp +++ b/src/data/FF7Save.cpp @@ -474,22 +474,22 @@ bool FF7Save::exportSlot(const QString &fileName, FF7SaveInfo::FORMAT exportForm return true; } -void FF7Save::importSlot(int s, QString fileName, int fileSlot) +bool FF7Save::importSlot(int s, QString fileName, int fileSlot) { if ((s < 0) || (s > 14) || filename.isEmpty()) - return; + return false; FF7SaveInfo::FORMAT inType = FF7SaveInfo::FORMAT::UNKNOWN; int offset = 0; QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) - return; + return false; inType = fileDataFormat(file); if (inType == FF7SaveInfo::FORMAT::UNKNOWN) { file.close(); - return; + return false; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~Set File Type Vars ~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ @@ -538,10 +538,11 @@ void FF7Save::importSlot(int s, QString fileName, int fileSlot) } else { //Unknown or Unspecified Type Abort. file.close(); - return; + return false; } file.close(); setFileModified(true, s); + return true; } void FF7Save::clearSlot(int rmslot) diff --git a/src/data/FF7Save.h b/src/data/FF7Save.h index efb867a8c..3552a1f1f 100644 --- a/src/data/FF7Save.h +++ b/src/data/FF7Save.h @@ -136,8 +136,9 @@ class FF7TKDATA_EXPORT FF7Save: public QObject * \param s slot to import into * \param fileName file that will be imported * \param fileSlot slot to import from fileName + * \return true if successful */ - void importSlot(int s = 0, QString fileName = "", int fileSlot = 0); + bool importSlot(int s = 0, QString fileName = "", int fileSlot = 0); /** \brief clear a slot * \param s slot number (0-14)