Improve desktop place page dialog #7505

Merged
Ferenc- merged 12 commits from improve-desktop-place-page-dialog into master 2024-03-23 21:56:49 +00:00
Ferenc- commented 2024-03-02 16:03:15 +00:00 (Migrated from github.com)
No description provided.
biodranik (Migrated from github.com) reviewed 2024-03-22 23:41:39 +00:00
biodranik (Migrated from github.com) left a comment

Awesome, thank you! Maybe Wikipedia window size can be increased for some small size Place Pages.

Awesome, thank you! Maybe Wikipedia window size can be increased for some small size Place Pages.
biodranik (Migrated from github.com) commented 2024-03-05 14:10:18 +00:00
    settings::Set(settings::kDeveloperMode, developerMode);
```suggestion settings::Set(settings::kDeveloperMode, developerMode); ```
biodranik (Migrated from github.com) commented 2024-03-05 14:17:28 +00:00
#ifdef DEBUG
  static bool constexpr kDeveloperMode = true;
#else
  static bool constexpr kDeveloperMode = false;
#endif
```suggestion #ifdef DEBUG static bool constexpr kDeveloperMode = true; #else static bool constexpr kDeveloperMode = false; #endif ```
biodranik (Migrated from github.com) commented 2024-03-05 14:18:21 +00:00

Why include names introduced in a different code style than above?

Why include names introduced in a different code style than above?
biodranik (Migrated from github.com) commented 2024-03-05 14:20:10 +00:00
  1. No global constants please. They can clash with Unity builds and pollute the namespace.
  2. static int constexpr kMaxLengthOfPlacePageDescription = 500;
1. No global constants please. They can clash with Unity builds and pollute the namespace. 2. `static int constexpr kMaxLengthOfPlacePageDescription = 500;`
biodranik (Migrated from github.com) commented 2024-03-22 23:17:01 +00:00

No global vars please. Put them into an anonymous namespace.

int constexpr kMaxLengthOfPlacePageDescription = 500;
int constexpr kMinWidthOfShortDescription = 390;
No global vars please. Put them into an anonymous namespace. ```suggestion int constexpr kMaxLengthOfPlacePageDescription = 500; int constexpr kMinWidthOfShortDescription = 390; ```
biodranik (Migrated from github.com) commented 2024-03-22 23:25:38 +00:00

Note formatting and the absence of memory allocations.

namespace
{
std::string_view stripSchemeFromURI(std::string_view uri) {
  for (std::string_view prefix : {"https://", "http://"})
  {
    if (strings::StartsWith(uri, prefix))
      return uri.substr(prefix.size());
  }
  return uri;
}
}  // namespace
Note formatting and the absence of memory allocations. ```suggestion namespace { std::string_view stripSchemeFromURI(std::string_view uri) { for (std::string_view prefix : {"https://", "http://"}) { if (strings::StartsWith(uri, prefix)) return uri.substr(prefix.size()); } return uri; } } // namespace ```
biodranik (Migrated from github.com) commented 2024-03-22 23:27:08 +00:00

Where is it used? Can it be rewritten with string_view?

Where is it used? Can it be rewritten with string_view?
biodranik (Migrated from github.com) commented 2024-03-22 23:27:23 +00:00

indent?

indent?
biodranik (Migrated from github.com) commented 2024-03-22 23:29:18 +00:00

As we're using BSD style for bracers, there's no need to introduce K&R one everywhere.

    if (auto facebook = info.GetMetadata(feature::Metadata::EType::FMD_CONTACT_FACEBOOK); !facebook.empty())
    {
As we're using BSD style for bracers, there's no need to introduce K&R one everywhere. ```suggestion if (auto facebook = info.GetMetadata(feature::Metadata::EType::FMD_CONTACT_FACEBOOK); !facebook.empty()) { ```
biodranik (Migrated from github.com) commented 2024-03-22 23:31:37 +00:00

Is it possible to avoid duplication for social networks by creating a lambda that takes a pair of parameters: "VK" and FMD_CONTACT_VK ? Can addEntry lambda be reused?

Is it possible to avoid duplication for social networks by creating a lambda that takes a pair of parameters: "VK" and FMD_CONTACT_VK ? Can `addEntry` lambda be reused?
biodranik (Migrated from github.com) commented 2024-03-22 23:35:36 +00:00

One liners without bracers here and in other places.

    if (auto level = info.GetMetadata(feature::Metadata::EType::FMD_LEVEL); !level.empty())
      addEntry("Level", std::string(level));
One liners without bracers here and in other places. ```suggestion if (auto level = info.GetMetadata(feature::Metadata::EType::FMD_LEVEL); !level.empty()) addEntry("Level", std::string(level)); ```
biodranik (Migrated from github.com) commented 2024-03-22 23:36:29 +00:00

Btw, did you try to use git-clang-format? Make a commit before doing it.

Btw, did you try to use git-clang-format? Make a commit before doing it.
biodranik (Migrated from github.com) commented 2024-03-22 23:37:16 +00:00
```suggestion ```
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:02:04 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:02:04 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:02:19 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:02:19 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:03:08 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:03:08 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:05:26 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:05:26 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:06:52 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:06:52 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 09:09:24 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 09:09:24 +00:00

removed

removed
Ferenc- (Migrated from github.com) reviewed 2024-03-23 12:03:30 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 12:03:30 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 12:04:55 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 12:04:55 +00:00

Removed.

Removed.
Ferenc- (Migrated from github.com) reviewed 2024-03-23 12:07:23 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 12:07:23 +00:00

done

done
Ferenc- (Migrated from github.com) reviewed 2024-03-23 12:12:00 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 12:12:00 +00:00

Braces are done. I will check the tool

Braces are done. I will check the tool
Ferenc- (Migrated from github.com) reviewed 2024-03-23 12:35:06 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 12:35:05 +00:00

I have created a new lambda for this.

I have created a new lambda for this.
Ferenc- (Migrated from github.com) reviewed 2024-03-23 14:38:18 +00:00
Ferenc- (Migrated from github.com) commented 2024-03-23 14:38:18 +00:00

Fixed

Fixed
biodranik (Migrated from github.com) approved these changes 2024-03-23 21:54:20 +00:00
biodranik (Migrated from github.com) left a comment

Thank you, @Ferenc- , for your patience and for getting things done. I appreciate it a lot. The code is way cleaner now and easier to read.

Thanks to @dmfrodrigues too for starting this important work.

Thank you, @Ferenc- , for your patience and for getting things done. I appreciate it a lot. The code is way cleaner now and easier to read. Thanks to @dmfrodrigues too for starting this important work.
This repo is archived. You cannot comment on pull requests.
No reviewers
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#7505
No description provided.