Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Itinerary
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
Itinerary
Commits
cfb1e5cb
Commit
cfb1e5cb
authored
May 21, 2018
by
Volker Krause
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show the full country name
parent
448047d1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
4 deletions
+13
-4
CMakeLists.txt
CMakeLists.txt
+3
-3
src/app/CMakeLists.txt
src/app/CMakeLists.txt
+1
-0
src/app/CountryInfoDelegate.qml
src/app/CountryInfoDelegate.qml
+1
-1
src/app/localizer.cpp
src/app/localizer.cpp
+7
-0
src/app/localizer.h
src/app/localizer.h
+1
-0
No files found.
CMakeLists.txt
View file @
cfb1e5cb
...
...
@@ -21,8 +21,9 @@ ecm_setup_version(PROJECT VARIABLE_PREFIX ITINERARY VERSION_HEADER itinerary_ver
# build-time dependencies
find_package
(
Qt5 REQUIRED COMPONENTS Test Quick
)
find_package
(
KF5 REQUIRED COMPONENTS I18n
)
find_package
(
KPimPkPass REQUIRED
)
find_package
(
KPimItinerary REQUIRED
)
find_package
(
KF5Contacts CONFIG REQUIRED
)
find_package
(
KPimPkPass CONFIG REQUIRED
)
find_package
(
KPimItinerary CONFIG REQUIRED
)
find_package
(
QmlLint
)
set_package_properties
(
QmlLint PROPERTIES URL
"https://qt.io"
PURPOSE
"Validate QML code."
)
find_package
(
SharedMimeInfo 1.0 REQUIRED
)
...
...
@@ -34,7 +35,6 @@ ecm_find_qmlmodule(org.kde.prison 1.0)
if
(
ANDROID
)
find_package
(
Qt5 REQUIRED COMPONENTS AndroidExtras Svg
)
find_package
(
KF5 REQUIRED COMPONENTS Archive Kirigami2 Prison
)
find_package
(
GammaRay
)
if
(
NOT DEFINED BREEZEICONS_DIR AND EXISTS
${
CMAKE_SOURCE_DIR
}
/../breeze-icons
)
set
(
BREEZEICONS_DIR
${
CMAKE_SOURCE_DIR
}
/../breeze-icons
)
endif
()
...
...
src/app/CMakeLists.txt
View file @
cfb1e5cb
...
...
@@ -28,6 +28,7 @@ target_include_directories(itinerary-app PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries
(
itinerary-app PRIVATE
itinerary
Qt5::Quick
KF5::Contacts
)
if
(
ANDROID
)
# explicitly add runtime dependencies and transitive link dependencies,
...
...
src/app/CountryInfoDelegate.qml
View file @
cfb1e5cb
...
...
@@ -43,7 +43,7 @@ Kirigami.AbstractCard {
anchors.margins
:
Kirigami
.
Units
.
largeSpacing
QQC2.Label
{
text
:
qsTr
(
"
⚠ Entering %1
"
).
arg
(
countryInfo
.
isoCode
)
// TODO human readable country name
text
:
qsTr
(
"
⚠ Entering %1
"
).
arg
(
Localizer
.
countryName
(
countryInfo
.
isoCode
))
color
:
Kirigami
.
Theme
.
negativeTextColor
}
}
...
...
src/app/localizer.cpp
View file @
cfb1e5cb
...
...
@@ -19,6 +19,8 @@
#include <KItinerary/JsonLdDocument>
#include <KContacts/Address>
#include <QDateTime>
#include <QLocale>
#include <QTimeZone>
...
...
@@ -32,6 +34,11 @@ Localizer::Localizer(QObject *parent)
Localizer
::~
Localizer
()
=
default
;
QString
Localizer
::
countryName
(
const
QString
&
isoCode
)
const
{
return
KContacts
::
Address
::
ISOtoCountry
(
isoCode
);
}
static
bool
needsTimeZone
(
const
QDateTime
&
dt
)
{
if
(
dt
.
timeSpec
()
==
Qt
::
TimeZone
&&
dt
.
timeZone
().
abbreviation
(
dt
)
!=
QTimeZone
::
systemTimeZone
().
abbreviation
(
dt
))
{
...
...
src/app/localizer.h
View file @
cfb1e5cb
...
...
@@ -33,6 +33,7 @@ public:
explicit
Localizer
(
QObject
*
parent
=
nullptr
);
~
Localizer
();
Q_INVOKABLE
QString
countryName
(
const
QString
&
isoCode
)
const
;
Q_INVOKABLE
QString
formatTime
(
const
QVariant
&
obj
,
const
QString
&
propertyName
)
const
;
Q_INVOKABLE
QString
formatDateTime
(
const
QVariant
&
obj
,
const
QString
&
propertyName
)
const
;
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment