Skip to content

Commit

Permalink
Merge branch 'develop' and move to version 2024 update 2
Browse files Browse the repository at this point in the history
  • Loading branch information
flinco committed Jun 23, 2024
2 parents f895190 + 3243d77 commit abb3759
Show file tree
Hide file tree
Showing 56 changed files with 232 additions and 185 deletions.
56 changes: 28 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ project(LBChronoRace
DESCRIPTION "Timings and Rankings for Races"
HOMEPAGE_URL "http://github.com/flinco/LBChronoRace"
LANGUAGES CXX)
set(PROJECT_UPDATE 1)
set(PROJECT_UPDATE 2)
string(TIMESTAMP BUILD_DATE "%Y-%m-%d" UTC)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand All @@ -50,60 +50,60 @@ endif()
set(PROJECT_SOURCES
main.cpp
categoriesmodel.cpp
categoriesmodel.h
categoriesmodel.hpp
category.cpp
category.h
category.hpp
chronorace.ui
chronoracedata.cpp
chronoracedata.h
chronoracedata.hpp
chronoracedata.ui
chronoracelogo.cpp
chronoracelogo.h
chronoracelogo.hpp
chronoracetable.cpp
chronoracetable.h
chronoracetable.hpp
chronoracetable.ui
chronoracetimings.cpp
chronoracetimings.h
chronoracetimings.hpp
chronoracetimings.ui
classentry.cpp
classentry.h
classentry.hpp
competitor.cpp
competitor.h
competitor.hpp
crloader.cpp
crloader.h
crtablemodel.h
crloader.hpp
crtablemodel.hpp
csvrankingprinter.cpp
csvrankingprinter.h
csvrankingprinter.hpp
lbchronorace.cpp
lbchronorace.h
lbchronorace.hpp
lbcrexception.cpp
lbcrexception.h
lbcrexception.hpp
pdfrankingprinter.cpp
pdfrankingprinter.h
pdfrankingprinter.hpp
rankingsbuilder.cpp
rankingsbuilder.h
rankingsbuilder.hpp
rankingprinter.cpp
rankingprinter.h
rankingprinter.hpp
rankingswizard.cpp
rankingswizard.h
rankingswizard.hpp
rankingswizardformat.cpp
rankingswizardformat.h
rankingswizardformat.hpp
rankingswizardmode.cpp
rankingswizardmode.h
rankingswizardmode.hpp
rankingswizardselection.cpp
rankingswizardselection.h
rankingswizardselection.hpp
startlistmodel.cpp
startlistmodel.h
startlistmodel.hpp
teamclassentry.cpp
teamclassentry.h
teamclassentry.hpp
teamslistmodel.cpp
teamslistmodel.h
teamslistmodel.hpp
timing.cpp
timing.h
timing.hpp
timingsmodel.cpp
timingsmodel.h
txtrankingprinter.h
txtrankingprinter.cpp)
timingsmodel.hpp
txtrankingprinter.cpp
txtrankingprinter.hpp)

# Translations
set(TS_FILES
Expand Down
4 changes: 2 additions & 2 deletions categoriesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "categoriesmodel.h"
#include "lbcrexception.h"
#include "categoriesmodel.hpp"
#include "lbcrexception.hpp"

QDataStream &operator<<(QDataStream &out, CategoriesModel const &data)
{
Expand Down
4 changes: 2 additions & 2 deletions categoriesmodel.h → categoriesmodel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <QObject>
#include <QDataStream>

#include "crtablemodel.h"
#include "category.h"
#include "crtablemodel.hpp"
#include "category.hpp"

class CategoriesModel : public CRTableModel
{
Expand Down
8 changes: 4 additions & 4 deletions category.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "category.h"
#include "lbcrexception.h"
#include "category.hpp"
#include "lbcrexception.hpp"

Category::Field CategorySorter::sortingField = Category::Field::CTF_FIRST;
Qt::SortOrder CategorySorter::sortingOrder = Qt::AscendingOrder;
Expand Down Expand Up @@ -170,8 +170,8 @@ bool CategorySorter::operator() (Category const &lhs, Category const &rhs) const
return (sortingOrder == Qt::DescendingOrder) ? (lhs.getFullDescription() > rhs.getFullDescription()) : (lhs.getFullDescription() < rhs.getFullDescription());
case Category::Field::CTF_SHORT_DESCR:
return (sortingOrder == Qt::DescendingOrder) ? (lhs.getShortDescription() > rhs.getShortDescription()) : (lhs.getShortDescription() < rhs.getShortDescription());
case Category::Field::CTF_TEAM: //NOSONAR
// no break here
case Category::Field::CTF_TEAM:
[[fallthrough]];
default:
return (sortingOrder == Qt::DescendingOrder) ? (lhs > rhs) : (lhs < rhs);
}
Expand Down
2 changes: 1 addition & 1 deletion category.h → category.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <QDataStream>

#include "competitor.h"
#include "competitor.hpp"

namespace category {
class Category;
Expand Down
4 changes: 2 additions & 2 deletions chronoracedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <QFileDialog>
#include <QFileInfo>

#include "lbchronorace.h"
#include "chronoracedata.h"
#include "lbchronorace.hpp"
#include "chronoracedata.hpp"

ChronoRaceData::ChronoRaceData(QWidget *parent) : QDialog(parent) {

Expand Down
2 changes: 1 addition & 1 deletion chronoracedata.h → chronoracedata.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <QVector>

#include "ui_chronoracedata.h"
#include "chronoracelogo.h"
#include "chronoracelogo.hpp"

class ChronoRaceData : public QDialog
{
Expand Down
2 changes: 1 addition & 1 deletion chronoracelogo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "chronoracelogo.h"
#include "chronoracelogo.hpp"

void ChronoRaceLogo::loadLogo()
{
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion chronoracetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "chronoracetable.h"
#include "chronoracetable.hpp"

ChronoRaceTable::ChronoRaceTable(QWidget *parent) : QDialog(parent)
{
Expand Down
2 changes: 1 addition & 1 deletion chronoracetable.h → chronoracetable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <QDialog>

#include "ui_chronoracetable.h"
#include "crtablemodel.h"
#include "crtablemodel.hpp"

class ChronoRaceTable : public QDialog
{
Expand Down
17 changes: 11 additions & 6 deletions chronoracetimings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#include <QKeyEvent>
#include <QMessageBox>

#include "chronoracetimings.h"
#include "crloader.h"
#include "lbcrexception.h"
#include "chronoracetimings.hpp"
#include "crloader.hpp"
#include "lbcrexception.hpp"

TimingsWorker::TimingsWorker() {

Expand Down Expand Up @@ -78,11 +78,13 @@ ChronoRaceTimings::ChronoRaceTimings(QWidget *parent) : QDialog(parent) {
QObject::connect(ui->resetButton, &QToolButton::clicked, this, &ChronoRaceTimings::reset);

QObject::connect(ui->lockBox, &QCheckBox::clicked, this, &ChronoRaceTimings::lock);
QObject::connect(ui->unlockBox, &QCheckBox::clicked, this, &ChronoRaceTimings::lock);

saveToDiskWorker.moveToThread(&saveToDiskThread);
connect(this, &ChronoRaceTimings::saveToDisk, &saveToDiskWorker, &TimingsWorker::writeToDisk);
connect(&saveToDiskWorker, &TimingsWorker::writeDone, this, &ChronoRaceTimings::clearDiskBuffer);

ui->unlockBox->hide();
ui->stopButton->setEnabled(false);
}

Expand Down Expand Up @@ -339,14 +341,17 @@ void ChronoRaceTimings::lock(bool checked)
ui->stopButton->setEnabled(false);
ui->resetButton->setEnabled(false);
ui->buttonBox->setEnabled(false);
ui->lockBox->setIcon(QIcon(":/material/icons/lock.svg"));

ui->unlockBox->show();
ui->lockBox->hide();
ui->lockBox->setChecked(false);
} else {
ui->startButton->setEnabled(updateTimerId == 0);
ui->stopButton->setEnabled(updateTimerId != 0);
ui->resetButton->setEnabled(updateTimerId == 0);
ui->buttonBox->setEnabled(true);
ui->lockBox->setIcon(QIcon(":/material/icons/lock_open.svg"));
ui->lockBox->show();
ui->unlockBox->hide();
ui->unlockBox->setChecked(true);
}
this->setWindowFlag(Qt::WindowCloseButtonHint, !checked);
this->show();
Expand Down
File renamed without changes.
57 changes: 40 additions & 17 deletions chronoracetimings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="controlButtons" stretch="2,2,2,1">
<layout class="QHBoxLayout" name="controlButtons" stretch="3,3,3,2">
<item>
<widget class="QToolButton" name="startButton">
<property name="sizePolicy">
Expand Down Expand Up @@ -180,22 +180,45 @@
</widget>
</item>
<item>
<widget class="QCheckBox" name="lockBox">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Timer controls are disabled when checked</string>
</property>
<property name="text">
<string>LOCK</string>
</property>
<property name="icon">
<iconset resource="materialicons.qrc">
<normaloff>:/material/icons/lock_open.svg</normaloff>
<normalon>:/material/icons/lock.svg</normalon>:/material/icons/lock_open.svg</iconset>
</property>
</widget>
<layout class="QVBoxLayout" name="lockButtons">
<item>
<widget class="QCheckBox" name="lockBox">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Timer controls are disabled when locked</string>
</property>
<property name="text">
<string>LOCK</string>
</property>
<property name="icon">
<iconset resource="materialicons.qrc">
<normaloff>:/material/icons/lock_open.svg</normaloff>:/material/icons/lock_open.svg</iconset>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="unlockBox">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="toolTip">
<string>Timer controls are disabled when locked</string>
</property>
<property name="text">
<string>UNLOCK</string>
</property>
<property name="icon">
<iconset resource="materialicons.qrc">
<normaloff>:/material/icons/lock.svg</normaloff>:/material/icons/lock.svg</iconset>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
Expand Down
8 changes: 4 additions & 4 deletions classentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "classentry.h"
#include "crloader.h"
#include "lbcrexception.h"
#include "classentry.hpp"
#include "crloader.hpp"
#include "lbcrexception.hpp"

// Static members
QString ClassEntry::empty("*** ??? ***");
Expand All @@ -30,7 +30,7 @@ QString ClassEntryElement::formatNameCSV(bool first, QString const &name, QStrin

QString ClassEntryElement::formatNameTxt(bool first, QString const &name, QString const &sex, QString const &year) const
{
return QString("%1%2 (%3,%4)").arg(first ? "" : ",", name, sex, year);
return QString("%1%2 (%3,%4)").arg(first ? "" : ", ", name, sex, year);
}

void ClassEntryElement::addNames(bool csvFormat, bool first, QString &entryString, QString const &emptyName) const
Expand Down
4 changes: 2 additions & 2 deletions classentry.h → classentry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include <QVector>
#include <QString>

#include "competitor.h"
#include "timing.h"
#include "competitor.hpp"
#include "timing.hpp"

namespace placement {
class ClassEntryElement;
Expand Down
14 changes: 7 additions & 7 deletions competitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
*****************************************************************************/

#include "competitor.h"
#include "lbcrexception.h"
#include "competitor.hpp"
#include "lbcrexception.hpp"

Competitor::Field CompetitorSorter::sortingField = Competitor::Field::CMF_FIRST;
Qt::SortOrder CompetitorSorter::sortingOrder = Qt::AscendingOrder;
Expand Down Expand Up @@ -191,7 +191,7 @@ QString Competitor::toSexString(Sex const sex)
return "F";
case Sex::MISC:
return "X";
case Sex::UNDEFINED: // NOSONAR
case Sex::UNDEFINED:
return "U";
default:
throw(ChronoRaceException(tr("Unexpected Sex enum value '%1'").arg(static_cast<int>(sex))));
Expand Down Expand Up @@ -303,10 +303,10 @@ bool CompetitorSorter::operator() (Competitor const &lhs, Competitor const &rhs)
return (sortingOrder == Qt::DescendingOrder) ? (lhs.getYear() > rhs.getYear()) : (lhs.getYear() < rhs.getYear());
case Competitor::Field::CMF_TEAM:
return (sortingOrder == Qt::DescendingOrder) ? (lhs.getTeam() > rhs.getTeam()) : (lhs.getTeam() < rhs.getTeam());
case Competitor::Field::CMF_BIB: // NOSONAR
// nobreak here
case Competitor::Field::CMF_OFFSET_LEG: // NOSONAR
// nobreak here
case Competitor::Field::CMF_BIB:
[[fallthrough]];
case Competitor::Field::CMF_OFFSET_LEG:
[[fallthrough]];
default:
return (sortingOrder == Qt::DescendingOrder) ? (lhs > rhs) : (lhs < rhs);
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions crloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
#include <QTextStream>
#include <QRegularExpression>

#include "crloader.h"
#include "lbcrexception.h"
#include "crloader.hpp"
#include "lbcrexception.hpp"

// Members initialization
StartListModel CRLoader::startListModel;
Expand Down
Loading

0 comments on commit abb3759

Please sign in to comment.