Skip to content

Commit

Permalink
Merge branch 'develop' and move to version 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
flinco committed Jul 24, 2023
2 parents 9bdc3c7 + 467c537 commit ba6f662
Show file tree
Hide file tree
Showing 18 changed files with 154 additions and 211 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

cmake_minimum_required(VERSION 3.20)
project(LBChronoRace
VERSION 3.0.6
VERSION 3.1.0
DESCRIPTION "Timings for Races"
HOMEPAGE_URL "http://github.com/flinco/LBChronoRace"
LANGUAGES CXX)
Expand Down
10 changes: 5 additions & 5 deletions chronoracedata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ void ChronoRaceData::loadLogo(QLabel *label)

if (!newLogo.isNull()) {
LBChronoRace::lastSelectedPath = QFileInfo(logoFileName).absoluteDir();
// get label dimensions
//int w = label->width(); //NOSONAR
//int h = label->height(); //NOSONAR
/* get label dimensions */
//NOSONAR int w = label->width();
//NOSONAR int h = label->height();

label->setPixmap(newLogo);
// set a scaled pixmap to a w x h window keeping its aspect ratio
//label->setPixmap(newLogo.scaled(w, h, Qt::KeepAspectRatio)); //NOSONAR
/* set a scaled pixmap to a w x h window keeping its aspect ratio */
//NOSONAR label->setPixmap(newLogo.scaled(w, h, Qt::KeepAspectRatio));
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions competitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ void Competitor::setTeam(QString const &newTeam)
this->team = newTeam;
}

void Competitor::setTeam(QString const *newTeam)
{
if (newTeam)
this->team = *newTeam;
}

uint Competitor::getYear() const
{
return year;
Expand Down
1 change: 1 addition & 0 deletions competitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Competitor
QString const &getTeam() const;
QString getTeam(int newWidth) const;
void setTeam(QString const &newTeam);
void setTeam(QString const *newTeam);
uint getYear() const;
void setYear(uint newYear);
uint getLeg() const;
Expand Down
6 changes: 3 additions & 3 deletions csvrankingprinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void CSVRankingPrinter::printStartList(QList<Competitor> const &startList, QWidg
outStream << Qt::endl;

QFileInfo outFileInfo(cvsFileName);
emit info(tr("Generated Start List: %1").arg(outFileInfo.absoluteFilePath()));
emit info(tr("Generated Start List: %1").arg(QDir::toNativeSeparators(outFileInfo.absoluteFilePath())));
lastSelectedPath = outFileInfo.absoluteDir();

outStream.flush();
Expand All @@ -94,7 +94,7 @@ void CSVRankingPrinter::printRanking(const Category &category, QList<ClassEntry
printCSVRanking(ranking, outStream);

QFileInfo outFileInfo(outFile);
emit info(tr("Generated Results '%1': %2").arg(category.getFullDescription(), outFileInfo.absoluteFilePath()));
emit info(tr("Generated Results '%1': %2").arg(category.getFullDescription(), QDir::toNativeSeparators(outFileInfo.absoluteFilePath())));

outStream.flush();
outFile.close();
Expand All @@ -117,7 +117,7 @@ void CSVRankingPrinter::printRanking(const Category &category, QList<TeamClassEn
printCSVRanking(ranking, category.getShortDescription(), outStream);

QFileInfo outFileInfo(outFile);
emit info(tr("Generated Results '%1': %2").arg(category.getFullDescription(), outFileInfo.absoluteFilePath()));
emit info(tr("Generated Results '%1': %2").arg(category.getFullDescription(), QDir::toNativeSeparators(outFileInfo.absoluteFilePath())));

outStream.flush();
outFile.close();
Expand Down
7 changes: 6 additions & 1 deletion installer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ set(_QTIFW_SUFFIXES
"4.1/bin"
"4.2/bin"
"4.3/bin"
"4.4/bin")
"4.4/bin"
"4.5/bin"
"4.6/bin"
"4.7/bin"
"4.8/bin"
"4.9/bin")
find_program(QTIFW_BINARYCREATOR_EXECUTABLE
NAMES binarycreator
PATHS ${_QTIFW_PATHS}
Expand Down
17 changes: 1 addition & 16 deletions installer/packages/pro.buzzi.lbchronorace/meta/en.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>installscript</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>Register ChronoRace Data file extension: </source>
<translation>Register ChronoRace Data file extension: </translation>
</message>
<message>
<source>Start LBChronoRace</source>
<translation>Start LBChronoRace</translation>
</message>
</context>
<TS version="2.1">
</TS>
86 changes: 0 additions & 86 deletions installer/packages/pro.buzzi.lbchronorace/meta/installscript.qs

This file was deleted.

17 changes: 1 addition & 16 deletions installer/packages/pro.buzzi.lbchronorace/meta/it.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="it_IT">
<context>
<name>installscript</name>
<message>
<source>Form</source>
<translation>Form</translation>
</message>
<message>
<source>Register ChronoRace Data file extension: </source>
<translation>Registra estensione file ChronoRace Data: </translation>
</message>
<message>
<source>Start LBChronoRace</source>
<translation>Avvia LBChronoRace</translation>
</message>
</context>
<TS version="2.1">
</TS>
43 changes: 30 additions & 13 deletions installer/packages/pro.buzzi.lbchronorace/meta/package.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<License name="GNU GPLv3" file="license.txt" />
<License name="GNU GPLv3" file="license_it.txt" />
</Licenses>
<!--
<Script>installscript.qs</Script>
<UserInterfaces>
<UserInterface>registerfilecheckboxform.ui</UserInterface>
Expand All @@ -21,31 +22,47 @@
<Translation>en.qm</Translation>
<Translation>it.qm</Translation>
</Translations>
-->
<!--<DownloadableArchives>component2.7z, component2a.7z</DownloadableArchives>-->
<!--<AutoDependOn>com.vendor.root.component3</AutoDependOn>-->
<!--<SortingPriority>10</SortingPriority>-->
<!--<UpdateText>This changed compared to the last release</UpdateText>-->
<!--
<Default>script</Default>
-->
<ForcedInstallation>true</ForcedInstallation>
<!--<ForcedUpdate>false</ForcedUpdate>-->
<Essential>true</Essential>
<!--
<Checkable>true</Checkable>
<Replaces>com.vendor.root.component2old</Replaces>
<!--<Checkable>true</Checkable>-->
<!--<Replaces>com.vendor.root.component2old</Replaces>-->
<Operations>
<Operation name="AppendFile">
<Argument>@at@TargetDir@at@/A.txt</Argument>
<Argument>lorem ipsum</Argument>
<Operation name="CreateShortcut">
<Argument>@at@TargetDir@at@\LBChronoRace.exe</Argument>
<Argument>@at@StartMenuDir@at@\LBChronoRace.lnk</Argument>
<Argument>workingDirectory=@at@TargetDir@at@</Argument>
<Argument>iconPath=@at@TargetDir@at@\LBChronoRace.exe</Argument>
<Argument>iconId=0</Argument>
<Argument>description="Start LBChronoRace"</Argument>
</Operation>
<Operation name="Extract">
<Argument>@at@TargetDir@at@/Folder1</Argument>
<Argument>content.7z</Argument>
<Operation name="CreateShortcut">
<Argument>@at@TargetDir@at@\LBChronoRace.exe</Argument>
<Argument>@at@DesktopDir@at@\LBChronoRace.lnk</Argument>
<Argument>workingDirectory=@at@TargetDir@at@</Argument>
<Argument>iconPath=@at@TargetDir@at@\LBChronoRace.exe</Argument>
<Argument>iconId=0</Argument>
<Argument>description="Start LBChronoRace"</Argument>
</Operation>
<Operation name="Extract">
<Argument>@at@TargetDir@at@/Folder2</Argument>
<Operation name="RegisterFileType">
<Argument>crd</Argument>
<!--<Argument>"@at@TargetDir@at@\LBChronoRace.exe" "%1"</Argument>-->
<Argument>"C:\Program Files\LBChronoRace\LBChronoRace.exe" "%1"</Argument>
<Argument>LBChronoRace Data</Argument>
<Argument>application/x-binary</Argument>
<!--<Argument>@at@TargetDir@at@\LBChronoRaceCRD.ico</Argument>-->
<Argument>C:\Program Files\LBChronoRace\LBChronoRaceCRD.ico</Argument>
<Argument>ProgId=LBChronoRace.exe</Argument>
</Operation>
</Operations>
<TreeName>com.vendor.subcomponent</TreeName>
-->
<!--<TreeName>com.vendor.subcomponent</TreeName>-->
</Package>

This file was deleted.

34 changes: 22 additions & 12 deletions lbchronorace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ void LBChronoRace::initialize() {

auto argument = arguments.constBegin();
if (++argument != arguments.constEnd()) {
raceDataFileName = *argument;
if (loadRaceFile(*argument))
raceDataFileName = *argument;
while (++argument != arguments.constEnd())
appendErrorMessage(tr("Warning: skipping file %1").arg(*argument));
loadRace();
}
}

Expand Down Expand Up @@ -339,19 +339,17 @@ void LBChronoRace::selectorFormat(QString const &arg1) const
appendInfoMessage(tr("Selected format: %1").arg(arg1));
}

void LBChronoRace::loadRace()
bool LBChronoRace::loadRaceFile(QString const &fileName)
{
raceDataFileName.clear();
raceDataFileName = QFileDialog::getOpenFileName(this, tr("Select Race Data File"),
lastSelectedPath.absolutePath(), tr("ChronoRace Data (*.crd)"));
bool retval = false;

if (!raceDataFileName.isEmpty()) {
QFile raceDataFile(raceDataFileName);
lastSelectedPath = QFileInfo(raceDataFileName).absoluteDir();
if (!fileName.isEmpty()) {
QFile raceDataFile(fileName);
lastSelectedPath = QFileInfo(fileName).absoluteDir();

if (raceDataFile.open(QIODevice::ReadOnly)) {
quint32 binFmt;
QFileInfo raceDataFileInfo(raceDataFileName);
QFileInfo raceDataFileInfo(fileName);

QDataStream in(&raceDataFile);
in.setVersion(QDataStream::Qt_5_15);
Expand Down Expand Up @@ -396,17 +394,29 @@ void LBChronoRace::loadRace()
setCounterTimings(tableCount);
appendInfoMessage(tr("Loaded: %n timing(s)", "", tableCount));

appendInfoMessage(tr("Race loaded: %1").arg(raceDataFileName));
appendInfoMessage(tr("Race loaded: %1").arg(fileName));
retval = true;
break;
default:
QMessageBox::information(this, tr("Race Data File Error"), tr("Format version %1 not supported").arg(binFmt));
break;
}
} else {
QMessageBox::information(this, tr("Unable to open file"), raceDataFile.errorString());
raceDataFileName.clear();
}
}

return retval;
}

void LBChronoRace::loadRace()
{
QString fileName = QFileDialog::getOpenFileName(this, tr("Select Race Data File"),
lastSelectedPath.absolutePath(),
tr("ChronoRace Data (*.crd)"));

if (loadRaceFile(fileName))
raceDataFileName = fileName;
}

void LBChronoRace::saveRace()
Expand Down
2 changes: 2 additions & 0 deletions lbchronorace.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public slots:
ChronoRaceTable categoriesTable;
ChronoRaceTable timingsTable;

bool loadRaceFile(QString const &fileName);

private slots:
void actionAbout();
void actionAboutQt();
Expand Down
Loading

0 comments on commit ba6f662

Please sign in to comment.