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

Use of std::format in Progress #1625

Merged
merged 4 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Visual Studio 2019
name: Visual Studio 2022

on:
pull_request:
Expand All @@ -13,7 +13,7 @@ on:
jobs:
build_cmake:
name: cmake
runs-on: windows-2019
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,7 +32,7 @@ jobs:
- name: Create build directory
run: mkdir build
- name: Configure build project
run: cmake -G "Visual Studio 16 2019" -A x64 -DOSMSCOUT_BUILD_DOC_API=OFF -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -Wno-dev ..
run: cmake -G "Visual Studio 17 2022" -A x64 -DOSMSCOUT_BUILD_DOC_API=OFF -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake -Wno-dev ..
working-directory: build
- name: Build project
run: cmake --build build
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:

build_meson:
name: meson
runs-on: windows-2019
runs-on: windows-2022
defaults:
run:
shell: cmd
Expand All @@ -91,7 +91,7 @@ jobs:
with:
architecture: x64
- name: Configure build project
run: meson setup --buildtype debugoptimized --wrap-mode nofallback --unity on -DenableXML=false build
run: meson setup --buildtype debugoptimized --wrap-mode nofallback --unity on -DenableXML=false -Dcpp_std=vc++latest build
- name: Dump found dependencies
run: meson introspect --dependencies
working-directory: build
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/build_on_ubuntu_22_04_qt_android.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Ubuntu 22.04 for Qt on Android
name: Ubuntu 24.04 for Qt on Android

# See https://doc.qt.io/qt-5/android-getting-started.html
# See https://github.com/jurplel/install-qt-action
# See https://github.com/miurahr/aqtinstall/
# See https://groups.google.com/g/android-ndk-announce?hl=de for released Android NDK versions

on:
pull_request:
Expand All @@ -17,7 +18,7 @@ on:
jobs:
build:
name: Ubuntu+android - Build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -29,7 +30,7 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3
with:
packages: "platform-tools platforms;android-34 build-tools;34.0.0 ndk;26.3.11579264"
packages: "platform-tools platforms;android-34 build-tools;34.0.0 ndk;27.2.12479018"
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -47,8 +48,8 @@ jobs:
run: ls -l ../Qt/5.15.2/android/
- name: Configure build project
run: "cmake -B build
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/26.3.11579264/build/cmake/android.toolchain.cmake
-DANDROID_NDK=${ANDROID_HOME}/ndk/26.3.11579264/
-DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/27.2.12479018/build/cmake/android.toolchain.cmake
-DANDROID_NDK=${ANDROID_HOME}/ndk/27.2.12479018/
-DANDROID_ABI=arm64-v8a
-DANDROID_PLATFORM=android-34
-DANDROID_STL=c++_shared
Expand Down
8 changes: 4 additions & 4 deletions BasemapImport/src/BasemapImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CoastlineShapeFileVisitor : public osmscout::ShapeFileVisitor
osmscout::Progress& progress)
: progress(progress)
{
progress.SetAction("Scanning world coastline file '"+coastlineShapeFile+"'");
progress.SetAction("Scanning world coastline file '{}'",coastlineShapeFile);

coastlineCount=0;
continuation=false;
Expand All @@ -64,7 +64,7 @@ class CoastlineShapeFileVisitor : public osmscout::ShapeFileVisitor
progress.Error("Last element is not properly closed");
}

progress.Info("Found "+std::to_string(coastlineCount)+ " coastline(s)");
progress.Info("Found {} coastline(s)",coastlineCount);
}

void AddCoast(const std::vector<osmscout::GeoCoord>& coords)
Expand Down Expand Up @@ -249,7 +249,7 @@ static bool ImportCoastlines(const std::string& destinationDirectory,

processor.DumpIndexHeader(writer,
levels);
progress.Info("Generating index for level "+std::to_string(indexMinMag)+" to "+std::to_string(indexMaxMag));
progress.Info("Generating index for level {} to {}",indexMinMag,indexMaxMag);

for (auto& level : levels) {
osmscout::Magnification magnification(osmscout::MagnificationLevel(level.level));
Expand All @@ -259,7 +259,7 @@ static bool ImportCoastlines(const std::string& destinationDirectory,

projection.Set(osmscout::GeoCoord(0.0,0.0),magnification,72,640,480);

progress.SetAction("Building tiles for level "+std::to_string(level.level));
progress.SetAction("Building tiles for level {}",level.level);

if (!visitor.coasts.empty()) {
osmscout::WaterIndexProcessor::Data data;
Expand Down
142 changes: 53 additions & 89 deletions Import/src/Import.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,98 +295,62 @@ static void DumpParameter(const osmscout::ImportParameter& parameter,
{
progress.SetStep("Dump parameter");
for (const auto& filename : parameter.GetMapfiles()) {
progress.Info(std::string("Mapfile: ")+filename);
progress.Info("Mapfile: {}",filename);
}

progress.Info(std::string("typefile: ")+parameter.GetTypefile());
progress.Info(std::string("Destination directory: ")+parameter.GetDestinationDirectory());
progress.Info(std::string("Steps: ")+
std::to_string(parameter.GetStartStep())+
" - "+
std::to_string(parameter.GetEndStep()));
progress.Info("Typefile: {}",parameter.GetTypefile());
progress.Info("Destination directory: {}",parameter.GetDestinationDirectory());
progress.Info("Steps: {} - {}",
parameter.GetStartStep(),
parameter.GetEndStep());



for (const auto& router : parameter.GetRouter()) {
progress.Info(std::string("Router: ") + VehicleMaskToString(router.GetVehicleMask()) + " - '" + router.GetFilenamebase() + "'");
progress.Info("Router: {} - '{}'",VehicleMaskToString(router.GetVehicleMask()),router.GetFilenamebase());
}

progress.Info(std::string("StrictAreas: ")+
(parameter.GetStrictAreas() ? "true" : "false"));

progress.Info(std::string("ProcessingQueueSize: ")+
std::to_string(parameter.GetProcessingQueueSize()));

progress.Info(std::string("NumericIndexPageSize: ")+
std::to_string(parameter.GetNumericIndexPageSize()));

progress.Info(std::string("RawCoordBlockSize: ")+
std::to_string(parameter.GetRawCoordBlockSize()));

progress.Info(std::string("RawNodeDataMemoryMaped: ")+
(parameter.GetRawNodeDataMemoryMaped() ? "true" : "false"));

progress.Info(std::string("RawWayIndexMemoryMaped: ")+
(parameter.GetRawWayIndexMemoryMaped() ? "true" : "false"));
progress.Info(std::string("RawWayDataMemoryMaped: ")+
(parameter.GetRawWayDataMemoryMaped() ? "true" : "false"));
progress.Info(std::string("RawWayIndexCacheSize: ")+
std::to_string(parameter.GetRawWayIndexCacheSize()));
progress.Info(std::string("RawWayBlockSize: ")+
std::to_string(parameter.GetRawWayBlockSize()));


progress.Info(std::string("SortObjects: ")+
(parameter.GetSortObjects() ? "true" : "false"));
progress.Info(std::string("SortBlockSize: ")+
std::to_string(parameter.GetSortBlockSize()));

progress.Info(std::string("CoordDataMemoryMaped: ")+
(parameter.GetCoordDataMemoryMaped() ? "true" : "false"));
progress.Info(std::string("CoordIndexCacheSize: ")+
std::to_string(parameter.GetCoordIndexCacheSize()));
progress.Info(std::string("CoordBlockSize: ")+
std::to_string(parameter.GetCoordBlockSize()));

progress.Info(std::string("AreaDataMemoryMaped: ")+
(parameter.GetAreaDataMemoryMaped() ? "true" : "false"));
progress.Info(std::string("AreaDataCacheSize: ")+
std::to_string(parameter.GetAreaDataCacheSize()));
progress.Info(std::string("AreaWayIndexMinMag: ")+
std::to_string(parameter.GetAreaWayIndexMinMag().Get()));
progress.Info(std::string("AreaWayIndexMaxMag: ")+
std::to_string(parameter.GetAreaWayIndexMaxMag().Get()));

progress.Info(std::string("WayDataMemoryMaped: ")+
(parameter.GetWayDataMemoryMaped() ? "true" : "false"));
progress.Info(std::string("WayDataCacheSize: ")+
std::to_string(parameter.GetWayDataCacheSize()));

progress.Info("AreaNodeGridMag: "+
std::to_string(parameter.GetAreaNodeGridMag().Get()));
progress.Info("AreaNodeSimpleListLimit: "+
std::to_string(parameter.GetAreaNodeSimpleListLimit()));
progress.Info("AreaNodeTileListLimit: "+
std::to_string(parameter.GetAreaNodeTileListLimit()));
progress.Info("AreaNodeTileListCoordLimit: "+
std::to_string(parameter.GetAreaNodeTileListCoordLimit()));
progress.Info("AreaNodeBitmapMaxMag: "+
std::to_string(parameter.GetAreaNodeBitmapMaxMag().Get()));
progress.Info("AreaNodeBitmapLimit: "+
std::to_string(parameter.GetAreaNodeBitmapLimit()));

progress.Info(std::string("RouteNodeBlockSize: ")+
std::to_string(parameter.GetRouteNodeBlockSize()));


progress.Info(std::string("MaxAdminLevel: ")+
std::to_string(parameter.GetMaxAdminLevel()));

progress.Info(std::string("Eco: ")+
(parameter.IsEco() ? "true" : "false"));

progress.Info(std::string("TextIndexVariant: ") +
TextIndexVariantStr(parameter.GetTextIndexVariant()));
progress.Info("StrictAreas: {}",parameter.GetStrictAreas());
progress.Info("ProcessingQueueSize: {}",parameter.GetProcessingQueueSize());
progress.Info("NumericIndexPageSize: {}",parameter.GetNumericIndexPageSize());
progress.Info("RawCoordBlockSize: {}",parameter.GetRawCoordBlockSize());

progress.Info("RawNodeDataMemoryMaped: {}",parameter.GetRawNodeDataMemoryMaped());
progress.Info("RawWayIndexMemoryMaped: {}",parameter.GetRawWayIndexMemoryMaped());
progress.Info("RawWayDataMemoryMaped: {}",parameter.GetRawWayDataMemoryMaped());
progress.Info("RawWayIndexCacheSize: {}",parameter.GetRawWayIndexCacheSize());
progress.Info("RawWayBlockSize: {}",parameter.GetRawWayBlockSize());

progress.Info("SortObjects: {}",parameter.GetSortObjects());
progress.Info("SortBlockSize: {}",parameter.GetSortBlockSize());

progress.Info("CoordDataMemoryMaped: {}",parameter.GetCoordDataMemoryMaped());
progress.Info("CoordIndexCacheSize: {}",parameter.GetCoordIndexCacheSize());
progress.Info("CoordBlockSize: {}",parameter.GetCoordBlockSize());

progress.Info("AreaDataMemoryMaped: {}",parameter.GetAreaDataMemoryMaped());
progress.Info("AreaDataCacheSize: {}",parameter.GetAreaDataCacheSize());
progress.Info("AreaWayIndexMinMag: {}",parameter.GetAreaWayIndexMinMag().Get());
progress.Info("AreaWayIndexMaxMag: {}",parameter.GetAreaWayIndexMaxMag().Get());

progress.Info("WayDataMemoryMaped: {}",parameter.GetWayDataMemoryMaped());
progress.Info("WayDataCacheSize: {}",parameter.GetWayDataCacheSize());

progress.Info("AreaNodeGridMag: {}",parameter.GetAreaNodeGridMag().Get());
progress.Info("AreaNodeSimpleListLimit: {}",parameter.GetAreaNodeSimpleListLimit());
progress.Info("AreaNodeTileListLimit: {}",parameter.GetAreaNodeTileListLimit());
progress.Info("AreaNodeTileListCoordLimit: {}",parameter.GetAreaNodeTileListCoordLimit());
progress.Info("AreaNodeBitmapMaxMag: {}",parameter.GetAreaNodeBitmapMaxMag().Get());
progress.Info("AreaNodeBitmapLimit: {}",parameter.GetAreaNodeBitmapLimit());

progress.Info("RouteNodeBlockSize: {}",parameter.GetRouteNodeBlockSize());


progress.Info("MaxAdminLevel: {}",parameter.GetMaxAdminLevel());

progress.Info("Eco: {}",parameter.IsEco());

progress.Info("TextIndexVariant: {}",TextIndexVariantStr(parameter.GetTextIndexVariant()));
}

bool DumpDataSize(const osmscout::ImportParameter& parameter,
Expand All @@ -405,12 +369,12 @@ bool DumpDataSize(const osmscout::ImportParameter& parameter,

fileSize=osmscout::GetFileSize(filePath);

progress.Info(std::string("File ")+filename+": "+osmscout::ByteSizeToString(fileSize));
progress.Info("File '{}': {}",filename,osmscout::ByteSizeToString(fileSize));

dataSize+=fileSize;
}

progress.Info(std::string("=> ")+osmscout::ByteSizeToString(dataSize));
progress.Info("=> {}",osmscout::ByteSizeToString(dataSize));

progress.Info("Optional files:");

Expand All @@ -422,12 +386,12 @@ bool DumpDataSize(const osmscout::ImportParameter& parameter,

fileSize=osmscout::GetFileSize(filePath);

progress.Info(std::string("File ")+filename+": "+osmscout::ByteSizeToString(fileSize));
progress.Info("File '{}': {}",filename,osmscout::ByteSizeToString(fileSize));

dataSize+=fileSize;
}

progress.Info(std::string("=> ")+osmscout::ByteSizeToString(dataSize));
progress.Info("=> {}",osmscout::ByteSizeToString(dataSize));
}
catch (osmscout::IOException& e) {
progress.Error(e.GetDescription());
Expand All @@ -447,7 +411,7 @@ static void DeleteFilesIgnoreError(const osmscout::ImportParameter& parameter,

if (osmscout::ExistsInFilesystem(absoluteFilename))
{
progress.Info(("Deleting '" + absoluteFilename +"'"));
progress.Info("Deleting '" + absoluteFilename +"'");

osmscout::RemoveFile(absoluteFilename);
}
Expand Down
6 changes: 2 additions & 4 deletions OSMScout2/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import net.sf.libosmscout.map 1.0
import "custom"

MapDialog {
id: dialog
id: aboutDialog

label: "About..."

Expand Down Expand Up @@ -40,9 +40,7 @@ MapDialog {

RowLayout {
id: buttonRow
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
Layout.fillWidth: true
spacing: 10

Item {
Expand Down
Empty file.
9 changes: 5 additions & 4 deletions OSMScout2/qml/SearchDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ FocusScope {
y: 2

columns: 2
rows: 1
columnSpacing: 0

LocationSearch {
Expand All @@ -98,7 +99,7 @@ FocusScope {

focus: true

Layout.column: 1
Layout.column: 0
Layout.row: 1
Layout.fillWidth: true
Layout.minimumWidth: Theme.averageCharWidth*5
Expand All @@ -123,7 +124,7 @@ FocusScope {

visible: false

Layout.column: 2
Layout.column: 1
Layout.row: 1

width: searchEdit.height
Expand Down Expand Up @@ -161,7 +162,7 @@ FocusScope {

visible: false

Layout.column: 1
Layout.column: 0
Layout.row: 2
Layout.fillWidth: true
Layout.minimumWidth: Theme.averageCharWidth*5
Expand All @@ -182,7 +183,7 @@ FocusScope {

visible: false

Layout.column: 2
Layout.column: 1
Layout.row: 2

width: searchEdit.height
Expand Down
6 changes: 3 additions & 3 deletions OSMScout2/qml/custom/MapButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Button {

background: Rectangle {
opacity: 0.3
border.color: black
border.color: "black"
border.width: 1
color: parent.checked ? "#ff0000" :
color: parent.checked ? "red" :
(parent.down ? "#555555" :
(parent.hovered ? "#aaaaaa" : "#ffffff"))
(parent.hovered ? "#aaaaaa" : "white"))
}

Layout.fillWidth: true
Expand Down
Loading
Loading