Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Datovka projects
mobile Datovka
Commits
32a5ac24
Commit
32a5ac24
authored
Oct 30, 2017
by
Martin Straka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added message type text into message detail
parent
0c3ff0e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
src/sqlite/message_db.cpp
src/sqlite/message_db.cpp
+38
-1
No files found.
src/sqlite/message_db.cpp
View file @
32a5ac24
...
...
@@ -49,6 +49,39 @@ const QVector<QString> MessageDb::msgStatus = {"dmDeliveryTime",
const
QVector
<
QString
>
MessageDb
::
fileItemIds
=
{
"id"
,
"message_id"
,
"dmEncodedContent"
,
"_dmFileDescr"
,
"LENGTH(dmEncodedContent)"
};
const
QString
dmTypeToText
(
const
QString
&
val
)
{
if
(
val
.
size
()
!=
1
)
{
qCritical
()
<<
"Unknown message type value"
<<
val
.
toUtf8
().
constData
();
return
QString
();
}
switch
(
val
[
0
].
toLatin1
())
{
case
'V'
:
return
QObject
::
tr
(
"Public data message"
);
break
;
case
'K'
:
return
QObject
::
tr
(
"Postal data message"
);
break
;
case
'I'
:
return
QObject
::
tr
(
"Initialising postal data message"
);
break
;
case
'O'
:
return
QObject
::
tr
(
"Reply postal data message"
);
break
;
case
'X'
:
return
QObject
::
tr
(
"Initialising postal data message - expired"
);
break
;
case
'Y'
:
return
QObject
::
tr
(
"Initialising postal data message - used"
);
break
;
default:
qCritical
()
<<
"Unknown message type value"
<<
val
[
0
].
toLatin1
();
return
QObject
::
tr
(
"Unknown message typ"
);
break
;
}
}
const
QString
msgStatusToText
(
int
status
)
{
switch
(
status
)
{
...
...
@@ -452,7 +485,7 @@ QString MessageDb::getMessageDetailDataFromDb(qint64 dmId) const
"dmAnnotation, dmAttachmentSize, "
"dbIDSender, dmSender, dmSenderAddress, _dmCustomData, "
"dbIDRecipient, dmRecipient, dmRecipientAddress, "
"dmPersonalDelivery, dmAllowSubstDelivery "
"dmPersonalDelivery, dmAllowSubstDelivery
, dmType
"
"FROM messages WHERE dmID = :dmID"
;
if
(
!
query
.
prepare
(
queryStr
))
{
goto
fail
;
...
...
@@ -469,6 +502,10 @@ QString MessageDb::getMessageDetailDataFromDb(qint64 dmId) const
(
query
.
value
(
10
).
toBool
())
?
QObject
::
tr
(
"Yes"
)
:
QObject
::
tr
(
"No"
));
html
+=
strongInfoLine
(
QObject
::
tr
(
"Delivery by fiction"
),
(
query
.
value
(
11
).
toBool
())
?
QObject
::
tr
(
"Yes"
)
:
QObject
::
tr
(
"No"
));
if
(
!
query
.
value
(
12
).
toString
().
isEmpty
())
{
html
+=
strongInfoLine
(
QObject
::
tr
(
"Message type"
),
dmTypeToText
(
query
.
value
(
12
).
toString
()));
}
if
(
query
.
value
(
0
).
toInt
()
==
TYPE_RECEIVED
)
{
/* Information about message sender. */
...
...
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