diff --git a/CoH_BSC_Editor.pro b/CoH_BSC_Editor.pro index e8bdd9b..7ab07cd 100644 --- a/CoH_BSC_Editor.pro +++ b/CoH_BSC_Editor.pro @@ -55,13 +55,13 @@ RESOURCES += \ RC_FILE = resources.rc -win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lqxtended_static_0_0_1_0_Qt_5_12_3 -else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lqxtended_static_0_0_1_0_Qt_5_12_3d +win32:CONFIG(release, debug|release): LIBS += -L$$PWD/lib/ -lQx_static32_0-0-1-1_Qt_5-14-0 +else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/lib/ -lQx_static32_0-0-1-1_Qt_5-14-0d INCLUDEPATH += $$PWD/include DEPENDPATH += $$PWD/include -win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/lib/libqxtended_static_0_0_1_0_Qt_5_12_3.a -else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/lib/libqxtended_static_0_0_1_0_Qt_5_12_3d.a -else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/lib/qxtended_static_0_0_1_0_Qt_5_12_3.lib -else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/lib/qxtended_static_0_0_1_0_Qt_5_12_3d.lib +win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/lib/libQx_static32_0-0-1-1_Qt_5-14-0.a +else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/lib/libQx_static32_0-0-1-1_Qt_5-14-0d.a +else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/lib/Qx_static32_0-0-1-1_Qt_5-14-0.lib +else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.lib diff --git a/include/qx-io.h b/include/qx-io.h index c1acd9a..b829c6e 100644 --- a/include/qx-io.h +++ b/include/qx-io.h @@ -44,12 +44,15 @@ class IO static bool fileIsEmpty(QFile& file); static bool fileIsEmpty(QFile& file, IOOpReport& reportBuffer); // Text Based: - static IOOpReport findStringInFile(TextPos& returnBuffer, QFile& textFile, const QString& query, int hitsToSkip = 0); + static IOOpReport getLineCountOfFile(long long& returnBuffer, QFile& textFile); + static IOOpReport findStringInFile(TextPos& returnBuffer, QFile& textFile, const QString& query, int hitsToSkip = 0, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive); static IOOpReport readTextFromFile(QString& returnBuffer, QFile& textFile, TextPos textPos, int characters = -1); static IOOpReport readTextRangeFromFile(QString& returnBuffer, QFile& textFile, TextPos startPos, TextPos endPos = TextPos(-1,-1)); + static IOOpReport readTextFromFileByLine(QStringList& returnBuffer, QFile &textFile, int startLine = 0, int endLine = -1); static IOOpReport readAllTextFromFile(QString& returnBuffer, QFile& textFile); - static IOOpReport readAllTextFromFileByLine(QStringList& returnBuffer, QFile &textFile, int startLine, int endLine = -1); static IOOpReport writeStringAsFile(QFile &textFile, const QString& text, bool overwriteIfExist = false, bool createDirs = true); + static IOOpReport writeStringToEndOfFile(QFile &textFile, const QString& text, bool ensureNewLine = false, bool createIfDNE = false, bool createDirs = true); // Consider making function just writeStringToFile and use TextPos with bool for overwrite vs insert + static IOOpReport deleteTextRangeFromFile(QFile &textFile, TextPos startPos, TextPos endPos); // Directory Based: static IOOpReport getDirFileList(QStringList& returnBuffer, QDir directory, bool includeSubdirectories = false, QStringList extFilter = QStringList()); static bool dirContainsFiles(QDir directory, bool includeSubdirectories = false); diff --git a/include/qx-reg.h b/include/qx-reg.h new file mode 100644 index 0000000..362812b --- /dev/null +++ b/include/qx-reg.h @@ -0,0 +1,34 @@ +#ifndef QXREG_H +#define QXREG_H +#include "qx.h" +#include "Windows_c++17_compat.h" + +namespace Qx +{ +//=============================================================================================================== +// REG +//=============================================================================================================== + +class Reg +{ +//-Inner Classes------------------------------------------------------------------------------------------------ + class RegOpReport + { + //-Class Functions---------------------------------------------------------------------------------------------- + + }; + +//-Class Functions---------------------------------------------------------------------------------------------- +public: + enum RegHive {HKCR, HKCU, HKLM, HKU, HKCC}; + static QString readRegString(RegHive valueHive, const QString &valueKey, const QString &valueName); + +private: + static HKEY resolveHiveEnum(RegHive regHive); + static LONG getStringRegKey(HKEY hKey, const std::wstring &strValueName, std::wstring &strValue); + static LONG getDWORDRegKey(HKEY hKey, const std::wstring &strValueName, DWORD &nValue, DWORD nDefaultValue); + static LONG getBoolRegKey(HKEY hKey, const std::wstring &strValueName, bool &bValue, bool bDefaultValue); +}; + +} +#endif // REG_H diff --git a/include/qx.h b/include/qx.h index cd3dcbf..b764507 100644 --- a/include/qx.h +++ b/include/qx.h @@ -390,7 +390,21 @@ class List return nullptr; } + template static QList subtractAB(QList &listA, QList &listB) + { + // Difference list to fill + QList differenceList; + + for(T entry : listA) + { + if(!listB.contains(entry)) + differenceList << entry; + } + return differenceList; + } + static QWidgetList objectListToWidgetList(QObjectList list); + }; class MMRB diff --git a/lib/Qx_static32_0-0-1-1_Qt_5-14-0.lib b/lib/Qx_static32_0-0-1-1_Qt_5-14-0.lib new file mode 100644 index 0000000..410fc24 Binary files /dev/null and b/lib/Qx_static32_0-0-1-1_Qt_5-14-0.lib differ diff --git a/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.lib b/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.lib new file mode 100644 index 0000000..dbececb Binary files /dev/null and b/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.lib differ diff --git a/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.pdb b/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.pdb new file mode 100644 index 0000000..b32d082 Binary files /dev/null and b/lib/Qx_static32_0-0-1-1_Qt_5-14-0d.pdb differ diff --git a/lib/qxtended_static_0_0_1_0_Qt_5_12_3.lib b/lib/qxtended_static_0_0_1_0_Qt_5_12_3.lib deleted file mode 100644 index 45011c4..0000000 Binary files a/lib/qxtended_static_0_0_1_0_Qt_5_12_3.lib and /dev/null differ diff --git a/lib/qxtended_static_0_0_1_0_Qt_5_12_3d.lib b/lib/qxtended_static_0_0_1_0_Qt_5_12_3d.lib deleted file mode 100644 index fc270c3..0000000 Binary files a/lib/qxtended_static_0_0_1_0_Qt_5_12_3d.lib and /dev/null differ diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2bbbe3c..3979a0f 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -8,6 +8,7 @@ #include #include #include +#include //=============================================================================================================== // MAIN WINDOW @@ -2136,7 +2137,7 @@ void MainWindow::all_on_toolButton_clicked() getSelectedPlaylist()->removeInterpretedEffectBehavior(selectedIndex); updateEffectBehaviors(); if(ui->tableWidget_effectBehaviors->rowCount() > 0) - ui->tableWidget_effectBehaviors->setCurrentCell(selectedIndex - 1, 0); + ui->tableWidget_effectBehaviors->setCurrentCell(std::max(0,selectedIndex - 1), 0); } else if(senderToolbutton == ui->toolButton_effectBehaviorsCopy) { @@ -2195,7 +2196,7 @@ void MainWindow::all_on_toolButton_clicked() getSelectedPlaylist()->removeSoundContainer(selectedIndex); updateSoundContainers(); if(ui->comboBox_soundContainer->count() > 0) - ui->comboBox_soundContainer->setCurrentIndex(selectedIndex - 1); + ui->comboBox_soundContainer->setCurrentIndex(std::max(0, selectedIndex - 1)); updateSoundContainerGroup(); // Must call manually to ensure update since the above may have moved the selected index // to the desired index so using "setCurrentIndex()" on the same index won't trigger the corresponding slot @@ -2267,7 +2268,7 @@ void MainWindow::all_on_toolButton_clicked() currentSoundContainer->removeInterpretedLinkedFile(selectedIndex); updateLinkedFiles(); if(ui->tableWidget_linkedFiles->rowCount() > 0) - ui->tableWidget_linkedFiles->setCurrentCell(selectedIndex - 1, 0); + ui->tableWidget_linkedFiles->setCurrentCell(std::max(0,selectedIndex - 1), 0); } else if(senderToolbutton == ui->toolButton_linkedFilesCopy) { diff --git a/src/version.h b/src/version.h index d1fe743..aa713cc 100644 --- a/src/version.h +++ b/src/version.h @@ -1,16 +1,16 @@ #ifndef VERSION_H #define VERSION_H -#define VER_FILEVERSION 0,1,3,0 -#define VER_FILEVERSION_STR "0.1.3.0" +#define VER_FILEVERSION 0,1,4,0 +#define VER_FILEVERSION_STR "0.1.4.0" -#define VER_PRODUCTVERSION 0,1,3,0 -#define VER_PRODUCTVERSION_STR "0.1.3.0" +#define VER_PRODUCTVERSION 0,1,4,0 +#define VER_PRODUCTVERSION_STR "0.1.4.0" #define VER_COMPANYNAME_STR "Obby Apps" #define VER_FILEDESCRIPTION_STR "BSCWorks (CoH:v14)" #define VER_INTERNALNAME_STR "CoH: BSC Editor" -#define VER_LEGALCOPYRIGHT_STR "Copyright © 2019 Obby Apps" +#define VER_LEGALCOPYRIGHT_STR "Copyright © 2020 Obby Apps" #define VER_LEGALTRADEMARKS1_STR "All Rights Reserved" #define VER_LEGALTRADEMARKS2_STR "GNU GPL V3" #define VER_ORIGINALFILENAME_STR "BSCWorks.exe"