1 Commits

Author SHA1 Message Date
9832b2b275 fix empty board 2024-11-04 20:18:59 +01:00
2 changed files with 21 additions and 8 deletions

View File

@@ -4,8 +4,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
CONFIG += c++17 CONFIG += c++17
win32:VERSION = 0.3.1.0 # major.minor.patch.build win32:VERSION = 0.3.1.1 # major.minor.patch.build
else:VERSION = 0.3.1 # major.minor.patch else:VERSION = 0.3.1.1 # major.minor.patch
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
DEFINES += APP_NAME=\"\\\"TaskBoard\\\"\" DEFINES += APP_NAME=\"\\\"TaskBoard\\\"\"
@@ -63,6 +63,23 @@ linux-* {
QMAKE_CXXFLAGS_RELEASE *= -O3 QMAKE_CXXFLAGS_RELEASE *= -O3
} }
freebsd-* {
message("Build for FreeBSD")
DEFINES += APP_OS=\"\\\"$$system(freebsd-version -u)\\\"\"
DEFINES += APP_OS_VERSION=\"\\\"$$system(uname -r)\\\"\"
DEFINES += APP_ARCH=\"\\\"$$system(uname -m)\\\"\"
ARCH = $$system(uname -m)
equals(ARCH, aarch64) {
message("CPU Architecture : aarch64")
QMAKE_CXXFLAGS_RELEASE += -mtune=cortex-a72
}
equals(ARCH, amd64) {
message("CPU Architecture : amd64")
QMAKE_CXXFLAGS_RELEASE += -march=skylake
}
QMAKE_CXXFLAGS_RELEASE *= -O3
}
# You can make your code fail to compile if it uses deprecated APIs. # You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line. # In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

View File

@@ -702,15 +702,11 @@ void MainWindow::redrawTaskTree()
{ {
QTreeWidget *l = ui->taskList; QTreeWidget *l = ui->taskList;
uint16_t itemCount = l->topLevelItemCount(); uint16_t itemCount = l->topLevelItemCount();
if (itemCount == 0)
{
return;
}
for (int16_t i = itemCount; i >= 0; i--) for (int16_t i = itemCount; i >= 0; i--)
{ {
delete l->takeTopLevelItem(i); delete l->takeTopLevelItem(i);
} }
if (selectedBoardIndex > -1) if (selectedBoardIndex > -1 && selectedBoardIndex < boards.count())
{ {
Board *b = boards[selectedBoardIndex]; Board *b = boards[selectedBoardIndex];
std::optional<Status> boardStatus = TaskStateService::getInstance()->getStatusByUUID(b->getStatus()); std::optional<Status> boardStatus = TaskStateService::getInstance()->getStatusByUUID(b->getStatus());
@@ -727,7 +723,7 @@ void MainWindow::redrawTaskTree()
ui->taskList->addTopLevelItem(item); ui->taskList->addTopLevelItem(item);
} }
} }
else if (selectedFilterIndex > -1) else if (selectedFilterIndex > -1 && selectedFilterIndex < filters.count())
{ {
Filter f = filters[selectedFilterIndex]; Filter f = filters[selectedFilterIndex];
filterResult = f.filter(boards); filterResult = f.filter(boards);