Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mobile Datovka
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Datovka projects
mobile Datovka
Commits
25fc8328
Commit
25fc8328
authored
Jan 22, 2019
by
Martin Straka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete tmp files after export
parent
9b0be45f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
43 deletions
+53
-43
qml/dialogues/FileDialogue.qml
qml/dialogues/FileDialogue.qml
+1
-7
qml/pages/PageSendMessage.qml
qml/pages/PageSendMessage.qml
+9
-23
src/auxiliaries/ios_helper.cpp
src/auxiliaries/ios_helper.cpp
+3
-6
src/auxiliaries/ios_helper.h
src/auxiliaries/ios_helper.h
+2
-2
src/files.cpp
src/files.cpp
+21
-3
src/io/filesystem.cpp
src/io/filesystem.cpp
+6
-0
src/io/filesystem.h
src/io/filesystem.h
+9
-0
src/main.cpp
src/main.cpp
+2
-2
No files found.
qml/dialogues/FileDialogue.qml
View file @
25fc8328
...
...
@@ -62,7 +62,6 @@ Dialog {
property
int
selectedFileIndex
:
-
1
property
bool
showDirs
:
true
property
bool
showFiles
:
true
property
bool
iOS
:
false
signal
finished
(
variant
pathListModel
)
...
...
@@ -70,8 +69,7 @@ Dialog {
return
(
root
.
showDirs
&&
!
root
.
showFiles
);
}
function
raise
(
title
,
filters
,
showFiles
,
targetLocation
,
isiOS
)
{
iOS
=
isiOS
function
raise
(
title
,
filters
,
showFiles
,
targetLocation
)
{
if
(
targetLocation
!==
""
)
{
folderNavigation
.
visible
=
false
folderModel
.
folder
=
"
file://
"
+
targetLocation
...
...
@@ -82,9 +80,6 @@ Dialog {
if
(
filters
!==
""
)
{
folderModel
.
nameFilters
=
filters
}
if
(
iOS
)
{
folderModel
.
folder
=
standardLocationUrl
(
InteractionFilesystem
.
DOCUMENTS_LOCATION
)
}
selectedFileIndex
=
-
1
// clear add path list model
pathListModel
.
clear
()
...
...
@@ -133,7 +128,6 @@ Dialog {
ColumnLayout
{
id
:
folderNavigation
AccessibleComboBox
{
visible
:
!
iOS
anchors
{
left
:
parent
.
left
;
right
:
parent
.
right
;
...
...
qml/pages/PageSendMessage.qml
View file @
25fc8328
...
...
@@ -218,7 +218,7 @@ Item {
Component.onDestruction
:
{
if
(
iOS
)
{
iOSHelper
.
clearSend
Dir
()
iOSHelper
.
clearSend
AndTmpDirs
()
}
statusBar
.
visible
=
false
}
...
...
@@ -510,29 +510,15 @@ Item {
}
}
}
Row
{
id
:
buttonBar
spacing
:
formItemVerticalSpacing
*
2
AccessibleButton
{
id
:
addFile
height
:
inputItemHeight
anchors.horizontalCenter
:
parent
.
horizontalCenter
AccessibleButton
{
id
:
addFile
height
:
inputItemHeight
font.pointSize
:
defaultTextFont
.
font
.
pointSize
text
:
qsTr
(
"
Add file
"
)
onClicked
:
{
fileDialogue
.
raise
(
qsTr
(
"
Select files
"
),
[
"
*.*
"
],
true
,
""
,
iOS
)
}
font.pointSize
:
defaultTextFont
.
font
.
pointSize
text
:
qsTr
(
"
Add file
"
)
onClicked
:
{
iOS
?
iOSHelper
.
openDocumentPickerController
()
:
fileDialogue
.
raise
(
qsTr
(
"
Select files
"
),
[
"
*.*
"
],
true
,
""
)
}
AccessibleButton
{
id
:
storage
visible
:
iOS
height
:
inputItemHeight
font.pointSize
:
defaultTextFont
.
font
.
pointSize
text
:
qsTr
(
"
Storage
"
)
onClicked
:
{
iOSHelper
.
openDocumentPickerController
()
}
}
}
Component
{
id
:
attachmentDelegate
...
...
@@ -674,7 +660,7 @@ Item {
color
:
datovkaPalette
.
text
anchors.left
:
parent
.
left
anchors.leftMargin
:
defaultMargin
anchors.top
:
buttonBar
.
bottom
anchors.top
:
addFile
.
bottom
anchors.topMargin
:
defaultMargin
anchors.right
:
parent
.
right
anchors.rightMargin
:
defaultMargin
...
...
src/auxiliaries/ios_helper.cpp
View file @
25fc8328
...
...
@@ -138,17 +138,14 @@ QString IosHelper::getShortSendFilePath(const QString &sandBoxFilePath)
#endif
}
void
IosHelper
::
clearSend
Dir
(
void
)
void
IosHelper
::
clearSend
AndTmpDirs
(
void
)
{
debugFuncCall
();
QDir
dir
(
appSendDirPath
());
dir
.
removeRecursively
();
/*
// TODO - used for experiments and testing only
QDir dir2(dfltAttachSavingLoc());
dir2.removeRecursively();
*/
dir
.
setPath
(
appTmpDirPath
());
dir
.
removeRecursively
();
}
void
IosHelper
::
openDocumentPickerController
(
void
)
...
...
src/auxiliaries/ios_helper.h
View file @
25fc8328
...
...
@@ -60,10 +60,10 @@ public:
void
storeFilesToDeviceStorage
(
const
QStringList
&
srcFilePaths
);
/*!
* @brief Clear send folder.
* @brief Clear send
and tmp
folder.
*/
Q_INVOKABLE
void
clearSend
Dir
(
void
);
void
clearSend
AndTmpDirs
(
void
);
/*!
* @brief Create and open document picker controller.
...
...
src/files.cpp
View file @
25fc8328
...
...
@@ -726,12 +726,21 @@ void Files::saveMsgFilesToDisk(const QString &userName,
documents
.
append
(
document
);
}
QString
filePath
(
appMsgAttachDirPath
(
msgIdStr
));
QString
targetPath
;
#ifdef Q_OS_IOS
targetPath
=
appMsgAttachDirPathiOS
(
msgIdStr
);
#else
targetPath
=
appMsgAttachDirPath
(
msgIdStr
);
#endif
QString
destFilePath
;
QStringList
destFilePaths
;
foreach
(
const
Isds
::
Document
&
document
,
documents
)
{
destFilePath
=
writeFile
(
file
Path
,
document
.
fileDescr
(),
destFilePath
=
writeFile
(
target
Path
,
document
.
fileDescr
(),
document
.
binaryContent
());
if
(
!
destFilePath
.
isEmpty
())
{
destFilePaths
.
append
(
destFilePath
);
...
...
@@ -762,7 +771,16 @@ void Files::saveAttachmentsToDiskZfo(const QVariant &attachModelVariant,
return
;
}
QString
targetPath
(
appMsgAttachDirPath
(
msgIdStr
));
QString
targetPath
;
#ifdef Q_OS_IOS
targetPath
=
appMsgAttachDirPathiOS
(
msgIdStr
);
#else
targetPath
=
appMsgAttachDirPath
(
msgIdStr
);
#endif
QString
destFilePath
;
QStringList
destFilePaths
;
...
...
src/io/filesystem.cpp
View file @
25fc8328
...
...
@@ -72,6 +72,12 @@ QString appMsgAttachDirPath(const QString &msgIdStr)
return
existingAppPath
(
dfltAttachSavingLoc
(),
msgIdStr
);
}
QString
appMsgAttachDirPathiOS
(
const
QString
&
msgIdStr
)
{
return
existingAppPath
(
dfltAttachSavingLoc
(),
QStringLiteral
(
DATOVKA_TEMP_DIR_NAME
)
+
QDir
::
separator
()
+
msgIdStr
);
}
QString
appTmpDirPath
(
void
)
{
return
existingAppPath
(
dfltAttachSavingLoc
(),
DATOVKA_TEMP_DIR_NAME
);
...
...
src/io/filesystem.h
View file @
25fc8328
...
...
@@ -88,6 +88,15 @@ QString appLogDirPath(void);
*/
QString
appMsgAttachDirPath
(
const
QString
&
msgIdStr
);
/*!
* @brief Return path to location where attachments of a particular message
* can be stored for iOS.
*
* @param[in] msgIdStr String containing message identifier.
* @return Full path containing the supplied identifier.
*/
QString
appMsgAttachDirPathiOS
(
const
QString
&
msgIdStr
);
/*!
* @brief Return path to location where temporary files can be stored.
*
...
...
src/main.cpp
View file @
25fc8328
...
...
@@ -470,8 +470,8 @@ int main(int argc, char *argv[])
GlobInstcs
::
iOSHelperPtr
=
&
iOSHelper
;
/* Clear send
dir
. */
iOSHelper
.
clearSend
Dir
();
/* Clear send
and tmp dir (iOS only)
. */
iOSHelper
.
clearSend
AndTmpDirs
();
#endif
/*
...
...
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