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
A
Akonadi Contacts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
Akonadi Contacts
Commits
ca8ef1ce
Commit
ca8ef1ce
authored
Dec 16, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Bug 430119 - Confirm add address on OK
FIXED-IN: 5.15.1 BUG: 430119
parent
5752645a
Pipeline
#44274
passed with stage
in 10 minutes and 53 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
35 additions
and
7 deletions
+35
-7
src/akonadi-contacts/contacteditor.cpp
src/akonadi-contacts/contacteditor.cpp
+5
-0
src/akonadi-contacts/contacteditor.h
src/akonadi-contacts/contacteditor.h
+1
-0
src/akonadi-contacts/contacteditordialog.cpp
src/akonadi-contacts/contacteditordialog.cpp
+13
-5
src/contact-editor/abstractcontacteditorwidget_p.h
src/contact-editor/abstractcontacteditorwidget_p.h
+2
-0
src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
...t-editor/editor/addresseditor/addresseslocationwidget.cpp
+5
-0
src/contact-editor/editor/addresseditor/addresseslocationwidget.h
...act-editor/editor/addresseditor/addresseslocationwidget.h
+2
-1
src/contact-editor/editor/addresseditor/addresslocationwidget.h
...ntact-editor/editor/addresseditor/addresslocationwidget.h
+1
-1
src/contact-editor/editor/contacteditorwidget.cpp
src/contact-editor/editor/contacteditorwidget.cpp
+5
-0
src/contact-editor/editor/contacteditorwidget.h
src/contact-editor/editor/contacteditorwidget.h
+1
-0
No files found.
src/akonadi-contacts/contacteditor.cpp
View file @
ca8ef1ce
...
...
@@ -309,4 +309,9 @@ void Akonadi::AkonadiContactEditor::setDefaultAddressBook(const Akonadi::Collect
d
->
mDefaultCollection
=
collection
;
}
bool
Akonadi
::
AkonadiContactEditor
::
hasNoSavedData
()
const
{
return
d
->
mEditorWidget
->
hasNoSavedData
();
}
#include "moc_contacteditor.cpp"
src/akonadi-contacts/contacteditor.h
View file @
ca8ef1ce
...
...
@@ -133,6 +133,7 @@ public:
* @return
*/
Q_REQUIRED_RESULT
KContacts
::
Addressee
contact
();
Q_REQUIRED_RESULT
bool
hasNoSavedData
()
const
;
public
Q_SLOTS
:
/**
* Loads the @p contact into the editor.
...
...
src/akonadi-contacts/contacteditordialog.cpp
View file @
ca8ef1ce
...
...
@@ -89,10 +89,7 @@ public:
void
slotOkClicked
()
{
if
(
mAddressBookBox
)
{
mEditor
->
setDefaultAddressBook
(
mAddressBookBox
->
currentCollection
());
}
mEditor
->
saveContactInAddressBook
();
q
->
accept
();
}
void
slotFinish
()
...
...
@@ -174,7 +171,18 @@ AkonadiContactEditor *ContactEditorDialog::editor() const
void
ContactEditorDialog
::
accept
()
{
//Nothing
if
(
d
->
mEditor
->
hasNoSavedData
())
{
if
(
KMessageBox
::
questionYesNo
(
this
,
i18nc
(
"@info"
,
"Location was not saved. Do you want to close editor?"
),
i18nc
(
"@title:window"
,
"Confirmation"
))
==
KMessageBox
::
No
)
{
return
;
}
}
if
(
d
->
mAddressBookBox
)
{
d
->
mEditor
->
setDefaultAddressBook
(
d
->
mAddressBookBox
->
currentCollection
());
}
d
->
mEditor
->
saveContactInAddressBook
();
}
void
ContactEditorDialog
::
reject
()
...
...
src/contact-editor/abstractcontacteditorwidget_p.h
View file @
ca8ef1ce
...
...
@@ -52,6 +52,8 @@ public:
* @param readOnly set read-only mode
*/
virtual
void
setReadOnly
(
bool
readOnly
)
=
0
;
virtual
Q_REQUIRED_RESULT
bool
hasNoSavedData
()
const
{
return
false
;
}
};
}
...
...
src/contact-editor/editor/addresseditor/addresseslocationwidget.cpp
View file @
ca8ef1ce
...
...
@@ -106,3 +106,8 @@ void AddressesLocationWidget::setReadOnly(bool readOnly)
mReadOnly
=
readOnly
;
mAddressLocationWidget
->
setReadOnly
(
readOnly
);
}
bool
AddressesLocationWidget
::
hasNoSavedData
()
const
{
return
mAddressLocationWidget
->
wasChanged
();
}
src/contact-editor/editor/addresseditor/addresseslocationwidget.h
View file @
ca8ef1ce
...
...
@@ -23,12 +23,13 @@ class AddressesLocationWidget : public QSplitter
Q_OBJECT
public:
explicit
AddressesLocationWidget
(
QWidget
*
parent
=
nullptr
);
~
AddressesLocationWidget
();
~
AddressesLocationWidget
()
override
;
void
loadContact
(
const
KContacts
::
Addressee
&
contact
);
void
storeContact
(
KContacts
::
Addressee
&
contact
)
const
;
void
setReadOnly
(
bool
readOnly
);
Q_REQUIRED_RESULT
bool
hasNoSavedData
()
const
;
private:
AddressLocationWidget
*
mAddressLocationWidget
=
nullptr
;
QTreeView
*
mAddressesLocationView
=
nullptr
;
...
...
src/contact-editor/editor/addresseditor/addresslocationwidget.h
View file @
ca8ef1ce
...
...
@@ -33,7 +33,7 @@ public:
};
explicit
AddressLocationWidget
(
QWidget
*
parent
=
nullptr
);
~
AddressLocationWidget
();
~
AddressLocationWidget
()
override
;
void
setAddress
(
const
KContacts
::
Address
&
address
);
Q_REQUIRED_RESULT
KContacts
::
Address
address
()
const
;
...
...
src/contact-editor/editor/contacteditorwidget.cpp
View file @
ca8ef1ce
...
...
@@ -270,3 +270,8 @@ void ContactEditorWidget::setReadOnly(bool readOnly)
}
}
}
bool
ContactEditorWidget
::
hasNoSavedData
()
const
{
return
d
->
mAddressesLocationWidget
->
hasNoSavedData
();
}
src/contact-editor/editor/contacteditorwidget.h
View file @
ca8ef1ce
...
...
@@ -61,6 +61,7 @@ public:
*/
void
setReadOnly
(
bool
readOnly
)
override
;
Q_REQUIRED_RESULT
bool
hasNoSavedData
()
const
override
;
private:
class
Private
;
Private
*
const
d
;
...
...
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