[pan2/testing: 135/279] replaced some getter functions with direct calls
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2/testing: 135/279] replaced some getter functions with direct calls
- Date: Sat, 3 Dec 2011 22:33:31 +0000 (UTC)
commit 21ec49bc44c0b16a1e4bee8d4163a5e8c1a9ede9
Author: Heinrich MÃller <sphemuel stud informatik uni-erlangen de>
Date: Wed Jun 29 17:27:51 2011 +0200
replaced some getter functions with direct calls
pan/gui/post-ui.cc | 26 +++++++++++++-------------
pan/tasks/task-upload.cc | 4 ++--
pan/tasks/task-upload.h | 6 +-----
3 files changed, 16 insertions(+), 20 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 9b6d333..73ca228 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -148,9 +148,9 @@ PostUI :: update_filequeue_tab()
gtk_list_store_insert (store, &iter, i);
gtk_list_store_set (store, &iter,
0, i+1,
- 1, task->subject().c_str(),
+ 1, task->_subject.c_str(),
2, task,
- 3, task->get_byte_count()/1024,
+ 3, task->_bytes/1024,
4, task->encode_mode().c_str(),
-1);
}
@@ -172,9 +172,9 @@ PostUI :: on_queue_tasks_added (UploadQueue& queue, int index, int count)
gtk_list_store_insert (store, &iter, pos);
gtk_list_store_set (store, &iter,
0, pos+1,
- 1, task->subject().c_str(),
+ 1, task->_subject.c_str(),
2, task,
- 3, task->get_byte_count()/1024,
+ 3, task->_bytes/1024,
4, task->encode_mode().c_str(),
-1);
}
@@ -1039,7 +1039,7 @@ PostUI :: maybe_post_message (GMimeMessage * message)
foreach (PostUI::tasks_t, tasks, it)
{
- const char* basename = (*it)->filename().c_str();
+ const char* basename = (*it)->_filename.c_str();
TaskUpload::Needed n;
stat (basename,&sb);
@@ -1059,7 +1059,7 @@ PostUI :: maybe_post_message (GMimeMessage * message)
g_snprintf(buf,sizeof(buf),"%s.%d", basename, *pit);
n.message_id = buf;
n.partno = *pit;
- (*it)->needed().insert(std::pair<int,TaskUpload::Needed>(*pit,n));
+ (*it)->_needed.insert(std::pair<int,TaskUpload::Needed>(*pit,n));
}
(*it)->build_needed_tasks();
@@ -2272,7 +2272,7 @@ namespace
TaskUpload* fd(0);
gtk_tree_model_get (model, iter, 2, &fd, -1);
if (fd)
- g_object_set (renderer, "text", fd->basename().c_str(), NULL);
+ g_object_set (renderer, "text", fd->get_basename().c_str(), NULL);
}
void
@@ -2373,10 +2373,10 @@ PostUI:: on_parts_box_clicked_cb (GtkCellRendererToggle *cell, gchar *path_str,
enabled ^= 1;
if (enabled==0)
- data->upload_ptr()->_wanted.erase(part);
+ data->_upload_ptr->_wanted.erase(part);
else
{
- data->upload_ptr()->_wanted.insert(part);
+ data->_upload_ptr->_wanted.insert(part);
}
gtk_list_store_set(GTK_LIST_STORE( model ), &iter, 1, enabled, -1);
@@ -2409,7 +2409,7 @@ PostUI :: create_parts_tab ()
gtk_label_set_use_markup (GTK_LABEL(l), true);
gtk_misc_set_alignment (GTK_MISC(l), 0.0f, 0.5f);
gtk_table_attach (GTK_TABLE(t), l, 0, 1, row, row+1, GTK_FILL, GTK_FILL, 0, 0);
- g_snprintf (buf, sizeof(buf), "%s", _upload_ptr->basename().c_str());
+ g_snprintf (buf, sizeof(buf), "%s", _upload_ptr->_basename.c_str());
l = gtk_label_new (buf);
gtk_misc_set_alignment (GTK_MISC(l), 0.5f, 0.5f);
gtk_widget_set_tooltip_text (l, _("The current filename"));
@@ -2421,7 +2421,7 @@ PostUI :: create_parts_tab ()
gtk_label_set_use_markup (GTK_LABEL(l), true);
gtk_misc_set_alignment (GTK_MISC(l), 0.0f, 0.5f);
gtk_table_attach (GTK_TABLE(t), l, 0, 1, row, row+1, GTK_FILL, GTK_FILL, 0, 0);
- g_snprintf (buf, sizeof(buf), "%s", _upload_ptr->subject().c_str());
+ g_snprintf (buf, sizeof(buf), "%s", _upload_ptr->_subject.c_str());
l = gtk_label_new (buf);
gtk_misc_set_alignment (GTK_MISC(l), 0.5f, 0.5f);
gtk_widget_set_tooltip_text (l, _("The current Subject Line"));
@@ -2615,7 +2615,7 @@ PostUI :: select_encode (GtkAction* a)
struct stat sb;
foreach(tasks_t, tasks, it)
{
- const char* f = (*it)->filename().c_str();
+ const char* f = (*it)->_filename.c_str();
int total(get_total_parts (f,*it));
(*it)->_encode_mode = tmp;
@@ -2741,7 +2741,7 @@ PostUI :: update_parts_tab()
gtk_list_store_set (store, &iter,
0, i,
1, res,
- 2, _upload_ptr->basename().c_str(), -1);
+ 2, _upload_ptr->_basename.c_str(), -1);
}
}
diff --git a/pan/tasks/task-upload.cc b/pan/tasks/task-upload.cc
index ed35b77..e1f783b 100644
--- a/pan/tasks/task-upload.cc
+++ b/pan/tasks/task-upload.cc
@@ -54,7 +54,7 @@ namespace
return buf;
}
- std::string get_basename(const char* f)
+ std::string g_get_basename(const char* f)
{
char buf[4096];
char * freeme = g_path_get_basename(f);
@@ -78,7 +78,7 @@ TaskUpload :: TaskUpload (const std::string & filename,
const TaskUpload::EncodeMode enc):
Task ("UPLOAD", get_description(filename.c_str())),
_filename(filename),
- _basename (get_basename(filename.c_str())),
+ _basename (g_get_basename(filename.c_str())),
_server(server),
_cache(cache),
_article(article),
diff --git a/pan/tasks/task-upload.h b/pan/tasks/task-upload.h
index b09f7cd..78f4da8 100644
--- a/pan/tasks/task-upload.h
+++ b/pan/tasks/task-upload.h
@@ -105,11 +105,7 @@ namespace pan
public: // Task subclass
unsigned long get_bytes_remaining () const;
void stop ();
- const std::string& basename() { return _basename; }
- const std::string& filename() { return _filename; }
- const std::string& subject () { return _subject; }
- unsigned long get_byte_count() { return _bytes; }
- needed_t& needed() { return _needed; }
+ const std::string& get_basename() { return _basename; }
std::string enc_mode_to_str(EncodeMode& e)
{
std::string res;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]