Fix some issues with the filewatcher

This commit is contained in:
GriffinR
2025-05-29 00:19:53 -04:00
parent 4816c1c8af
commit ba1aa2b1ff
12 changed files with 82 additions and 41 deletions

View File

@@ -127,6 +127,7 @@ private:
bool m_hasUnsavedDataChanges = false;
bool m_needsHealLocation = false;
bool m_scriptsLoaded = false;
bool m_loggedScriptsFileError = false;
QMap<Event::Group, QList<Event *>> m_events;
QSet<Event *> m_ownedEvents; // for memory management

View File

@@ -80,7 +80,7 @@ public:
static int getScriptLineNumber(const QString &filePath, const QString &scriptLabel);
static int getRawScriptLineNumber(QString text, const QString &scriptLabel);
static int getPoryScriptLineNumber(QString text, const QString &scriptLabel);
static QStringList getGlobalScriptLabels(const QString &filePath);
static QStringList getGlobalScriptLabels(const QString &filePath, QString *error = nullptr);
static QStringList getGlobalRawScriptLabels(QString text);
static QStringList getGlobalPoryScriptLabels(QString text);
static QString removeStringLiterals(QString text);

View File

@@ -11,6 +11,7 @@ namespace Util {
QString toDefineCase(QString input);
QString toHexString(uint32_t value, int minLength = 0);
QString toHtmlParagraph(const QString &text);
QString stripPrefix(const QString &s, const QString &prefix);
Qt::Orientations getOrientation(bool xflip, bool yflip);
QString replaceExtension(const QString &path, const QString &newExtension);
void setErrorStylesheet(QLineEdit *lineEdit, bool isError);

View File

@@ -294,6 +294,8 @@ private:
// We can't display these layouts to the user, but we want to preserve the data when they save.
QList<QJsonObject> failedLayoutsData;
QSet<QString> failedFileWatchPaths;
const QRegularExpression re_gbapalExtension;
const QRegularExpression re_bppExtension;
@@ -322,8 +324,8 @@ private:
void setNewLayoutBlockdata(Layout *layout);
void setNewLayoutBorder(Layout *layout);
void watchFile(const QString &filename);
void watchFiles(const QStringList &filenames);
bool watchFile(const QString &filename);
bool watchFiles(const QStringList &filenames);
void ignoreWatchedFileTemporarily(const QString &filepath);
void ignoreWatchedFilesTemporarily(const QStringList &filepaths);
void recordFileChange(const QString &filepath);