Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version update 4.02 #62

Merged
merged 34 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f1ca0a8
Fix for clang
elB4RTO May 16, 2024
b1f800b
Fix for BSD
elB4RTO May 16, 2024
cbdc2da
Updated Docker build scripts
elB4RTO May 19, 2024
2f6180c
Updated UI
elB4RTO May 19, 2024
436ebfc
Updated resources
elB4RTO May 19, 2024
0ac75c0
Updated GlobalConfigs namespace
elB4RTO May 19, 2024
08a12f5
Introduced PathHandler class
elB4RTO May 19, 2024
f6500cf
Upgrade to C++23
elB4RTO May 19, 2024
0edda06
Code improvements and updates
elB4RTO May 19, 2024
f6eb044
Updates
elB4RTO May 19, 2024
25c380c
Updates
elB4RTO May 19, 2024
431140e
Updates
elB4RTO May 19, 2024
e42316f
Updates
elB4RTO May 19, 2024
9396461
Updates
elB4RTO May 19, 2024
ec0c2f8
Code improvements
elB4RTO Jul 27, 2024
33bc128
Updated IOutils namespace
elB4RTO Jul 27, 2024
fbba73c
Updated documentation comments
elB4RTO Jul 27, 2024
a414eb7
Added translation script
elB4RTO Aug 4, 2024
0e1a1da
Updated translation files
elB4RTO Aug 4, 2024
510c233
Updated translation resurces
elB4RTO Aug 4, 2024
bd43a2f
Updated CMake files
elB4RTO Aug 4, 2024
b8c9f47
Updated UI
elB4RTO Aug 4, 2024
60c745d
Added new custom model
elB4RTO Aug 4, 2024
365e3c8
Updates
elB4RTO Aug 4, 2024
679404d
Removed unused icons
elB4RTO Aug 4, 2024
0c7375d
Updated resources
elB4RTO Aug 4, 2024
98894f5
Version update
elB4RTO Aug 4, 2024
9913598
Updated Changelog
elB4RTO Aug 4, 2024
d33f63e
Code improvements
elB4RTO Aug 28, 2024
0c4d44c
Code improvements
elB4RTO Aug 28, 2024
5997402
Fixes
elB4RTO Aug 29, 2024
a3f55ce
Fixes for Windows
elB4RTO Aug 29, 2024
2a7cda9
Improvements and fixes
elB4RTO Aug 30, 2024
6ec9197
Fix
elB4RTO Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ RUN bash -c "scripts/DOCKER_private.sh"
WORKDIR /
RUN rm -rf /tmp/logdoctor

LABEL logdoctor.version=4.01
LABEL logdoctor.version=4.02

ENTRYPOINT /usr/bin/logdoctor
3 changes: 3 additions & 0 deletions installation_stuff/logdoctor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ DatabaseHashesPath=
DatabaseDoBackup=true
DatabaseBackupsNumber=3

[Security]
FollowSymlinks=false

[TextBrowser]
Font=0
WideLines=true
Expand Down
4 changes: 2 additions & 2 deletions installation_stuff/osx_bundle/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
<key>CFBundleIdentifier</key>
<string>com.logdoctor.LogDoctor</string>
<key>CFBundleShortVersionString</key>
<string>4.01</string>
<string>4.02</string>
<key>CFBundleVersion</key>
<string>4.01</string>
<string>4.02</string>
<key>CFBundleExecutable</key>
<string>LogDoctor</string>
<key>CFBundleIconFile</key>
Expand Down
2 changes: 1 addition & 1 deletion logdoctor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.5)

project(LogDoctor VERSION 4.01 LANGUAGES CXX)
project(LogDoctor VERSION 4.02 LANGUAGES CXX)

include(cmake/project.cmake)
logdoc_set_cmake_options()
Expand Down
2 changes: 1 addition & 1 deletion logdoctor/cmake/project.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ macro(logdoc_set_cmake_options)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

endmacro()
43 changes: 41 additions & 2 deletions logdoctor/cmake/translations.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@

set(TS_FILES
translations/LogDoctor_ar_AR.ts
translations/LogDoctor_az_AZ.ts
translations/LogDoctor_bg_BG.ts
translations/LogDoctor_bn_BN.ts
translations/LogDoctor_ca_SP.ts
translations/LogDoctor_cs_CZ.ts
translations/LogDoctor_da_DA.ts
translations/LogDoctor_de_GE.ts
translations/LogDoctor_el_GR.ts
translations/LogDoctor_en_GB.ts
translations/LogDoctor_es_ES.ts
translations/LogDoctor_eo_EO.ts
translations/LogDoctor_es_SP.ts
translations/LogDoctor_et_ES.ts
translations/LogDoctor_fa_PE.ts
translations/LogDoctor_fi_FI.ts
translations/LogDoctor_fr_FR.ts
translations/LogDoctor_ga_IR.ts
translations/LogDoctor_he_HE.ts
translations/LogDoctor_hi_IN.ts
translations/LogDoctor_hu_HU.ts
translations/LogDoctor_id_ID.ts
translations/LogDoctor_it_IT.ts
translations/LogDoctor_ja_JP.ts
translations/LogDoctor_ja_JA.ts
translations/LogDoctor_ko_KO.ts
translations/LogDoctor_lt_LI.ts
translations/LogDoctor_lv_LA.ts
translations/LogDoctor_ms_MA.ts
translations/LogDoctor_nb_NB.ts
translations/LogDoctor_nl_NL.ts
translations/LogDoctor_pl_PL.ts
translations/LogDoctor_pt_BR.ts
translations/LogDoctor_pt_PT.ts
translations/LogDoctor_ro_RO.ts
translations/LogDoctor_ru_RU.ts
translations/LogDoctor_sk_SK.ts
translations/LogDoctor_sl_SL.ts
translations/LogDoctor_sq_AL.ts
translations/LogDoctor_sv_SV.ts
translations/LogDoctor_th_TH.ts
translations/LogDoctor_tl_PH.ts
translations/LogDoctor_tr_TR.ts
translations/LogDoctor_uk_UK.ts
translations/LogDoctor_ur_PA.ts
translations/LogDoctor_zh_CN.ts
translations/LogDoctor_zt_CN.ts
)

macro(logdoc_add_lupdate_target)
Expand Down
2 changes: 2 additions & 0 deletions logdoctor/customs/models/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

target_sources(LogDoctor PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/languages_listmodel.h
${CMAKE_CURRENT_SOURCE_DIR}/languages_listmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/logfields_listmodel.h
${CMAKE_CURRENT_SOURCE_DIR}/logfields_listmodel.cpp
)
46 changes: 46 additions & 0 deletions logdoctor/customs/models/languages_listmodel.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

#include "languages_listmodel.h"

#include "modules/exceptions.h"


LanguagesListModel::LanguagesListModel(QObject *parent)
: QAbstractListModel{parent}
{
}

int LanguagesListModel::indexOfLanguage( const std::string& lang ) const
{
int index{ 0 };
for ( const auto& [code,_] : this->model_data ) {
if ( code == lang ) {
return index;
}
++index;
}
throw DoNotCatchException( "Unexpected Language code", lang );
}

int LanguagesListModel::rowCount( const QModelIndex& parent ) const
{
Q_UNUSED(parent)
return static_cast<int>( this->model_data.size() );
}

QVariant LanguagesListModel::data( const QModelIndex& index, int role ) const
{
if ( !index.isValid() || index.row() >= this->model_data.size() ) {
return QVariant{};
}

const auto& item{ this->model_data.at( index.row() ) };

switch ( role ) {
case Qt::DisplayRole:
return item.second;
case Qt::UserRole:
return QVariant::fromValue<std::string>( item.first );
default:
return QVariant{};
}
}
80 changes: 80 additions & 0 deletions logdoctor/customs/models/languages_listmodel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#ifndef LOGDOCTOR__CUSTOMS__LANGUAGES_LISTMODEL_H
#define LOGDOCTOR__CUSTOMS__LANGUAGES_LISTMODEL_H


#include <QAbstractListModel>


class LanguagesListModel final : public QAbstractListModel
{
Q_OBJECT

using data_pair_t = std::pair<std::string,QString>;
using model_data_t = std::vector<data_pair_t>;

public:
explicit LanguagesListModel(QObject* parent=nullptr);

//! Returns the index in the model of the given language code
/*!
\param lang The language code
\return The index in the model
\throw DoNotCatchException
*/
int indexOfLanguage( const std::string& lang ) const;

int rowCount( const QModelIndex& parent=QModelIndex() ) const override;
QVariant data( const QModelIndex& index, int role ) const override;

private:
const model_data_t model_data{
{"sq_AL", QStringLiteral("Albanian (Albania)")},
{"ar_AR", QStringLiteral("Arabic (classic)")},
{"az_AZ", QStringLiteral("Azerbaijani (Azerbaijan)")},
{"bn_BN", QStringLiteral("Bengali (Bangladesh)")},
{"bg_BG", QStringLiteral("Bulgarian (Bulgaria)")},
{"ca_SP", QStringLiteral("Catalan (Spain)")},
{"zh_CN", QStringLiteral("Chinese (cantonese) (China)")},
{"zt_CN", QStringLiteral("Chinese (traditional) (China)")},
{"cs_CZ", QStringLiteral("Czech (Czech Republic)")},
{"da_DA", QStringLiteral("Danish (Denmark)")},
{"nl_NL", QStringLiteral("Dutch (Netherland)")},
{"en_GB", QStringLiteral("English (United Kingdom)")},
{"eo_EO", QStringLiteral("Esperanto")},
{"et_ES", QStringLiteral("Estonian (Estonia)")},
{"fi_FI", QStringLiteral("Finnish (Finland)")},
{"fr_FR", QStringLiteral("French (France)")},
{"de_GE", QStringLiteral("German (Germany)")},
{"el_GR", QStringLiteral("Greek (modern) (Greece)")},
{"he_HE", QStringLiteral("Hebrew")},
{"hi_IN", QStringLiteral("Hindi (India)")},
{"hu_HU", QStringLiteral("Hungarian (Hungary)")},
{"id_ID", QStringLiteral("Indonesian (Indonesia)")},
{"ga_IR", QStringLiteral("Irish (Ireland)")},
{"it_IT", QStringLiteral("Italian (Italy)")},
{"ja_JP", QStringLiteral("Japanese (Japan)")},
{"ko_KO", QStringLiteral("Korean (Korea)")},
{"lt_LI", QStringLiteral("Lithuanian (Lithuania)")},
{"lv_LA", QStringLiteral("Latvian (Latvia)")},
{"ms_MA", QStringLiteral("Malay (Malaysia)")},
{"nb_NB", QStringLiteral("Norwegian (Norway)")},
{"fa_PE", QStringLiteral("Persian (Persia)")},
{"pl_PL", QStringLiteral("Polish (Poland)")},
{"pt_BR", QStringLiteral("Portuguese (Brazil)")},
{"pt_PT", QStringLiteral("Portuguese (Portugal)")},
{"ro_RO", QStringLiteral("Romanian (Romania)")},
{"ru_RU", QStringLiteral("Russian (Russia)")},
{"sk_SK", QStringLiteral("Slovak (Slovakia)")},
{"sl_SL", QStringLiteral("Slovenian (Slovenia)")},
{"es_SP", QStringLiteral("Spanish (Spain)")},
{"sv_SV", QStringLiteral("Swedish (Sweden)")},
{"tl_PH", QStringLiteral("Tagalog (Philippines)")},
{"th_TH", QStringLiteral("Thai (Thailand)")},
{"tr_TR", QStringLiteral("Turkish (Turkey)")},
{"uk_UK", QStringLiteral("Ukranian (Ukraine)")},
{"ur_PA", QStringLiteral("Urdu (Pakistan)")}
};
};


#endif // LOGDOCTOR__CUSTOMS__LANGUAGES_LISTMODEL_H
2 changes: 1 addition & 1 deletion logdoctor/customs/models/logfields_listmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LogFieldsListModel : public QAbstractListModel
QVariant data( const QModelIndex& index, int role ) const override;

private:
real_data_t real_data;
real_data_t real_data;
QVector<QString> view_data;

};
Expand Down
6 changes: 3 additions & 3 deletions logdoctor/games/crisscross/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void CrissCross::victory() noexcept
{
// disable all buttons except the victory sequence ones
bool disable{ true };
for ( unsigned i=0; i<9; ++i ) {
for ( std::size_t i{0ul}; i<9ul; ++i ) {
disable |= true;
for ( const auto& j : this->victory_sequence ) {
if ( i == j ) {
Expand Down Expand Up @@ -288,12 +288,12 @@ void CrissCross::AI_playTurn() noexcept
void CrissCross::AI_updateWeights() noexcept
{
// reset the weights
for ( size_t i{0ul}; i<9ul; ++i ) {
for ( std::size_t i{0ul}; i<9ul; ++i ) {
this->board_weights[ i ] = 0;
}
// calculate the new weights
unsigned win_streak, lose_streak;
std::vector<size_t> empty_tiles (3);
std::vector<std::size_t> empty_tiles (3);
for ( const auto& sequence : this->sequences ) {
// reset data
win_streak = lose_streak = 0;
Expand Down
4 changes: 2 additions & 2 deletions logdoctor/games/crisscross/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private slots:
const bool p2_human{ !p1_human };

// victory related
std::vector<unsigned> victory_sequence;
std::vector<std::size_t> victory_sequence;

// game data
unsigned board[9]{
Expand All @@ -72,7 +72,7 @@ private slots:
QIcon(":/games/games/crisscross/x.png")
};

const size_t sequences[8][3]{
const std::size_t sequences[8][3]{
{0,1,2},{3,4,5},{6,7,8}, // horizontal
{0,3,6},{1,4,7},{2,5,8}, // vertical
{0,4,8},{2,4,6} // diagonal
Expand Down
2 changes: 1 addition & 1 deletion logdoctor/games/snake/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ private slots:
//// SNAKE ////

//! The maximum length of the snake
const size_t MAX_SNAKE_LENGTH{ 64 };
const std::size_t MAX_SNAKE_LENGTH{ 64 };

//! The snake
Snake snake;
Expand Down
Loading
Loading