From 943013284fe012b53115d2b64ed7684fd65c45db Mon Sep 17 00:00:00 2001 From: Jesse Litton Date: Sat, 5 Aug 2017 11:23:22 -0500 Subject: [PATCH] 0.9.4.1 - Fix windows #define and alarmmodel assert. --- docs/RELEASES | 5 +++++ src/alarmmodel.cpp | 10 +++++++--- src/logcatcher.cpp | 4 ++-- src/logcatcher.h | 24 ++++++++++++------------ 4 files changed, 26 insertions(+), 17 deletions(-) diff --git a/docs/RELEASES b/docs/RELEASES index edfbbfc..db5b82f 100644 --- a/docs/RELEASES +++ b/docs/RELEASES @@ -1,3 +1,8 @@ +0.9.4.1 - Fixed bug where #defines were not working with newest qt/gcc. + (thanks Hibasnev!) + + Fixed bug where Windows build would assert setting alarms. + 0.9.4 - Fixed crash when jump bridges fail to load. Also suppressed the error message, since most systems won't have jump bridges. diff --git a/src/alarmmodel.cpp b/src/alarmmodel.cpp index fcc80ec..c67156c 100755 --- a/src/alarmmodel.cpp +++ b/src/alarmmodel.cpp @@ -231,9 +231,13 @@ void AlarmModel::setAlarms(QList newAlarms) if(newAlarms.count() <= 0) return; - beginRemoveRows(QModelIndex(), 0, alarms.count()-1); - alarms.clear(); - endRemoveRows(); + if(alarms.count() > 0) + { + beginRemoveRows(QModelIndex(), 0, alarms.count()-1); + alarms.clear(); + endRemoveRows(); + } + beginInsertRows(QModelIndex(), 0, newAlarms.count()-1); alarms = newAlarms; endInsertRows(); diff --git a/src/logcatcher.cpp b/src/logcatcher.cpp index 5044788..9dac20b 100644 --- a/src/logcatcher.cpp +++ b/src/logcatcher.cpp @@ -132,8 +132,8 @@ void LogCatcher::findCurrentLogs(const QString& dirName) // are in them. QString channelName = logNameRegEx.cap(1); - if(m_options->getIntelChannels().contains(channelName)) - //if(!localChannels.contains(channelName)) + //if(m_options->getIntelChannels().contains(channelName)) + if(!localChannels.contains(channelName)) { QMutableListIterator i(infoList); while (i.hasNext()) { diff --git a/src/logcatcher.h b/src/logcatcher.h index 58696f0..feb4afc 100644 --- a/src/logcatcher.h +++ b/src/logcatcher.h @@ -21,18 +21,6 @@ #ifndef LOGCATCHER_H #define LOGCATCHER_H -/* On Linux, QFileSystemWatcher works fine. On Windows, it works 50% (dirs only) thanks to - * the way Windows doesn't update the file modified time on flush(). See the bug report at - * https://bugreports.qt.io/browse/QTBUG-41119 for more details. - * - * So... On Windows we currently need to use a timer-based hack to check the individual - * files. - */ - -#ifdef Q_OS_WIN32 // Q_OS_LINUX -#define USE_FALLBACK_POLLER -#endif - /* For some reason, actually using the above define in this same file ends up with the * QTimer not firing?!?! At least it does when testing with gcc on Linux. That's why I * do not use the flag below to optimize what's built on Linux. @@ -47,6 +35,18 @@ #include "options.h" +/* On Linux, QFileSystemWatcher works fine. On Windows, it works 50% (dirs only) thanks to + * the way Windows doesn't update the file modified time on flush(). See the bug report at + * https://bugreports.qt.io/browse/QTBUG-41119 for more details. + * + * So... On Windows we currently need to use a timer-based hack to check the individual + * files. + */ + +#ifdef Q_OS_WIN32 // Q_OS_LINUX +#define USE_FALLBACK_POLLER +#endif + using namespace std;