[gnote] Change argument for utils::load_from_string_list
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnote] Change argument for utils::load_from_string_list
- Date: Wed,  1 Jun 2011 20:10:41 +0000 (UTC)
commit 76a574ef26baf382f38b1e292c4716912ff0a773
Author: Aurimas Ä?ernius <aurisc4 gmail com>
Date:   Sun May 29 22:55:02 2011 +0300
    Change argument for utils::load_from_string_list
    
    Use const std::vector<Glib::ustring>& instead of const std::vector<std::string>&
 src/utils.cpp |   14 ++++++++++----
 src/utils.hpp |    2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/utils.cpp b/src/utils.cpp
index d467ea9..1751994 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -70,7 +70,8 @@ namespace gnote {
         menu->get_attach_widget()->get_window()->get_origin(x, y);
         x += menu->get_attach_widget()->get_allocation().get_x();
         
-        Gtk::Requisition menu_req = menu->size_request();
+        Gtk::Requisition menu_req, unused;
+        menu->get_preferred_size(unused, menu_req);
         if (y + menu_req.height >= menu->get_attach_widget()->get_screen()->get_height()) {
           y -= menu_req.height;
         }
@@ -452,12 +453,17 @@ namespace gnote {
     {
       std::vector<std::string> items;
       sharp::string_split(items, data, "\n");
-      load_from_string_list(items);
+      std::vector<Glib::ustring> uitems;
+      for(std::vector<std::string>::iterator iter = items.begin();
+          iter != items.end(); ++iter) {
+        uitems.push_back(*iter);
+      }
+      load_from_string_list(uitems);
     }
 
-    void UriList::load_from_string_list(const std::vector<std::string> & items)
+    void UriList::load_from_string_list(const std::vector<Glib::ustring> & items)
     {
-      for(std::vector<std::string>::const_iterator iter = items.begin();
+      for(std::vector<Glib::ustring>::const_iterator iter = items.begin();
           iter != items.end(); ++iter) {
 
         const std::string & i(*iter);
diff --git a/src/utils.hpp b/src/utils.hpp
index 1ceaf1c..00e9c50 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -118,7 +118,7 @@ namespace gnote {
       
     private:
       void load_from_string(const std::string & data);
-      void load_from_string_list(const std::vector<std::string> & items);
+      void load_from_string_list(const std::vector<Glib::ustring> & items);
     };
 
     class XmlEncoder
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]