Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
mobile Datovka
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Datovka projects
mobile Datovka
Commits
8b8868ff
Commit
8b8868ff
authored
May 12, 2017
by
Karel Slaný
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
There is no hidden access to globAccountsModelPtr in C++ code.
parent
ca686d89
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
29 additions
and
19 deletions
+29
-19
qml/pages/PageAccountList.qml
qml/pages/PageAccountList.qml
+2
-2
qml/pages/PageMenuAccount.qml
qml/pages/PageMenuAccount.qml
+2
-2
qml/pages/PageMessageList.qml
qml/pages/PageMessageList.qml
+1
-1
qml/pages/PageSettingsAccount.qml
qml/pages/PageSettingsAccount.qml
+3
-3
qml/pages/PageSettingsGeneral.qml
qml/pages/PageSettingsGeneral.qml
+1
-1
qml/pages/PageSettingsPin.qml
qml/pages/PageSettingsPin.qml
+3
-3
qml/pages/PageSettingsStorage.qml
qml/pages/PageSettingsStorage.qml
+1
-1
qml/pages/PageSettingsSync.qml
qml/pages/PageSettingsSync.qml
+1
-1
src/main.cpp
src/main.cpp
+1
-1
src/settings.cpp
src/settings.cpp
+0
-1
src/setwrapper.cpp
src/setwrapper.cpp
+9
-2
src/setwrapper.h
src/setwrapper.h
+5
-1
No files found.
qml/pages/PageAccountList.qml
View file @
8b8868ff
...
...
@@ -95,7 +95,7 @@ Component {
statusBarText
.
text
=
""
if
(
isds
.
syncAllAccounts
(
accountListModel
))
{
settings
.
setLastUpdateToNow
()
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
}
}
...
...
@@ -245,7 +245,7 @@ Component {
onClicked
:
{
if
(
isds
.
syncOneAccount
(
accountListModel
,
rUserName
))
{
settings
.
setLastUpdateToNow
()
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
}
}
...
...
qml/pages/PageMenuAccount.qml
View file @
8b8868ff
...
...
@@ -164,11 +164,11 @@ Component {
files
.
deleteFileDb
(
userName
)
}
else
if
(
index
==
3
)
{
if
(
isds
.
changePassword
(
userName
,
acntName
))
{
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
}
else
if
(
index
==
4
)
{
if
(
accounts
.
removeAccount
(
accountListModel
,
userName
,
true
))
{
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
}
else
{
...
...
qml/pages/PageMessageList.qml
View file @
8b8868ff
...
...
@@ -205,7 +205,7 @@ Component {
if
(
msgType
==
MessageType
.
TYPE_RECEIVED
)
{
if
(
isds
.
syncSingleAccountReceived
(
accountListModel
,
messageModel
,
userName
))
{
settings
.
setLastUpdateToNow
()
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
}
else
if
(
msgType
==
MessageType
.
TYPE_SENT
)
{
isds
.
syncSingleAccountSent
(
accountListModel
,
messageModel
,
userName
)
...
...
qml/pages/PageSettingsAccount.qml
View file @
8b8868ff
...
...
@@ -319,11 +319,11 @@ Component {
testAccount
.
checked
,
rememberPassword
.
checked
,
useLS
.
checked
,
certPathLabelId
.
text
.
toString
()))
{
if
(
isds
.
getAccountInfo
(
userNameTextField
.
text
.
toString
(),
true
))
{
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
else
{
if
(
accounts
.
removeAccount
(
accountListModel
,
userNameTextField
.
text
.
toString
(),
false
))
{
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
}
}
...
...
@@ -334,7 +334,7 @@ Component {
passwordTextField
.
text
.
toString
(),
testAccount
.
checked
,
rememberPassword
.
checked
,
useLS
.
checked
,
certPathLabelId
.
text
.
toString
()))
{
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
}
pageView
.
pop
(
StackView
.
Immediate
)
}
...
...
qml/pages/PageSettingsGeneral.qml
View file @
8b8868ff
...
...
@@ -171,7 +171,7 @@ Component {
onSaveSettingsGeneralResponse
:
{
settings
.
updateSettingsGeneral
(
sLang
,
fontSizeSpinBox
.
val
().
toString
())
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
}
...
...
qml/pages/PageSettingsPin.qml
View file @
8b8868ff
...
...
@@ -176,7 +176,7 @@ Component {
}
else
{
errLineText
.
visible
=
false
settings
.
updatePinSettings
(
pinConfirmField1
.
text
.
toString
())
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
/* change current pin code */
...
...
@@ -198,7 +198,7 @@ Component {
}
else
{
errLineText
.
visible
=
false
settings
.
updatePinSettings
(
pinConfirmField1
.
text
.
toString
())
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
}
else
{
...
...
@@ -212,7 +212,7 @@ Component {
if
(
pinValueField
.
text
==
currentPIN
)
{
errLineText
.
visible
=
false
settings
.
updatePinSettings
(
""
)
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
settings
.
setInactivityInterval
(
0
)
locker
.
setInactivityInterval
(
0
)
pageView
.
pop
(
StackView
.
Immediate
)
...
...
qml/pages/PageSettingsStorage.qml
View file @
8b8868ff
...
...
@@ -231,7 +231,7 @@ Component {
messageLifeSpinBox
.
val
().
toString
(),
attachLifeSpinBox
.
val
().
toString
(),
dbPathText
.
text
.
toString
())
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
}
...
...
qml/pages/PageSettingsSync.qml
View file @
8b8868ff
...
...
@@ -127,7 +127,7 @@ Component {
settings
.
updateSettingsSync
(
idownloadOnlyNewMsgs
.
checked
,
idownloadCompleteMsgs
.
checked
)
settings
.
saveAllSettings
()
settings
.
saveAllSettings
(
accountListModel
)
pageView
.
pop
(
StackView
.
Immediate
)
}
}
...
...
src/main.cpp
View file @
8b8868ff
...
...
@@ -418,7 +418,7 @@ int main(int argc, char *argv[])
* The PIN was set/recovered or
* incomplete data to check/recover the PIN were supplied.
*/
GlobalSettingsQmlWrapper
::
saveAllSettings
();
GlobalSettingsQmlWrapper
::
saveAllSettings
(
globAccountsModelPtr
);
}
delete
globAccountsModelPtr
;
...
...
src/settings.cpp
View file @
8b8868ff
...
...
@@ -28,7 +28,6 @@
#include "src/common.h"
#include "src/io/filesystem.h"
#include "src/models/accountmodel.h"
/* globAccountsModelPtr */
#include "src/settings.h"
Settings
globSet
;
...
...
src/setwrapper.cpp
View file @
8b8868ff
...
...
@@ -291,11 +291,18 @@ void GlobalSettingsQmlWrapper::setLastUpdateToNow(void)
globSet
.
setLastUpdate
(
Settings
::
nowStr
());
}
void
GlobalSettingsQmlWrapper
::
saveAllSettings
(
void
)
void
GlobalSettingsQmlWrapper
::
saveAllSettings
(
const
AccountListModel
*
accountModel
)
{
if
(
accountModel
==
Q_NULLPTR
)
{
Q_ASSERT
(
0
);
qCritical
(
"%s"
,
"Missing account model to read settings from."
);
return
;
}
QSettings
settings
(
Settings
::
settingsPath
(),
QSettings
::
IniFormat
);
settings
.
clear
();
globSet
.
saveToSettings
(
settings
);
globAccountsModelPtr
->
saveAccountsToSettings
(
globSet
.
_pinVal
,
settings
);
accountModel
->
saveAccountsToSettings
(
globSet
.
_pinVal
,
settings
);
settings
.
sync
();
}
src/setwrapper.h
View file @
8b8868ff
...
...
@@ -27,6 +27,8 @@
#include <QObject>
#include <QString>
class
AccountListModel
;
/* Forward declaration. */
/*
* This class provide wrapper between
* global settings class and QML settings page.
...
...
@@ -162,9 +164,11 @@ public:
/*!
* @brief Gathers all settings and stores them into configuration file.
*
* @param[in] accountModel Account model to take data from.
*/
Q_INVOKABLE
static
void
saveAllSettings
(
void
);
void
saveAllSettings
(
const
AccountListModel
*
accountModel
);
signals:
/*!
...
...
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