Skip to content

Commit

Permalink
Fixed temperature category warning triggering too early
Browse files Browse the repository at this point in the history
  • Loading branch information
Cubitect committed Jan 14, 2021
1 parent f229353 commit 2718980
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aboutdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#define VERS_MAJOR 1
#define VERS_MINOR 2
#define VERS_PATCH 1
#define VERS_PATCH 2

// returns +1 if newer, -1 if older and 0 if equal
inline int cmpVers(int major, int minor, int patch)
Expand Down
24 changes: 22 additions & 2 deletions filterdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@
<string>Cancel</string>
</property>
<property name="icon">
<iconset theme="dialog-cancel"/>
<iconset theme="dialog-cancel">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
Expand All @@ -259,7 +260,8 @@
<string>Ok</string>
</property>
<property name="icon">
<iconset theme="dialog-ok"/>
<iconset theme="dialog-ok">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
</item>
Expand Down Expand Up @@ -357,6 +359,24 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>comboBoxType</tabstop>
<tabstop>buttonOk</tabstop>
<tabstop>buttonCancel</tabstop>
<tabstop>textDescription</tabstop>
<tabstop>spinBox</tabstop>
<tabstop>lineRadius</tabstop>
<tabstop>buttonArea</tabstop>
<tabstop>lineEditX1</tabstop>
<tabstop>lineEditZ1</tabstop>
<tabstop>lineEditX2</tabstop>
<tabstop>lineEditZ2</tabstop>
<tabstop>comboBoxRelative</tabstop>
<tabstop>tabWidget</tabstop>
<tabstop>buttonUncheck</tabstop>
<tabstop>buttonCheck</tabstop>
<tabstop>scrollArea</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
6 changes: 6 additions & 0 deletions search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ CandidateList getCandidates(int mc, const Condition *cond, int ccnt, int64_t buf
clist.scnt = 4;
clist.isiz = sizeof(*clist.items) + clist.scnt * sizeof(*clist.items->spos);
clist.mem = (char*) calloc(clist.bcnt, clist.isiz);
if (!clist.mem)
{
if (dyn)
free((void*)qb);
break;
}

Candidate *item = (Candidate*)(clist.mem);

Expand Down
7 changes: 4 additions & 3 deletions searchthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ bool SearchThread::set(int type, int64_t start48, int mc, const QVector<Conditio
}
if (c.type == F_TEMPS)
{
int w = c.x2 - c.x1;
int h = c.z2 - c.z1;
int w = c.x2 - c.x1 + 1;
int h = c.z2 - c.z1 + 1;
if (w * h < c.count)
{
QMessageBox::warning(NULL, "Warning", QString::asprintf(
"Temperature category condition with ID [%02d] has too many restrictions for the area.", c.save));
"Temperature category condition with ID [%02d] has too many restrictions (%d) for the area (%d x %d).",
c.save, c.count, w, h));
return false;
}
if (c.count == 0)
Expand Down

0 comments on commit 2718980

Please sign in to comment.