Merge lp:~victored/granite/remove-outstanding-deprecations into lp:~elementary-pantheon/granite/granite

Proposed by Victor Martinez on 2013-08-16
Status: Work in progress
Proposed branch: lp:~victored/granite/remove-outstanding-deprecations
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 619 lines (+2/-494)
11 files modified
CMakeLists.txt (+1/-1)
lib/Application.vala (+0/-10)
lib/CMakeLists.txt (+1/-5)
lib/Services/Contractor.vala (+0/-67)
lib/Widgets/AppMenu.vala (+0/-9)
lib/Widgets/CellRendererBadge.vala (+0/-1)
lib/Widgets/CellRendererExpander.vala (+0/-1)
lib/Widgets/CollapsiblePaned.vala (+0/-16)
lib/Widgets/ContractorMenu.vala (+0/-142)
lib/Widgets/ContractorView.vala (+0/-217)
lib/Widgets/SidebarPaned.vala (+0/-25)
To merge this branch: bzr merge lp:~victored/granite/remove-outstanding-deprecations
Reviewer Review Type Date Requested Status
xapantu (community) Abstain on 2015-08-18
Sergey "Shnatsel" Davidoff (community) 2013-08-16 Disapprove on 2015-08-18
Review via email: mp+180671@code.launchpad.net

Commit message

Remove outstanding deprecations from previous releases.

Description of the change

Remove outstanding deprecations from previous releases.

Please note that I am not removing Granite.Widgets.HintedEntry since oddly we deprecated it, but still based SearchEntry on it.

I did not remove the deprecated method from DynamicNotebook either since it's a widget with too many API clients.

Expect applications failing to build after landing this into trunk.

To post a comment you must log in.
606. By Victor Martinez on 2013-08-16

Bump version to 0.3.0, and SO version to 2

why would you remove deprecated things? Deprecation warnings are a good idea, but breaking compilation for older code and third-party apps is not.

And soname bumps are generally painful, so I don't think deleting deprecated stuff justifies a soname bump.

review: Disapprove
xapantu (xapantu) wrote :

For now we are not going to merge it, it must be done the next time we are forced to do a SO bump (so we already lost an occasion to do it).

review: Abstain

Unmerged revisions

606. By Victor Martinez on 2013-08-16

Bump version to 0.3.0, and SO version to 2

605. By Victor Martinez on 2013-08-16

Remove outstanding deprecations from previous releases.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-08-16 22:52:50 +0000
3+++ CMakeLists.txt 2013-08-16 23:42:02 +0000
4@@ -5,7 +5,7 @@
5 project (granite C)
6
7 set (PKG_NAME ${CMAKE_PROJECT_NAME})
8-set (PKG_VERSION 0.2.2)
9+set (PKG_VERSION 0.3.0)
10 set (API_VERSION 1.0)
11
12 # Used to create GObject introspection files
13
14=== modified file 'lib/Application.vala'
15--- lib/Application.vala 2013-03-20 15:42:25 +0000
16+++ lib/Application.vala 2013-08-16 23:42:02 +0000
17@@ -23,13 +23,6 @@
18 using Granite.Widgets;
19
20 namespace Granite {
21-
22- /**
23- * Global deprecated object..
24- */
25- [Deprecated (since = "granite-0.1")]
26- public static Granite.Application app;
27-
28 /**
29 * This is the base class for all Granite-based apps. It has methods that help
30 * to create a great deal of an app's functionality.
31@@ -80,9 +73,6 @@
32 Logger.DisplayLevel = LogLevel.WARN;
33
34 Intl.bindtextdomain (exec_name, build_data_dir + "/locale");
35-
36- // Deprecated
37- Granite.app = this;
38 }
39
40 #if LINUX
41
42=== modified file 'lib/CMakeLists.txt'
43--- lib/CMakeLists.txt 2013-06-08 20:38:28 +0000
44+++ lib/CMakeLists.txt 2013-08-16 23:42:02 +0000
45@@ -1,5 +1,5 @@
46 # increase when you break the API
47-set (PKG_SOVERSION 1)
48+set (PKG_SOVERSION 2)
49
50 # Increase when you add functionality
51 set (PKG_SOMINOR 0.1)
52@@ -15,7 +15,6 @@
53 Services/Logger.vala
54 Services/Paths.vala
55 Services/System.vala
56- Services/Contractor.vala
57 Services/ContractorProxy.vala
58 Services/IconFactory.vala
59 Services/SimpleCommand.vala
60@@ -34,12 +33,9 @@
61 Widgets/Welcome.vala
62 Widgets/ToolButtonWithMenu.vala
63 Widgets/PopOver.vala
64- Widgets/ContractorView.vala
65- Widgets/ContractorMenu.vala
66 Widgets/DecoratedWindow.vala
67 Widgets/LightWindow.vala
68 Widgets/StatusBar.vala
69- Widgets/SidebarPaned.vala
70 Widgets/SourceList.vala
71 Widgets/CellRendererExpander.vala
72 Widgets/CellRendererBadge.vala
73
74=== removed file 'lib/Services/Contractor.vala'
75--- lib/Services/Contractor.vala 2013-04-23 04:40:58 +0000
76+++ lib/Services/Contractor.vala 1970-01-01 00:00:00 +0000
77@@ -1,67 +0,0 @@
78-/***
79- Copyright (C) 2011-2013 Lucas Baudin <xapantu@gmail.com>
80-
81- This program or library is free software; you can redistribute it
82- and/or modify it under the terms of the GNU Lesser General Public
83- License as published by the Free Software Foundation; either
84- version 3 of the License, or (at your option) any later version.
85-
86- This library is distributed in the hope that it will be useful,
87- but WITHOUT ANY WARRANTY; without even the implied warranty of
88- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
89- Lesser General Public License for more details.
90-
91- You should have received a copy of the GNU Lesser General
92- Public License along with this library; if not, write to the
93- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
94- Boston, MA 02110-1301 USA.
95-***/
96-
97-namespace Granite.Services {
98- [DBus (name = "org.elementary.Contractor")]
99- interface ContractorDBus : Object {
100- public abstract GLib.HashTable<string,string>[] GetServicesByLocation (string strlocation, string? file_mime = "") throws IOError;
101- public abstract GLib.HashTable<string,string>[] GetServicesByLocationsList (GLib.HashTable<string,string>[] locations) throws IOError;
102- }
103-
104- /**
105- * A way to handle contractor, a way to communicate between apps.
106- *
107- * /!\ Highly unstable API
108- */
109- [Deprecated (replacement = "Granite.Services.ContractorProxy", since = "0.2")]
110- public class Contractor : Object {
111- internal ContractorDBus contract;
112- internal static Contractor? contractor = null;
113-
114- /**
115- * This creates a new Contractor
116- */
117- public Contractor () {
118- }
119-
120- internal static void ensure () {
121- }
122-
123- /**
124- * This searches for available contracts of a particular file
125- *
126- * @param uri uri of file
127- * @param mime mime type of file
128- * @return Hashtable of available contracts
129- */
130- public static GLib.HashTable<string,string>[] get_contract (string uri, string mime) {
131- return { new GLib.HashTable<string,string> (null, null) };
132- }
133-
134- /**
135- * generate contracts for arguments and filter them by common parent mimetype.
136- *
137- * @param locations Hashtable of locations
138- * @return Hashtable of available contracts
139- */
140- public static GLib.HashTable<string,string>[] get_selection_contracts (GLib.HashTable<string, string>[] locations) {
141- return { new GLib.HashTable<string,string> (null, null) };
142- }
143- }
144-}
145
146=== modified file 'lib/Widgets/AppMenu.vala'
147--- lib/Widgets/AppMenu.vala 2013-03-20 15:42:25 +0000
148+++ lib/Widgets/AppMenu.vala 2013-08-16 23:42:02 +0000
149@@ -64,15 +64,6 @@
150 }
151
152 /**
153- * Create a new AppMenu, parameters are unused now.
154- */
155- [Deprecated (since = "granite-0.1")]
156- public AppMenu.with_urls (Gtk.Menu menu, string help_url, string translate_url, string bug_url) {
157- critical("This is a deprecated creation method: AppMenu.with_urls");
158- base (new Image.from_icon_name ("application-menu", IconSize.MENU), _("Menu"), menu);
159- }
160-
161- /**
162 * This method adds makes a properly formatted App Menu menu from given menu
163 *
164 * @param menu menu to format
165
166=== modified file 'lib/Widgets/CellRendererBadge.vala'
167--- lib/Widgets/CellRendererBadge.vala 2013-03-21 12:23:37 +0000
168+++ lib/Widgets/CellRendererBadge.vala 2013-08-16 23:42:02 +0000
169@@ -122,7 +122,6 @@
170 ctx.render_layout (context, x, y, text_layout);
171 }
172
173- [Deprecated (replacement = "Gtk.CellRenderer.get_preferred_size", since = "")]
174 public override void get_size (Gtk.Widget widget, Gdk.Rectangle? cell_area,
175 out int x_offset, out int y_offset,
176 out int width, out int height)
177
178=== modified file 'lib/Widgets/CellRendererExpander.vala'
179--- lib/Widgets/CellRendererExpander.vala 2013-04-23 05:28:57 +0000
180+++ lib/Widgets/CellRendererExpander.vala 2013-08-16 23:42:02 +0000
181@@ -96,7 +96,6 @@
182 revert_style_changes (widget);
183 }
184
185- [Deprecated (replacement = "Gtk.CellRenderer.get_preferred_size", since = "")]
186 public override void get_size (Gtk.Widget widget, Gdk.Rectangle? cell_area,
187 out int x_offset, out int y_offset,
188 out int width, out int height)
189
190=== modified file 'lib/Widgets/CollapsiblePaned.vala'
191--- lib/Widgets/CollapsiblePaned.vala 2013-03-20 15:42:25 +0000
192+++ lib/Widgets/CollapsiblePaned.vala 2013-08-16 23:42:02 +0000
193@@ -35,8 +35,6 @@
194 */
195 public class CollapsiblePaned : Gtk.Paned {
196 public CollapseMode collapse_mode { get; set; default = CollapseMode.NONE; }
197- //public signal void shrink(); //TODO: Make the default action overwritable
198- //public new signal void expand(int saved_state); //TODO same
199
200 private int saved_state = 10;
201 private uint last_click_time = 0;
202@@ -86,18 +84,4 @@
203 return false;
204 }
205 }
206-
207- [Deprecated (replacement = "Granite.Widgets.CollapsiblePaned", since = "granite-0.2")]
208- public class HCollapsablePaned : CollapsiblePaned {
209- public HCollapsablePaned () {
210- base (Gtk.Orientation.HORIZONTAL);
211- }
212- }
213-
214- [Deprecated (replacement = "Granite.Widgets.CollapsiblePaned", since = "granite-0.2")]
215- public class VCollapsablePaned : CollapsiblePaned {
216- public VCollapsablePaned () {
217- base (Gtk.Orientation.VERTICAL);
218- }
219- }
220 }
221
222=== removed file 'lib/Widgets/ContractorMenu.vala'
223--- lib/Widgets/ContractorMenu.vala 2013-04-22 19:05:09 +0000
224+++ lib/Widgets/ContractorMenu.vala 1970-01-01 00:00:00 +0000
225@@ -1,142 +0,0 @@
226-/***
227- Copyright (C) 2012-2013 Andrea Basso <andrea@elementaryos.org>
228-
229- This program or library is free software; you can redistribute it
230- and/or modify it under the terms of the GNU Lesser General Public
231- License as published by the Free Software Foundation; either
232- version 3 of the License, or (at your option) any later version.
233-
234- This library is distributed in the hope that it will be useful,
235- but WITHOUT ANY WARRANTY; without even the implied warranty of
236- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
237- Lesser General Public License for more details.
238-
239- You should have received a copy of the GNU Lesser General
240- Public License along with this library; if not, write to the
241- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
242- Boston, MA 02110-1301 USA.
243-***/
244-
245-/**
246- * This class provides a simple menu for managing Contractor.
247- */
248-[Deprecated (since = "0.2")]
249-public class Granite.Widgets.ContractorMenu : Gtk.Menu {
250- /**
251- * The Hashtable of available contracts
252- */
253- HashTable<string,string>[] contracts;
254- /**
255- * The Hashtable of executables
256- */
257- Gee.HashMap <string,string> execs;
258- public delegate void ContractCallback ();
259- private string filepath;
260- private string filemime;
261-
262- /**
263- * Passes when contract is clicked
264- */
265- public signal void contract_activated (string contract_name);
266-
267- /**
268- * Makes new Contractor Meu
269- *
270- * @param filename the filename of the file
271- * @param mime the mime-type of the file
272- */
273- public ContractorMenu (string filename, string mime) {
274- filepath = filename;
275- filemime = mime;
276- load_items (filename, mime);
277- }
278-
279- /**
280- * Adds new item to Contractor Menu
281- *
282- * @param name name of menu item
283- * @param icon_name the desired icon for menu item
284- * @param position desired position of menu item
285- * @param method method to be called when menu item is clicked
286- * @param use_stock tells whether to use stock for menu item
287- */
288- public void add_item (string name, string icon_name, int position, ContractCallback method, bool use_stock = true) {
289- var item = new Gtk.ImageMenuItem ();
290- item.set_always_show_image (true);
291- item.set_use_stock (use_stock);
292- var image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.MENU);
293- item.set_label (name);
294- item.set_image (image);
295- item.activate.connect (()=> {
296- contract_activated (name);
297- method();
298- });
299- insert(item, position);
300- item.show ();
301- }
302-
303- /**
304- * Deletes a group of menu items
305- *
306- * @param names of menu items to delete
307- */
308- public void name_blacklist (string[] names) {
309- this.foreach ((item)=> {
310- if (((Gtk.MenuItem)item).get_label () in names)
311- remove (item);
312- });
313- }
314-
315- private void load_items (string filename, string mime) {
316- contracts = Granite.Services.Contractor.get_contract (filename, mime);
317- execs = new Gee.HashMap<string,string> ();
318-
319- for (int i=0;i<contracts.length;i++) {
320- execs[contracts[i].lookup ("Name")] = contracts[i].lookup ("Exec");
321-
322- var item = new Gtk.ImageMenuItem ();
323- item.set_always_show_image (true);
324- var image = new Gtk.Image.from_icon_name (contracts[i].lookup ("IconName"), Gtk.IconSize.MENU);
325- item.set_label (contracts[i].lookup ("Name"));
326- item.set_image (image);
327- item.activate.connect ( ()=> {
328- try {
329- Process.spawn_command_line_async (execs.get(item.get_label ()));
330- } catch (Error e) {
331- error (e.message);
332- }
333- });
334- append (item);
335- item.show_all ();
336- }
337- }
338-
339- /**
340- * Updates Contractor menu items
341- *
342- * @param filename the filename of the file
343- * @param mime the mime-type of the file
344- */
345- public void update (string? filename, string? mime) {
346- this.foreach ((w) => {remove (w);});
347-
348- string fn = "";
349- string mm = "";
350-
351- if (filename != null) {
352- fn = filename;
353- filepath = filename;
354- } else {
355- fn = filepath;
356- }
357-
358- if (mime != null) {
359- mm = mime;
360- filemime = mime;
361- } else {
362- mm = filemime;
363- }
364-
365- load_items (fn, mm);
366- }
367-}
368
369=== removed file 'lib/Widgets/ContractorView.vala'
370--- lib/Widgets/ContractorView.vala 2013-04-22 19:05:09 +0000
371+++ lib/Widgets/ContractorView.vala 1970-01-01 00:00:00 +0000
372@@ -1,217 +0,0 @@
373-/***
374- Copyright (C) 2011-2013 Tom Beckmann <tom@elementaryos.org>
375-
376- This program or library is free software; you can redistribute it
377- and/or modify it under the terms of the GNU Lesser General Public
378- License as published by the Free Software Foundation; either
379- version 3 of the License, or (at your option) any later version.
380-
381- This library is distributed in the hope that it will be useful,
382- but WITHOUT ANY WARRANTY; without even the implied warranty of
383- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
384- Lesser General Public License for more details.
385-
386- You should have received a copy of the GNU Lesser General
387- Public License along with this library; if not, write to the
388- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
389- Boston, MA 02110-1301 USA.
390-***/
391-
392-using Gtk;
393-
394-/**
395- * This class provides a simple way to look at contracts from Contractor
396- */
397-[Deprecated (since = "0.2")]
398-public class Granite.Widgets.ContractorView : TreeView {
399-
400- /**
401- * indicates if it was possible to connect to contractor
402- */
403- public bool contractor_available;
404-
405- public delegate void ContractCallback ();
406- private Gee.HashMap<int, DelegateWrapper?> outsiders;
407- private int[] blacklisted_pos;
408- private ListStore list;
409-
410- private struct DelegateWrapper { unowned ContractCallback method; }
411-
412- /**
413- * the index of the currently selected contract
414- */
415- public int selected {
416- get {
417- TreePath path;
418- this.get_cursor (out path, null);
419- return int.parse (path.to_string ());
420- }
421- set {
422- this.set_cursor (new TreePath.from_string (value.to_string ()), null, false);
423- }
424- }
425-
426- /**
427- * A contract was launched using double clicking
428- */
429- public signal void executed ();
430-
431- /**
432- * the original array of contracts returned by contractor
433- */
434- HashTable<string,string>[] contracts;
435-
436- /**
437- * Create the default ContractorView
438- *
439- * @param filename the file
440- * @param mime the mimetype of the file
441- * @param icon_size the size of the icon in pixel
442- * @param show_contract_name show the name of the contract in the list
443- */
444- public ContractorView (string filename, string mime, int icon_size = 32, bool show_contract_name = true) {
445- /* Setup the ListStore */
446- list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string));
447- outsiders = new Gee.HashMap<int, DelegateWrapper?> ();
448- this.model = list;
449-
450- /* GUI */
451- this.headers_visible = false;
452- this.hexpand = true;
453-
454- /* Events */
455- row_activated.connect (() => {
456- run_selected ();
457- executed ();
458- });
459-
460- /* View */
461- var cell1 = new CellRendererPixbuf ();
462- cell1.set_padding (5, 8);
463- this.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0);
464- var cell2 = new CellRendererText ();
465- cell2.set_padding (2, 8);
466- this.insert_column_with_attributes (-1, "", cell2, "markup", 1);
467-
468- this.contracts = Granite.Services.Contractor.get_contract (filename, mime);
469- if (this.contracts == null || this.contracts.length == 0) {
470- warning ("You should install contractor (or no contracts found for this mime).\n");
471- contractor_available = false;
472- TreeIter it;
473- list.append (out it);
474- bool contractor_installed = this.contracts == null;
475- string message = contractor_installed ? _("Could not contact Contractor. You may need to install it") : _("No action found for this file");
476- try {
477- var icon = IconTheme.get_default ().load_icon (
478- contractor_installed ? Gtk.Stock.DIALOG_ERROR : Gtk.Stock.DIALOG_INFO,
479- icon_size, 0);
480- list.set (it,
481- 0, icon, 1, message);
482- }
483- catch (Error e) {
484- warning("%s\n", e.message);
485- }
486- set_sensitive(false);
487- }
488- else {
489- contractor_available = true;
490-
491- for (var i=0; i<this.contracts.length; i++){
492- TreeIter it;
493- list.append (out it);
494- string text = this.contracts[i].lookup ("Description");
495- if (show_contract_name)
496- text = "<b>"+this.contracts[i].lookup ("Name")+"</b>\n"+text;
497- try{
498- list.set (it,
499- 0, IconTheme.get_default ().load_icon (this.contracts[i].lookup ("IconName"),
500- icon_size, 0), 1, text);
501- }
502- catch (Error e) {
503- warning (e.message);
504- }
505- }
506- this.selected = 0;
507- }
508- }
509-
510- /**
511- * A method to add items to the tree
512- *
513- * @param name the name
514- * @param desc the description
515- * @param icon_name the name of the icon to show
516- * @param icon_size the size of the icon in pixel
517- * @param position the posion the item will be inserted at (first position is 0)
518- * @param method a general method containing all the methods that should be called when the item is activated
519- * (must return void and mustn't have any parameter)
520- */
521- public void add_item (string name, string desc, string icon_name, int icon_size, int position, ContractCallback method) {
522- TreeIter it;
523- list.insert (out it, position);
524-
525- string text = "<b>" + name + "</b>\n" + desc;
526-
527- try{
528- list.set (it, 0, IconTheme.get_default ().load_icon (icon_name, icon_size, 0), 1, text);
529- } catch (Error e) {
530- error (e.message);
531- }
532-
533- DelegateWrapper wr = { method };
534- outsiders[position] = wr;
535-
536- this.selected = 0;
537- }
538-
539- public void name_blacklist (string[] names) {
540- TreeIter it;
541- TreeIter it2;
542- Value value;
543- bool check;
544- int cur_pos = 0;
545- list.get_iter_first (out it);
546- list.get_iter_first (out it2);
547-
548- while (true) {
549- list.get_value (it, 1, out value);
550- check = list.iter_next (ref it2);
551- string text = value.get_string ();
552-
553- if (text[3:text.index_of ("</b>")] in names) {
554- list.remove (it);
555- blacklisted_pos += cur_pos;
556- }
557- if (!check)
558- break;
559-
560- it = it2;
561- cur_pos++;
562- }
563- }
564-
565-
566- public void run_selected () {
567- if (this.selected in outsiders.keys ) {
568- outsiders[this.selected].method ();
569- } else {
570- try {
571- int corr = 0;
572- foreach (int i in outsiders.keys) { //adjust in case of items added
573- if (i > this.selected)
574- break;
575- corr++;
576- }
577- foreach (int i in blacklisted_pos) { //adjust in case of items removed
578- if (i > this.selected)
579- break;
580- corr--;
581- }
582- Process.spawn_command_line_async (
583- this.contracts[this.selected-corr].lookup ("Exec"));
584- } catch (Error e) {
585- error (e.message);
586- }
587- }
588- }
589-}
590
591=== removed file 'lib/Widgets/SidebarPaned.vala'
592--- lib/Widgets/SidebarPaned.vala 2013-03-21 12:23:37 +0000
593+++ lib/Widgets/SidebarPaned.vala 1970-01-01 00:00:00 +0000
594@@ -1,25 +0,0 @@
595-/***
596- Copyright (C) 2011-2013 Granite Developers
597-
598- This program or library is free software; you can redistribute it
599- and/or modify it under the terms of the GNU Lesser General Public
600- License as published by the Free Software Foundation; either
601- version 3 of the License, or (at your option) any later version.
602-
603- This library is distributed in the hope that it will be useful,
604- but WITHOUT ANY WARRANTY; without even the implied warranty of
605- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
606- Lesser General Public License for more details.
607-
608- You should have received a copy of the GNU Lesser General
609- Public License along with this library; if not, write to the
610- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
611- Boston, MA 02110-1301 USA.
612-
613- Authored by: Victor Eduardo <victoreduardm@gmail.com>
614-***/
615-
616-[Deprecated (replacement = "Granite.Widgets.ThinPaned", since = "granite-0.2")]
617-public class Granite.Widgets.SidebarPaned : ThinPaned {
618-}
619-

Subscribers

People subscribed via source and target branches