After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724074 - documents-panel: handle unsaved documents
documents-panel: handle unsaved documents
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-10 22:28 UTC by sébastien lafargue
Modified: 2014-03-16 10:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
documents-panel: handle unsaved documents (14.93 KB, patch)
2014-02-10 22:30 UTC, sébastien lafargue
needs-work Details | Review
documents-panel: handle unsaved documents (13.56 KB, patch)
2014-02-11 20:05 UTC, sébastien lafargue
none Details | Review
patch (11.80 KB, patch)
2014-02-13 22:17 UTC, Paolo Borelli
committed Details | Review

Description sébastien lafargue 2014-02-10 22:28:37 UTC
Handle of unsaved documents when clicking on close buttons
( DocumentRow corresponding to tab and GroupRow corresponding to notebook )
in documents-panel
Comment 1 sébastien lafargue 2014-02-10 22:30:24 UTC
Created attachment 268740 [details] [review]
documents-panel: handle unsaved documents
Comment 2 Paolo Borelli 2014-02-11 18:44:16 UTC
Review of attachment 268740 [details] [review]:

::: gedit/gedit-notebook.h
@@ -118,2 +118,5 @@
 						(GeditNotebook *nb);
 
+GList *		gedit_notebook_get_unsaved_documents (GeditNotebook *notebook);
+
+GList *		gedit_notebook_get_documents (GeditNotebook *notebook);

In the current abstraction GeditNotebook is just a widget and is not aware of documents and the fact that they are modified or unsaved etc.

So I'd prefer to move this logic to the caller side
Comment 3 sébastien lafargue 2014-02-11 20:05:13 UTC
Created attachment 268841 [details] [review]
documents-panel: handle unsaved documents
Comment 4 Paolo Borelli 2014-02-13 22:17:34 UTC
Created attachment 269078 [details] [review]
patch

My version of the patch: the most significative change is that I keep the logic of the loop that walks a tabs list and just pass in the notebook to decide if the tabs list is the one of the notebook or of the whole window.

This removes the need for all the list handling etc
Comment 5 sébastien lafargue 2014-03-16 10:49:28 UTC
Review of attachment 269078 [details] [review]:

pushed as 3217dba