[Xfce4-commits] <postler:master> Omit sentinel -1 from model get, insert and set
Christian Dywan
noreply at xfce.org
Sat Jun 26 03:22:02 CEST 2010
Updating branch refs/heads/master
to 1fa4e7d6d2d8bbf8b37c9a590d53d1d1ad76acfc (commit)
from cf5429d7a267aa253db33b17f0a784cc6f4d3085 (commit)
commit 1fa4e7d6d2d8bbf8b37c9a590d53d1d1ad76acfc
Author: Christian Dywan <christian at twotoasts.de>
Date: Mon Jun 21 21:50:50 2010 +0200
Omit sentinel -1 from model get, insert and set
postler/postler-composer.vala | 2 +-
postler/postler-folders.vala | 35 ++++++++++++++---------------------
postler/postler-messages.vala | 25 +++++++++++--------------
3 files changed, 26 insertions(+), 36 deletions(-)
diff --git a/postler/postler-composer.vala b/postler/postler-composer.vala
index 241dc89..f96d9e8 100644
--- a/postler/postler-composer.vala
+++ b/postler/postler-composer.vala
@@ -289,7 +289,7 @@ public class Postler.Composer : Gtk.Window {
if (model.iter_children (out iter, null)) {
do {
string address;
- model.get (iter, 0, out address, -1);
+ model.get (iter, 0, out address);
if (from in address) {
combo_from.set_active_iter (iter);
break;
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 35df0d0..78a1e90 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -28,7 +28,7 @@ public class Postler.Folders : Gtk.TreeView {
return_val_if_fail (messages != null, null);
Gtk.TreeIter iter;
if (get_selection ().get_selected (null, out iter)) {
- store.get (iter, Columns.LOCATION, out last_location, -1);
+ store.get (iter, Columns.LOCATION, out last_location);
return last_location;
}
return null;
@@ -39,7 +39,7 @@ public class Postler.Folders : Gtk.TreeView {
Gtk.TreeIter iter;
if (get_selection ().get_selected (null, out iter)) {
AccountInfo account_info;
- store.get (iter, Columns.INFO, out account_info, -1);
+ store.get (iter, Columns.INFO, out account_info);
return account_info;
}
return null;
@@ -81,8 +81,7 @@ public class Postler.Folders : Gtk.TreeView {
Gtk.TreeIter iter;
if (store.get_iter_from_string (out iter, path))
store.set (iter,
- Columns.NAME, "%s (%d)".printf (account, unread),
- -1);
+ Columns.NAME, "%s (%d)".printf (account, unread));
} catch (GLib.Error error) {
GLib.critical (_("Failed to monitor folder \"%s\": %s"),
msg_dir.get_path (), error.message);
@@ -109,7 +108,7 @@ public class Postler.Folders : Gtk.TreeView {
Columns.ICON, STOCK_FOLDER_SAVED_SEARCH,
Columns.NAME, account_info.name,
Columns.INFO, account_info,
- Columns.LOCATION, account_info.path, -1);
+ Columns.LOCATION, account_info.path);
continue;
}
@@ -120,8 +119,7 @@ public class Postler.Folders : Gtk.TreeView {
do {
AccountInfo other_info;
store.get (account_iter,
- Columns.INFO, out other_info,
- -1);
+ Columns.INFO, out other_info);
if (account_info == other_info) {
existing_iter = true;
break;
@@ -131,8 +129,7 @@ public class Postler.Folders : Gtk.TreeView {
if (existing_iter) {
store.set (account_iter,
Columns.ICON, Gtk.STOCK_DIRECTORY,
- Columns.LOCATION, null,
- -1);
+ Columns.LOCATION, null);
Gtk.TreeIter iter;
while (store.iter_children (out iter, account_iter))
store.remove (iter);
@@ -142,8 +139,7 @@ public class Postler.Folders : Gtk.TreeView {
Columns.ICON, Gtk.STOCK_DIRECTORY,
Columns.NAME, account_info.name,
Columns.LOCATION, null,
- Columns.INFO, account_info,
- -1);
+ Columns.INFO, account_info);
var folder_dir = File.new_for_path (account_info.path);
var folder_enumerator = folder_dir.enumerate_children (
@@ -181,8 +177,7 @@ public class Postler.Folders : Gtk.TreeView {
store.set (account_iter,
Columns.ICON, STOCK_INBOX,
- Columns.LOCATION, account_info.path + "/" + name,
- -1);
+ Columns.LOCATION, account_info.path + "/" + name);
continue;
}
@@ -201,8 +196,7 @@ public class Postler.Folders : Gtk.TreeView {
Columns.ICON, stock_id,
Columns.NAME, localized_name ?? name,
Columns.LOCATION, account_info.path + "/" + name,
- Columns.INFO, account_info,
- -1);
+ Columns.INFO, account_info);
var status_dir = folder_dir.resolve_relative_path (name);
var new_dir = status_dir.resolve_relative_path ("new");
if (!new_dir.query_exists (null))
@@ -221,7 +215,7 @@ public class Postler.Folders : Gtk.TreeView {
void select_folder (Gtk.TreeIter iter)
requires (messages != null) {
string location;
- store.get (iter, Columns.LOCATION, out location, -1);
+ store.get (iter, Columns.LOCATION, out location);
if (location != null) {
messages.populate (location);
messages.grab_focus ();
@@ -232,7 +226,7 @@ public class Postler.Folders : Gtk.TreeView {
void empty_folder (Gtk.TreeIter iter) {
string location;
- store.get (iter, Columns.LOCATION, out location, -1);
+ store.get (iter, Columns.LOCATION, out location);
try {
string[] folders = { "cur", "new" };
foreach (var folder in folders) {
@@ -265,7 +259,7 @@ public class Postler.Folders : Gtk.TreeView {
Gtk.TreeIter iter;
if (get_selection ().get_selected (null, out iter)) {
string? location;
- store.get (iter, Columns.LOCATION, out location, -1);
+ store.get (iter, Columns.LOCATION, out location);
var bureau = new Bureau ();
bureau.messages.populate (location);
bureau.messages.grab_focus ();
@@ -283,8 +277,7 @@ public class Postler.Folders : Gtk.TreeView {
AccountInfo? account_info;
store.get (iter,
Columns.NAME, out name,
- Columns.INFO, out account_info,
- -1);
+ Columns.INFO, out account_info);
if (account_info != null) {
account_info.hide += "," + name;
var account_infos = new GLib.List<AccountInfo> ();
@@ -317,7 +310,7 @@ public class Postler.Folders : Gtk.TreeView {
Gtk.TreeIter iter;
if (get_selection ().get_selected (null, out iter)) {
AccountInfo? account_info;
- store.get (iter, Columns.INFO, out account_info, -1);
+ store.get (iter, Columns.INFO, out account_info);
accounts.remove_info (account_info);
populate ();
}
diff --git a/postler/postler-messages.vala b/postler/postler-messages.vala
index b0cfa72..4cc65da 100644
--- a/postler/postler-messages.vala
+++ b/postler/postler-messages.vala
@@ -38,7 +38,7 @@ public class Postler.Messages : Gtk.TreeView {
bool search_inline (Gtk.TreeModel model, int column, string key,
Gtk.TreeIter iter) {
string subject;
- model.get (iter, Columns.SUBJECT, out subject, -1);
+ model.get (iter, Columns.SUBJECT, out subject);
return !(key in subject.down ());
}
@@ -49,7 +49,7 @@ public class Postler.Messages : Gtk.TreeView {
if (path != null) {
Gtk.TreeIter sort_iter;
if (sort.get_iter (out sort_iter, path))
- sort.get (sort_iter, Columns.LOCATION, out location, -1);
+ sort.get (sort_iter, Columns.LOCATION, out location);
}
selected_location = location;
}
@@ -96,8 +96,7 @@ public class Postler.Messages : Gtk.TreeView {
if (!rich_rows) {
model.get (iter, Columns.SUBJECT, out subject,
- Columns.WEIGHT, out weight,
- -1);
+ Columns.WEIGHT, out weight);
renderer.text = parse_encoded (subject, out charset);
renderer.weight = weight;
return;
@@ -108,8 +107,7 @@ public class Postler.Messages : Gtk.TreeView {
model.get (iter, Columns.SUBJECT, out subject,
Columns.WEIGHT, out weight,
Columns.TIMESTAMP, out timestamp,
- Columns.FROM, out from,
- -1);
+ Columns.FROM, out from);
subject = escape_text (parse_encoded (subject, out charset));
renderer.markup = ("<span weight=\"%d\">%s</span>\n" +
@@ -127,7 +125,7 @@ public class Postler.Messages : Gtk.TreeView {
renderer.text = "";
else {
string from;
- model.get (iter, Columns.FROM, out from, -1);
+ model.get (iter, Columns.FROM, out from);
string charset;
renderer.text = parse_address (parse_encoded (from, out charset))[0];
}
@@ -141,7 +139,7 @@ public class Postler.Messages : Gtk.TreeView {
renderer.text = "";
else {
time_t timestamp;
- model.get (iter, Columns.TIMESTAMP, out timestamp, -1);
+ model.get (iter, Columns.TIMESTAMP, out timestamp);
renderer.text = GLib.Time.local (timestamp).format ("%x %X");
}
}
@@ -154,7 +152,7 @@ public class Postler.Messages : Gtk.TreeView {
renderer.text = "";
else {
int64 size;
- model.get (iter, Columns.SIZE, out size, -1);
+ model.get (iter, Columns.SIZE, out size);
renderer.text = format_size_for_display (size);
}
}
@@ -510,8 +508,7 @@ public class Postler.Messages : Gtk.TreeView {
Columns.FROM, from != null ? from : _("Unknown"),
Columns.TIMESTAMP, timestamp,
Columns.SIZE, info.get_size (),
- Columns.LOCATION, contents.get_path (),
- -1);
+ Columns.LOCATION, contents.get_path ());
}
}
@@ -541,7 +538,7 @@ public class Postler.Messages : Gtk.TreeView {
void display_message (Gtk.TreeIter sort_iter) {
string location;
- sort.get (sort_iter, Columns.LOCATION, out location, -1);
+ sort.get (sort_iter, Columns.LOCATION, out location);
content.display (location);
selected_location = location;
}
@@ -560,7 +557,7 @@ public class Postler.Messages : Gtk.TreeView {
Gtk.TreeIter sort_iter;
if (sort.get_iter (out sort_iter, path)) {
string location;
- sort.get (sort_iter, Columns.LOCATION, out location, -1);
+ sort.get (sort_iter, Columns.LOCATION, out location);
var file = File.new_for_path (location);
try {
file.delete (null);
@@ -587,7 +584,7 @@ public class Postler.Messages : Gtk.TreeView {
var path = paths.nth_data (0);
if (path != null && sort.get_iter (out sort_iter, path)) {
string location;
- sort.get (sort_iter, Columns.LOCATION, out location, -1);
+ sort.get (sort_iter, Columns.LOCATION, out location);
Postler.App.spawn_module ("content", location);
}
}
More information about the Xfce4-commits
mailing list