Imported Upstream version 2.45.31 upstream/2.45.31
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:50:14 +0000 (23:50 -0700)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 7 Sep 2020 06:50:14 +0000 (23:50 -0700)
116 files changed:
NEWS
configure.ac
examples/child_watch/main.cc
examples/dbus/client_bus_listnames.cc
examples/dbus/server_without_bus.cc
examples/dbus/session_bus_service.cc
examples/iochannel_stream/fdstream.cc
examples/iochannel_stream/main.cc
examples/keyfile/main.cc
examples/markup/parser.cc
examples/network/resolver.cc
examples/network/socket-client.cc
examples/network/socket-server.cc
examples/options/main.cc
examples/regex/main.cc
examples/settings/settings.cc
examples/thread/dispatcher.cc
examples/thread/dispatcher2.cc
examples/thread/thread.cc
examples/thread/threadpool.cc
gio/giomm/contenttype.cc
gio/giomm/slot_async.cc
gio/giomm/socketsource.h
gio/src/action.hg
gio/src/actiongroup.hg
gio/src/actionmap.ccg
gio/src/application.ccg
gio/src/asyncinitable.ccg
gio/src/asyncresult.ccg
gio/src/bufferedinputstream.ccg
gio/src/cancellable.ccg
gio/src/datainputstream.ccg
gio/src/dbusaddress.ccg
gio/src/dbusconnection.ccg
gio/src/dbusownname.ccg
gio/src/dbusproxy.ccg
gio/src/dbussubtreevtable.ccg
gio/src/dbuswatchname.ccg
gio/src/drive.ccg
gio/src/file.ccg
gio/src/fileattributeinfolist.ccg
gio/src/fileenumerator.ccg
gio/src/fileinfo.hg
gio/src/fileinputstream.ccg
gio/src/fileiostream.ccg
gio/src/fileoutputstream.ccg
gio/src/gio_docs.xml
gio/src/icon.ccg
gio/src/inputstream.ccg
gio/src/iostream.ccg
gio/src/loadableicon.ccg
gio/src/memoryinputstream.ccg
gio/src/mount.ccg
gio/src/networkaddress.ccg
gio/src/networkmonitor.ccg
gio/src/outputstream.ccg
gio/src/proxy.ccg
gio/src/proxyresolver.ccg
gio/src/resolver.ccg
gio/src/settings.ccg
gio/src/socket.ccg
gio/src/socketaddressenumerator.ccg
gio/src/socketclient.ccg
gio/src/socketconnection.ccg
gio/src/socketlistener.ccg
gio/src/unixconnection.ccg
gio/src/unixfdlist.ccg
gio/src/unixfdmessage.ccg
gio/src/volume.ccg
glib/glibmm/dispatcher.cc
glib/glibmm/error.cc
glib/glibmm/error.h
glib/glibmm/helperlist.h
glib/glibmm/main.cc
glib/glibmm/main.h
glib/glibmm/streamiochannel.cc
glib/src/date.ccg
glib/src/datetime.hg
glib/src/fileutils.ccg
glib/src/glib_docs.xml
glib/src/glib_functions.defs
glib/src/iochannel.ccg
glib/src/iochannel.hg
glib/src/optioncontext.ccg
glib/src/optiongroup.ccg
glib/src/regex.ccg
glib/src/regex.hg
glib/src/signalproxy.h.m4
glib/src/spawn.ccg
glib/src/thread.ccg
glib/src/threads.ccg
glib/src/valuearray.ccg
glib/src/variant.ccg
glib/src/variant.hg
glib/src/variant_basictypes.cc.m4
glib/src/varianttype.ccg
tests/giomm_asyncresult_sourceobject/main.cc
tests/giomm_ioerror/main.cc
tests/giomm_memoryinputstream/main.cc
tests/giomm_simple/main.cc
tests/giomm_tls_client/main.cc
tests/glibmm_btree/main.cc
tests/glibmm_interface_implementation/main.cc
tests/glibmm_mainloop/main.cc
tests/glibmm_valuearray/main.cc
tests/glibmm_variant/main.cc
tools/extra_defs_gen/generate_extra_defs.cc
tools/m4/class_boxedtype.m4
tools/m4/class_interface.m4
tools/m4/class_opaque_copyable.m4
tools/m4/class_opaque_refcounted.m4
tools/m4/class_shared.m4
tools/m4/method.m4
tools/m4/signal.m4
tools/m4/vfunc.m4
tools/pm/Output.pm

diff --git a/NEWS b/NEWS
index a98524d..808c91b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,24 @@
+2.45.31 (unstable):
+
+Glib:
+* HelperList: fix iterator check in operator[]
+  (Maks Naumov) Bug #751530.
+
+Build:
+* Use (and require) C++11.
+  (Murray Cumming, Kjell Ahlstedt)
+* Use some simple C++11 syntax.
+  (Murray Cumming)
+* Fix the build with -Wshadow.
+  (Murray Cumming)
+
+gmmproc:
+* Generate code that uses some simple C++11 syntax.
+  (Murray Cumming)
+* _WRAP_SIGNAL: Accept apostrophes in a preceding comment.
+  (Kjell Ahlstedt)
+
+
 2.45.3 (unstable):
 
 * Add SettingsSchema, SettingsSchemaKey and SettingsSchemaSource.
index 5712864..d1758b3 100644 (file)
@@ -15,7 +15,7 @@
 ## You should have received a copy of the GNU Lesser General Public License
 ## along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_INIT([glibmm], [2.45.3],
+AC_INIT([glibmm], [2.45.31],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=glibmm],
         [glibmm], [http://www.gtkmm.org/])
 AC_PREREQ([2.59])
@@ -30,7 +30,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 AM_MAINTAINER_MODE
 AC_ARG_VAR([ACLOCAL_FLAGS], [aclocal flags, e.g. -I <macro dir>])
 
-MM_PREREQ([0.9.7])
+MM_PREREQ([0.9.8])
 MM_INIT_MODULE([glibmm-2.4])
 MM_INIT_MODULE([giomm-2.4])
 
@@ -43,6 +43,8 @@ MM_CONFIG_DOCTOOL_DIR([docs])
 AC_SUBST([LIBGLIBMM_SO_VERSION], [4:0:3])
 
 AC_PROG_CXX
+MM_AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
+
 AC_DISABLE_STATIC
 LT_INIT([win32-dll])
 MM_PATH_PERL
@@ -114,7 +116,7 @@ GLIBMM_ARG_ENABLE_DEBUG_REFCOUNTING
 # Evaluate the --enable-warnings=level option.
 MM_ARG_ENABLE_WARNINGS([GLIBMM_WXXFLAGS],
                        [-Wall],
-                       [-pedantic -Wall -Wextra -Wformat-security -Wno-long-long],
+                       [-pedantic -Wall -Wextra -Wformat-security -Wsuggest-override -Wshadow -Wno-long-long],
                        [G SIGCXX])
 
 # Offer the ability to omit some API from the library,
index 3bbc368..010992e 100644 (file)
@@ -40,7 +40,7 @@ void ChildWatch::run()
 {
   GPid pid = fork();
   
-  if(pid==0)
+  if(!pid)
   {
     sleep(5);
     exit(0);
@@ -59,7 +59,7 @@ void ChildWatch::on_child_exited(GPid pid, int status)
 
 int main()
 {
-  Glib::RefPtr<Glib::MainLoop> mainLoop = Glib::MainLoop::create();
+  auto mainLoop = Glib::MainLoop::create();
   
   ChildWatch cwatch(mainLoop);
   cwatch.run();
index b46fdcf..7b9adad 100644 (file)
@@ -34,7 +34,7 @@ bool on_main_loop_idle()
 // method.
 void on_dbus_proxy_available(Glib::RefPtr<Gio::AsyncResult>& result)
 {
-  Glib::RefPtr<Gio::DBus::Proxy> proxy = Gio::DBus::Proxy::create_finish(result);
+  const auto proxy = Gio::DBus::Proxy::create_finish(result);
 
   if(!proxy)
   {
@@ -48,20 +48,20 @@ void on_dbus_proxy_available(Glib::RefPtr<Gio::AsyncResult>& result)
   {
     // The proxy's call method returns a tuple of the value(s) that the method
     // call produces so just get the tuple as a VariantContainerBase.
-    const Glib::VariantContainerBase result = proxy->call_sync("ListNames");
+    const auto call_result = proxy->call_sync("ListNames");
 
     // Now extract the single item in the variant container which is the
     // array of strings (the names).
-    Glib::Variant< std::vector<Glib::ustring> > names_variant;
-    result.get_child(names_variant);
+    Glib::Variant< std::vector<Glib::ustring>> names_variant;
+    call_result.get_child(names_variant);
 
     // Get the vector of strings.
-    std::vector<Glib::ustring> names = names_variant.get();
+    auto names = names_variant.get();
 
     std::cout << "The names on the message bus are:" << std::endl;
 
-    for(unsigned i = 0; i < names.size(); i++)
-      std::cout << names[i] << "." << std::endl;
+    for(const auto& i : names)
+      std::cout << i << "." << std::endl;
   }
   catch(const Glib::Error& error)
   {
@@ -81,7 +81,7 @@ int main(int, char**)
   loop = Glib::MainLoop::create();
 
   // Get the user session bus connection.
-  Glib::RefPtr<Gio::DBus::Connection> connection =
+  auto connection =
     Gio::DBus::Connection::get_sync(Gio::DBus::BUS_TYPE_SESSION);
 
   // Check for an unavailable connection.
index d50632d..6002c14 100644 (file)
@@ -68,7 +68,7 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& /* connect
     curr_time.assign_current_time();
 
     const Glib::ustring time_str = curr_time.as_iso8601();
-    const Glib::Variant<Glib::ustring> time_var =
+    const auto time_var =
       Glib::Variant<Glib::ustring>::create(time_str);
 
     // Create the tuple.
@@ -114,7 +114,7 @@ const Gio::DBus::InterfaceVTable interface_vtable(sigc::ptr_fun(&on_method_call)
 
 bool on_server_new_connection(const Glib::RefPtr<Gio::DBus::Connection>& connection)
 {
-  Glib::RefPtr<Gio::Credentials> credentials =
+  auto credentials =
     connection->get_peer_credentials();
 
   std::string credentials_str;
@@ -166,7 +166,7 @@ int main(int, char**)
   std::locale::global(std::locale(""));
   Gio::init();
 
- try
 try
   {
     introspection_data = Gio::DBus::NodeInfo::create_for_xml(introspection_xml);
   }
@@ -200,7 +200,7 @@ int main(int, char**)
   server->signal_new_connection().connect(sigc::ptr_fun(&on_server_new_connection));
 
   //Keep the server running until the process is killed:
-  Glib::RefPtr<Glib::MainLoop> loop = Glib::MainLoop::create();
+  auto loop = Glib::MainLoop::create();
   loop->run();
 
   return EXIT_SUCCESS;
index 0f0bd01..ed320b8 100644 (file)
@@ -66,7 +66,7 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& /* connect
     curr_time.assign_current_time();
 
     const Glib::ustring time_str = curr_time.as_iso8601();
-    const Glib::Variant<Glib::ustring> time_var =
+    const auto time_var =
       Glib::Variant<Glib::ustring>::create(time_str);
 
     // Create the tuple.
@@ -156,14 +156,14 @@ int main(int, char**)
     return 1;
   }
 
-  const guint id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION,
+  const auto id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION,
     "org.glibmm.DBusExample",
     sigc::ptr_fun(&on_bus_acquired),
     sigc::ptr_fun(&on_name_acquired),
     sigc::ptr_fun(&on_name_lost));
 
   //Keep the service running until the process is killed:
-  Glib::RefPtr<Glib::MainLoop> loop = Glib::MainLoop::create();
+  auto loop = Glib::MainLoop::create();
   loop->run();
 
   Gio::DBus::unown_name(id);
index be97676..3764546 100644 (file)
@@ -265,7 +265,8 @@ std::streamsize fdstreambuf::xsgetn(char* dest, std::streamsize num)
          *putback_buffer = *(gptr() - 1);
          putback_count = 2;
        }
-       else putback_count = 1;
+       else
+          putback_count = 1;
       }
 
       *(putback_buffer + 1) = *(dest + (chars_read - 1));
@@ -280,8 +281,8 @@ std::streamsize fdstreambuf::xsgetn(char* dest, std::streamsize num)
 }
 
 fdstream::fdstream(int fd, bool manage)
-: std::istream(0),
-  std::ostream(0),
+: std::istream(nullptr),
+  std::ostream(nullptr),
   buf(fd, manage)
 {
   std::istream::rdbuf(&buf);
@@ -289,8 +290,8 @@ fdstream::fdstream(int fd, bool manage)
 }
 
 fdstream::fdstream()
-: std::istream(0),
-  std::ostream(0)
+: std::istream(nullptr),
+  std::ostream(nullptr)
 {
   std::istream::rdbuf(&buf);
   std::ostream::rdbuf(&buf);
index aaebbdd..e2e670f 100644 (file)
@@ -81,7 +81,7 @@ int main( /* int argc, char *argv[] */)
     }
   }
  
-  int read_fd = open("testfifo", O_RDONLY);
+  const auto read_fd = open("testfifo", O_RDONLY);
   if(read_fd == -1)
   {
     std::cerr << "error opening fifo" << std::endl;
index 533bc53..33e9067 100644 (file)
@@ -66,10 +66,10 @@ int main(int, char**)
   // An exception will be thrown if the value is not in the file:
   try
   {
-    const std::vector<int> values = keyfile.get_integer_list("Another Group", "Numbers");
+    const auto values = keyfile.get_integer_list("Another Group", "Numbers");
 
-    for(std::vector<int>::const_iterator p = values.begin(); p != values.end(); ++p)
-      std::cout << "Number list value: item=" << *p << std::endl;
+    for(const auto& p : values)
+      std::cout << "Number list value: item=" << p << std::endl;
   }
   catch(const Glib::KeyFileError& ex)
   {
index 30423a6..b954a67 100644 (file)
@@ -26,7 +26,7 @@ namespace
 
 void file_get_contents(const std::string& filename, Glib::ustring& contents)
 {
-  const Glib::RefPtr<Glib::IOChannel> channel = Glib::IOChannel::create_from_file(filename, "r");
+  const auto channel = Glib::IOChannel::create_from_file(filename, "r");
   channel->read_to_end(contents);
 }
 
@@ -54,14 +54,14 @@ public:
   virtual ~DumpParser();
 
 protected:
-  virtual void on_start_element(Glib::Markup::ParseContext& context,
+  void on_start_element(Glib::Markup::ParseContext& context,
                                 const Glib::ustring&        element_name,
-                                const AttributeMap&         attributes);
+                                const AttributeMap&         attributes) override;
 
-  virtual void on_end_element(Glib::Markup::ParseContext& context,
-                              const Glib::ustring& element_name);
+  void on_end_element(Glib::Markup::ParseContext& context,
+                              const Glib::ustring& element_name) override;
 
-  virtual void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text);
+  void on_text(Glib::Markup::ParseContext& context, const Glib::ustring& text) override;
 
 private:
   int parse_depth_;
@@ -84,9 +84,9 @@ void DumpParser::on_start_element(Glib::Markup::ParseContext&,
   indent();
   std::cout << '<' << element_name;
 
-  for(AttributeMap::const_iterator p = attributes.begin(); p != attributes.end(); ++p)
+  for(const auto& p : attributes)
   {
-    std::cout << ' ' << p->first << "=\"" << p->second << '"';
+    std::cout << ' ' << p.first << "=\"" << p.second << '"';
   }
 
   std::cout << ">\n";
index 4112c14..42f36a6 100644 (file)
@@ -91,14 +91,13 @@ print_resolved_name (const Glib::ustring& phys,
 
 static void
 print_resolved_addresses (const Glib::ustring& name,
-                          const std::list<Glib::RefPtr<Gio::InetAddress> >& addresses)
+                          const std::list<Glib::RefPtr<Gio::InetAddress>>& addresses)
 {
     G_LOCK (response);
     std::cout << Glib::ustring::compose ("Name:    %1\n", name);
-    for (std::list<Glib::RefPtr<Gio::InetAddress> >::const_iterator iter = addresses.begin ();
-         iter != addresses.end (); ++iter)
+    for (const auto& i : addresses)
     {
-        std::cout << Glib::ustring::compose ("Address: %1\n", (*iter)->to_string ());
+        std::cout << Glib::ustring::compose ("Address: %1\n", i->to_string ());
     }
     std::cout << std::endl;
 
@@ -112,15 +111,14 @@ print_resolved_service (const Glib::ustring& service,
 {
     G_LOCK (response);
     std::cout << Glib::ustring::compose ("Service: %1\n", service);
-    for (std::list<Gio::SrvTarget>::const_iterator iter = targets.begin ();
-         iter != targets.end (); ++iter)
+    for (const auto& i : targets)
     {
         std::cout <<
             Glib::ustring::compose ("%1:%2 (pri %3, weight %4)\n",
-                                    iter->get_hostname (),
-                                    iter->get_port (),
-                                    iter->get_priority (),
-                                    iter->get_weight ());
+                                    i.get_hostname (),
+                                    i.get_port (),
+                                    i.get_priority (),
+                                    i.get_weight ());
     }
     std::cout << std::endl;
 
@@ -152,9 +150,8 @@ lookup_one_sync (const Glib::ustring& arg)
 {
     if (arg.find ('/') != std::string::npos)
     {
-        std::list<Gio::SrvTarget> targets;
         /* service/protocol/domain */
-        std::vector<Glib::ustring> parts = split_service_parts (arg);
+        const auto parts = split_service_parts (arg);
         if (parts.size () != 3) {
             usage ();
             return;
@@ -162,7 +159,7 @@ lookup_one_sync (const Glib::ustring& arg)
 
         try
         {
-            targets = resolver->lookup_service (parts[0], parts[1], parts[2],
+            const auto targets = resolver->lookup_service (parts[0], parts[1], parts[2],
                                                 cancellable);
             print_resolved_service (arg, targets);
         }
@@ -173,7 +170,7 @@ lookup_one_sync (const Glib::ustring& arg)
     }
     else if (Gio::hostname_is_ip_address (arg))
     {
-        Glib::RefPtr<Gio::InetAddress> addr = Gio::InetAddress::create (arg);
+        auto addr = Gio::InetAddress::create (arg);
         try
         {
             Glib::ustring name = resolver->lookup_by_address (addr, cancellable);
@@ -209,13 +206,11 @@ lookup_thread (const Glib::ustring& arg)
 static void
 start_threaded_lookups (char **argv, int argc)
 {
-    int i;
-
-    for (i = 0; i < argc; i++)
-    {
-        Glib::Threads::Thread::create (sigc::bind (sigc::ptr_fun (lookup_thread),
-                                          argv[i]));
-    }
+  for (auto i = 0; i < argc; i++)
+  {
+    Glib::Threads::Thread::create (sigc::bind (sigc::ptr_fun (lookup_thread),
+      argv[i]));
+   }
 }
 
 static void
@@ -265,13 +260,13 @@ lookup_service_callback (Glib::RefPtr<Gio::AsyncResult> result,
 static void
 start_async_lookups (char **argv, int argc)
 {
-    for (int i = 0; i < argc; i++)
+    for (auto i = 0; i < argc; i++)
     {
         Glib::ustring arg (argv[i]);
         if (arg.find ('/') != std::string::npos)
         {
             /* service/protocol/domain */
-            std::vector<Glib::ustring> parts = split_service_parts (arg);
+            auto parts = split_service_parts (arg);
             if (parts.size () != 3) {
                 usage ();
                 return;
@@ -286,7 +281,7 @@ start_async_lookups (char **argv, int argc)
         }
         else if (Gio::hostname_is_ip_address (argv[i]))
         {
-            Glib::RefPtr<Gio::InetAddress> addr = Gio::InetAddress::create (argv[i]);
+            auto addr = Gio::InetAddress::create (argv[i]);
 
             resolver->lookup_by_address_async (addr,
                                                sigc::bind (sigc::ptr_fun
@@ -312,7 +307,7 @@ static void
 print_connectable_sockaddr (Glib::RefPtr<Gio::SocketAddress> sockaddr)
 {
     Glib::ustring phys;
-    Glib::RefPtr<Gio::InetSocketAddress> isa =
+    auto isa =
         Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic (sockaddr);
 
     if (!isa)
@@ -351,7 +346,7 @@ got_next_async (Glib::RefPtr<Gio::AsyncResult> result,
 {
     try
     {
-        Glib::RefPtr<Gio::SocketAddress> sockaddr = enumerator->next_finish (result);
+        const auto sockaddr = enumerator->next_finish (result);
         if (sockaddr)
         {
             print_connectable_sockaddr (sockaddr);
@@ -384,7 +379,6 @@ do_connectable (const std::string& arg, gboolean synchronous)
 {
     std::vector<Glib::ustring> parts;
     Glib::RefPtr<Gio::SocketConnectable> connectable;
-    Glib::RefPtr<Gio::SocketAddressEnumerator> enumerator;
 
     if (arg.find ('/') != std::string::npos)
     {
@@ -402,27 +396,26 @@ do_connectable (const std::string& arg, gboolean synchronous)
         std::string host, port_str;
         guint16 port;
 
-        std::size_t pos = arg.find (':');
+        const auto pos = arg.find (':');
         if (pos != std::string::npos)
         {
             host = arg.substr (0, pos);
             port_str = arg.substr(pos);
-            port = strtoul (port_str.c_str (), NULL, 10);
+            port = strtoul (port_str.c_str (), nullptr, 10);
         }
         else
             port = 0;
 
         if (Gio::hostname_is_ip_address (host))
         {
-            Glib::RefPtr<Gio::InetAddress> addr = Gio::InetAddress::create (host);
+            const auto addr = Gio::InetAddress::create (host);
             connectable = Gio::InetSocketAddress::create (addr, port);
         }
         else
             connectable = Gio::NetworkAddress::create (arg, port);
     }
 
-    enumerator = connectable->enumerate ();
-
+    const auto enumerator = connectable->enumerate ();
     if (synchronous)
         do_sync_connectable (enumerator);
     else
@@ -442,9 +435,9 @@ interrupted (int /*sig*/)
 }
 
 static bool
-async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr<Gio::Cancellable> cancellable)
+async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr<Gio::Cancellable> the_cancellable)
 {
-    cancellable->cancel ();
+    the_cancellable->cancel ();
     return false;
 }
 #endif
@@ -452,8 +445,8 @@ async_cancel (Glib::IOCondition /*cond*/, Glib::RefPtr<Gio::Cancellable> cancell
 int
 main (int argc, char **argv)
 {
-    bool synchronous = false;
-    bool use_connectable = false;
+    auto synchronous = false;
+    auto use_connectable = false;
 #ifdef G_OS_UNIX
     Glib::RefPtr<Glib::IOChannel> chan;
     sigc::connection watch_conn;
@@ -497,7 +490,7 @@ main (int argc, char **argv)
     signal (SIGINT, interrupted);
 
     chan = Glib::IOChannel::create_from_fd (cancel_fds[0]);
-    Glib::RefPtr<Glib::IOSource> source = chan->create_watch (Glib::IO_IN);
+    const auto source = chan->create_watch (Glib::IO_IN);
     watch_conn = source->connect (sigc::bind (sigc::ptr_fun (async_cancel), cancellable));
 #endif
 
index c7df51e..44fd94c 100644 (file)
@@ -61,7 +61,7 @@ socket_address_to_string (const Glib::RefPtr<Gio::SocketAddress>& address)
     Glib::ustring str, res;
     int port;
 
-    Glib::RefPtr<Gio::InetSocketAddress> isockaddr =
+    auto isockaddr =
         Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic (address);
     if (!isockaddr)
         return Glib::ustring ();
@@ -90,7 +90,7 @@ ensure_condition (const Glib::RefPtr<Gio::Socket>& socket,
 
     if (use_source)
     {
-      Glib::RefPtr<Gio::SocketSource> source = socket->create_source(condition, cancellable);
+      auto source = socket->create_source(condition, cancellable);
       source->connect(sigc::ptr_fun(&source_ready));
       source->attach();
       loop->run();
@@ -154,7 +154,7 @@ main (int argc,
 
     if (argc != 2)
     {
-        const char* error_message = "Need to specify hostname";
+        const auto error_message = "Need to specify hostname";
         std::cerr << Glib::ustring::compose ("%1: %2\n", argv[0], error_message);
         return 1;
     }
index b9e1a83..897c5d1 100644 (file)
@@ -68,19 +68,16 @@ public:
 Glib::ustring
 socket_address_to_string (const Glib::RefPtr<Gio::SocketAddress>& address)
 {
-    Glib::RefPtr<Gio::InetAddress> inet_address;
-    Glib::ustring str, res;
-    int port;
-
-    Glib::RefPtr<Gio::InetSocketAddress> isockaddr =
-        Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic (address);
-    if (!isockaddr)
-        return Glib::ustring ();
-    inet_address = isockaddr->get_address ();
-    str = inet_address->to_string ();
-    port = isockaddr->get_port ();
-    res = Glib::ustring::compose ("%1:%2", str, port);
-    return res;
+  auto isockaddr =
+      Glib::RefPtr<Gio::InetSocketAddress>::cast_dynamic (address);
+  if (!isockaddr)
+      return Glib::ustring ();
+
+  auto inet_address = isockaddr->get_address ();
+  auto str = inet_address->to_string ();
+  auto the_port = isockaddr->get_port ();
+  auto res = Glib::ustring::compose ("%1:%2", str, the_port);
+  return res;
 }
 
 static bool
@@ -132,10 +129,7 @@ main (int argc,
       char *argv[])
 {
     Glib::RefPtr<Gio::Socket> socket, new_socket, recv_socket;
-    Glib::RefPtr<Gio::SocketAddress> src_address;
     Glib::RefPtr<Gio::SocketAddress> address;
-    Gio::SocketType socket_type;
-    Gio::SocketFamily socket_family;
     Glib::RefPtr<Gio::Cancellable> cancellable;
 
     Gio::init ();
@@ -161,8 +155,8 @@ main (int argc,
 
     loop = Glib::MainLoop::create ();
 
-    socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM;
-    socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4;
+    auto socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM;
+    auto socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4;
 
     try {
         socket = Gio::Socket::create (socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT);
@@ -175,7 +169,7 @@ main (int argc,
     if (non_blocking)
         socket->set_blocking (false);
 
-    src_address = Gio::InetSocketAddress::create (Gio::InetAddress::create_any (socket_family), port);
+    auto src_address = Gio::InetSocketAddress::create (Gio::InetAddress::create_any (socket_family), port);
     try {
         socket->bind (src_address, !dont_reuse_address);
     } catch (const Gio::Error& error) {
@@ -234,7 +228,6 @@ main (int argc,
     {
         gchar buffer[4096] = { };
         gssize size;
-        gsize to_send;
 
         ensure_condition (recv_socket, "receive", cancellable, Glib::IO_IN);
         try {
@@ -266,7 +259,7 @@ main (int argc,
                      "-------------------------\n",
                      (int)size, buffer);
 
-        to_send = size;
+        auto to_send = size;
 
         while (to_send > 0)
         {
index 1ef290b..fcda4a9 100644 (file)
@@ -25,15 +25,17 @@ class ExampleOptionGroup : public Glib::OptionGroup
 public:
   ExampleOptionGroup();
 
-  virtual bool on_pre_parse(Glib::OptionContext& context, Glib::OptionGroup& group);
-  virtual bool on_post_parse(Glib::OptionContext& context, Glib::OptionGroup& group);
-  virtual void on_error(Glib::OptionContext& context, Glib::OptionGroup& group);
+private:
+  bool on_pre_parse(Glib::OptionContext& context, Glib::OptionGroup& group) override;
+  bool on_post_parse(Glib::OptionContext& context, Glib::OptionGroup& group) override;
+  void on_error(Glib::OptionContext& context, Glib::OptionGroup& group) override;
 
   bool on_option_arg_string(const Glib::ustring& option_name,
     const Glib::ustring& value, bool has_value);
   bool on_option_arg_filename(const Glib::ustring& option_name,
     const std::string& value, bool has_value);
 
+public:
   //These members should live as long as the OptionGroup to which they are added, 
   //and as long as the OptionContext to which that OptionGroup is added.
   int m_arg_foo;
@@ -221,17 +223,18 @@ int main(int argc, char** argv)
     
   //This one shows the results of multiple instance of the same option, such as --list=1 --list=a --list=b
   std::cout << "  list = ";
-  for(Glib::OptionGroup::vecustrings::const_iterator iter = group.m_arg_list.begin(); iter != group.m_arg_list.end(); ++iter)
+  for(const auto& i : group.m_arg_list)
+
   {
-    std::cout << *iter << ", ";
+    std::cout << i << ", ";
   }
   std::cout << std::endl;
 
   //This one shows the remaining arguments on the command line, which had no name= form:
   std::cout << "  remaining = ";
-  for(Glib::OptionGroup::vecustrings::const_iterator iter = group.m_remaining_list.begin(); iter != group.m_remaining_list.end(); ++iter)
+  for(const auto& i : group.m_remaining_list)
   {
-    std::cout << *iter << ", ";
+    std::cout << i << ", ";
   }
   std::cout << std::endl;
  
index cc128ab..ed6ac56 100644 (file)
@@ -24,7 +24,7 @@ int main(int, char**)
   Glib::init();
 
   /* Reusing one regex pattern: */
-  Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create("(a)?(b)");
+  const auto regex = Glib::Regex::create("(a)?(b)");
   std::cout << "Pattern=" << regex->get_pattern() 
      << ", with string=abcd, result=" 
      << std::boolalpha << regex->match("abcd")
index bbf1c19..84df7a0 100644 (file)
@@ -75,7 +75,7 @@ int main(int, char**)
   Glib::setenv("GSETTINGS_SCHEMA_DIR", ".", true);
   Glib::setenv("GSETTINGS_BACKEND", "memory", true);
 
-  const Glib::RefPtr<Gio::Settings> settings =
+  const auto settings =
     Gio::Settings::create("org.gtkmm.demo");
 
   settings->signal_changed().connect(sigc::bind(sigc::ptr_fun(&on_key_changed), settings));
index 21833e7..e58cb22 100644 (file)
@@ -29,7 +29,7 @@ namespace
 class ThreadProgress
 {
 public:
-  explicit ThreadProgress(int id);
+  explicit ThreadProgress(int the_id);
   virtual ~ThreadProgress();
 
   int  id() const;
@@ -78,10 +78,10 @@ public:
   void operator()(T ptr) const { delete ptr; }
 };
 
-ThreadProgress::ThreadProgress(int id)
+ThreadProgress::ThreadProgress(int the_id)
 :
-  thread_   (0),
-  id_       (id),
+  thread_   (nullptr),
+  id_       (the_id),
   progress_ (0)
 {
   // Connect to the cross-thread signal.
@@ -91,7 +91,7 @@ ThreadProgress::ThreadProgress(int id)
 ThreadProgress::~ThreadProgress()
 {
   // It is an error if the thread is still running at this point.
-  g_return_if_fail(thread_ == 0);
+  g_return_if_fail(thread_ == nullptr);
 }
 
 int ThreadProgress::id() const
@@ -134,7 +134,7 @@ void ThreadProgress::thread_function()
 {
   Glib::Rand rand;
 
-  for (int i = 0; i < ITERATIONS; ++i)
+  for (auto i = 0; i < ITERATIONS; ++i)
   {
     Glib::usleep(rand.get_int_range(2000, 20000));
 
index dd7d7de..cd0faf2 100644 (file)
@@ -77,7 +77,7 @@ ThreadTimer::ThreadTimer()
   // Create a new Glib::Dispatcher that is attached to the default main context,
   signal_increment_ (),
   // This pointer will be initialized later by the 2nd thread.
-  signal_finished_ptr_ (NULL)
+  signal_finished_ptr_ (nullptr)
 {
   // Connect the cross-thread signal.
   signal_increment_.connect(sigc::mem_fun(*this, &ThreadTimer::timer_increment));
@@ -99,7 +99,7 @@ void ThreadTimer::launch()
       sigc::mem_fun(*this, &ThreadTimer::thread_function));
 
   // Wait for the 2nd thread's startup notification.
-  while(signal_finished_ptr_ == NULL)
+  while(!signal_finished_ptr_)
     startup_cond_.wait(startup_mutex_);
 }
 
@@ -109,10 +109,10 @@ void ThreadTimer::signal_finished_emit()
   signal_finished_ptr_->emit();
 
   // wait for the thread to join
-  if(thread_ != NULL)
+  if(thread_)
     thread_->join();
 
-  signal_finished_ptr_ = NULL;
+  signal_finished_ptr_ = nullptr;
 }
 
 void ThreadTimer::print() const
@@ -156,9 +156,9 @@ bool ThreadTimer::timeout_handler()
 void ThreadTimer::thread_function()
 {
   // create a new Main Context
-  Glib::RefPtr<Glib::MainContext> context = Glib::MainContext::create();
+  auto context = Glib::MainContext::create();
   // create a new Main Loop
-  Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create(context, true);
+  auto mainloop = Glib::MainLoop::create(context, true);
 
   // attach a timeout handler, that is called every second, to the
   // newly created MainContext
@@ -189,7 +189,7 @@ ThreadTimer::type_signal_end ThreadTimer::signal_end_;
 
 ThreadDispatcher::ThreadDispatcher()
 : 
-  timer_ (NULL)
+  timer_ (nullptr)
 {
   std::cout << "Thread Dispatcher Example #2" << std::endl;
 
index ad7cfeb..6fb546c 100644 (file)
@@ -36,7 +36,7 @@ void MessageQueue::producer()
 {
   Glib::Rand rand (1234);
 
-  for(int i = 0; i < 200; ++i)
+  for(auto i = 0; i < 200; ++i)
   {
     {
       Glib::Threads::Mutex::Lock lock (mutex_);
index 632a77a..557997f 100644 (file)
@@ -15,7 +15,7 @@ void print_char(char c)
 {
   Glib::Rand rand;
 
-  for(int i = 0; i < 100; ++i)
+  for(auto i = 0; i < 100; ++i)
   {
     {
       Glib::Threads::Mutex::Lock lock (mutex);
@@ -33,7 +33,7 @@ int main(int, char**)
 {
   Glib::ThreadPool pool (10);
 
-  for(char c = 'a'; c <= 'z'; ++c)
+  for(auto c = 'a'; c <= 'z'; ++c)
   {
     pool.push(sigc::bind<1>(sigc::ptr_fun(&print_char), c));
   }
index a01a487..74efd24 100644 (file)
@@ -50,7 +50,7 @@ Glib::ustring content_type_get_mime_type(const Glib::ustring& type)
 
 Glib::RefPtr<Gio::Icon> content_type_get_icon(const Glib::ustring& type)
 {
Glib::RefPtr<Icon> retvalue = Glib::wrap(g_content_type_get_icon(type.c_str()));
auto retvalue = Glib::wrap(g_content_type_get_icon(type.c_str()));
   if(retvalue)
     retvalue->reference(); //The function does not do a ref for us.
   return retvalue;
@@ -59,7 +59,7 @@ Glib::RefPtr<Gio::Icon> content_type_get_icon(const Glib::ustring& type)
 #ifdef G_OS_UNIX
 Glib::RefPtr<Gio::Icon> content_type_get_symbolic_icon(const Glib::ustring& type)
 {
-  Glib::RefPtr<Icon> retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str()));
+  auto retvalue = Glib::wrap(g_content_type_get_symbolic_icon(type.c_str()));
   if(retvalue)
     retvalue->reference(); //The function does not do a ref for us.
   return retvalue;
index 8db82bc..31f9077 100644 (file)
@@ -31,7 +31,7 @@ SignalProxy_async_callback(GObject*, GAsyncResult* res, void* data)
 
   try
   {
-    Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */);
+    auto result = Glib::wrap(res, true /* take copy */);
     (*the_slot)(result);
   }
   catch(...)
index a86ed88..77bec40 100644 (file)
@@ -45,7 +45,7 @@ public:
    * is equivalent to:
    * @code
    * bool io_handler(Glib::IOCondition io_condition) { ... }
-   * const Glib::RefPtr<Gio::SocketSource> socket_source = Gio::SocketSource::create(socket, Glib::IO_IN | Glib::IO_OUT);
+   * const auto socket_source = Gio::SocketSource::create(socket, Glib::IO_IN | Glib::IO_OUT);
    * socket_source->connect(sigc::ptr_fun(&io_handler));
    * socket_source->attach(Glib::MainContext::get_default());
    * @endcode
index eca9812..1b10876 100644 (file)
@@ -243,8 +243,8 @@ void Action::get_state(T_Value& value) const
   g_return_if_fail(
     g_variant_type_equal(g_action_get_state_type(const_cast<GAction*>(gobj())), type_glib_variant::variant_type().gobj()));
 
-  const Glib::VariantBase variantBase = get_state_variant();
-  const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
+  const auto variantBase = get_state_variant();
+  const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
   value = variantDerived.get();
 }
 
@@ -255,13 +255,13 @@ void Action::get_state_hint(T_Value& value) const
 
   typedef Glib::Variant<T_Value> type_glib_variant;
 
-  const Glib::VariantBase variantBase = get_state_hint_variant();
+  const auto variantBase = get_state_hint_variant();
 
   // We can't check the type (a range) that will be returned before getting the range hint.
   g_return_if_fail(
     variantBase.is_of_type(type_glib_variant::variant_type()) );
 
-  const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
+  const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
   value = variantDerived.get();
 }
 
index 71385be..a1d5d33 100644 (file)
@@ -169,10 +169,10 @@ void ActionGroup::get_action_state(const Glib::ustring& action_name, T_Value& va
   g_return_if_fail(
     g_variant_type_equal(g_action_group_get_action_state_type(const_cast<GActionGroup*>(gobj()), action_name.c_str()), type_glib_variant::variant_type().gobj()));
 
-  const Glib::VariantBase variantBase = get_action_state_variant(action_name);
+  const auto variantBase = get_action_state_variant(action_name);
 
   //TODO: Add a bool return instead of letting a std::bad_cast from the cast_dynamic() be thrown up to the caller?
-  const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
+  const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
   value = variantDerived.get();
 }
 
@@ -183,13 +183,13 @@ void ActionGroup::get_action_state_hint(const Glib::ustring& action_name, T_Valu
 
   typedef Glib::Variant<T_Value> type_glib_variant;
 
-  const Glib::VariantBase variantBase = get_action_state_hint_variant(action_name);
+  const auto variantBase = get_action_state_hint_variant(action_name);
 
   // We can't check the type (a range) that will be returned before getting the range hint.
   g_return_if_fail(
     variantBase.is_of_type(type_glib_variant::variant_type()) );
 
-  const type_glib_variant variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
+  const auto variantDerived = variantBase.cast_dynamic<type_glib_variant>(variantBase);
   value = variantDerived.get();
 }
 
index 432b65f..20194d4 100644 (file)
@@ -25,21 +25,21 @@ namespace Gio
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name)
 {
-  Glib::RefPtr<SimpleAction> action = SimpleAction::create(name);
+  auto action = SimpleAction::create(name);
   add_action(action);
   return action;
 }
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action_with_parameter(const Glib::ustring& name, const ActivateWithParameterSlot& slot)
 {
-  Glib::RefPtr<SimpleAction> action = add_action(name);
+  auto action = add_action(name);
   action->signal_activate().connect(slot);
   return action;
 }
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name, const ActivateSlot& slot)
 {
-  Glib::RefPtr<SimpleAction> action = add_action(name);
+  auto action = add_action(name);
   action->signal_activate().connect(
     sigc::hide(slot));
   return action;
@@ -48,7 +48,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action(const Glib::ustring& name, cons
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, bool state)
 {
-  Glib::RefPtr<SimpleAction> action = SimpleAction::create_bool(name, state);
+  auto action = SimpleAction::create_bool(name, state);
   add_action(action);
   return action;
 }
@@ -56,7 +56,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name,
 //TODO: Use a slot that takes a bool?
 Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name, const ActivateSlot& slot, bool state)
 {
-  Glib::RefPtr<SimpleAction> action = add_action_bool(name, state);
+  auto action = add_action_bool(name, state);
   action->signal_activate().connect(
     sigc::hide(slot));
   return action;
@@ -65,7 +65,7 @@ Glib::RefPtr<SimpleAction> ActionMap::add_action_bool(const Glib::ustring& name,
 //TODO: Use a slot that takes a string?
 Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const Glib::ustring& state)
 {
-  Glib::RefPtr<SimpleAction> action = SimpleAction::create_radio_string(name, state);
+  auto action = SimpleAction::create_radio_string(name, state);
   add_action(action);
   return action;
 }
@@ -77,9 +77,9 @@ namespace {
 static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithStringParameterSlot& slot)
 {
   //TODO: This syntax is odd:
-  const Glib::Variant<Glib::ustring> variantDerived =
+  const auto variantDerived =
     parameter.cast_dynamic< Glib::Variant<Glib::ustring> >(parameter);
-  const Glib::ustring str = variantDerived.get();
+  const auto str = variantDerived.get();
   slot(str);
 }
 
@@ -87,7 +87,7 @@ static void on_action_radio_string(const Glib::VariantBase& parameter, const Gio
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_string(const Glib::ustring& name, const ActivateWithStringParameterSlot& slot, const Glib::ustring& state)
 {
-  Glib::RefPtr<SimpleAction> action = add_action_radio_string(name, state);
+  auto action = add_action_radio_string(name, state);
   action->signal_activate().connect(
     sigc::bind(sigc::ptr_fun(&on_action_radio_string), slot));
   return action;
@@ -99,9 +99,9 @@ namespace {
 static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::ActionMap::ActivateWithIntParameterSlot& slot)
 {
   //TODO: This syntax is odd:
-  const Glib::Variant<int> variantDerived =
+  const auto variantDerived =
     parameter.cast_dynamic< Glib::Variant<int> >(parameter);
-  const int str = variantDerived.get();
+  const auto str = variantDerived.get();
   slot(str);
 }
 
@@ -110,14 +110,14 @@ static void on_action_radio_int(const Glib::VariantBase& parameter, const Gio::A
 //TODO: Use a slot that takes an integer?
 Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, gint32 state)
 {
-  Glib::RefPtr<SimpleAction> action = SimpleAction::create_radio_integer(name, state);
+  auto action = SimpleAction::create_radio_integer(name, state);
   add_action(action);
   return action;
 }
 
 Glib::RefPtr<SimpleAction> ActionMap::add_action_radio_integer(const Glib::ustring& name, const ActivateWithIntParameterSlot& slot, gint32 state)
 {
-  Glib::RefPtr<SimpleAction> action = add_action_radio_integer(name, state);
+  auto action = add_action_radio_integer(name, state);
   action->signal_activate().connect(
     sigc::bind(sigc::ptr_fun(&on_action_radio_int), slot));
   return action;
index 1952aba..3eccdda 100644 (file)
@@ -39,11 +39,9 @@ struct ExtraApplicationData
 
   ~ExtraApplicationData()
   {
-    for (std::vector<gchar*>::iterator iter = option_entry_strings.begin();
-         iter != option_entry_strings.end(); ++iter)
+    for(auto str : option_entry_strings)
     {
-      g_free(*iter);
-      *iter = 0;
+      g_free(str);
     }
   }
 };
@@ -68,14 +66,14 @@ static void Application_signal_open_callback(GApplication* self, GFile** files,
     vec_files[i] = Glib::wrap(files[i], true);
   }
 
-  const Glib::ustring hint_str = (hint ? hint : Glib::ustring());
+  const auto hint_str = (hint ? hint : Glib::ustring());
 
   // Do not try to call a signal on a disassociated wrapper.
   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
   {
     try
     {
-      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data)) {
+      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data)) {
         (*static_cast<SlotType*>(slot))(vec_files, hint_str);
         return;
       }
@@ -101,14 +99,14 @@ static void Application_signal_open_notify_callback(GApplication* self, GFile**
     vec_files[i] = Glib::wrap(files[i], true);
   }
 
-  const Glib::ustring hint_str = (hint ? hint : Glib::ustring());
+  const auto hint_str = (hint ? hint : Glib::ustring());
 
   // Do not try to call a signal on a disassociated wrapper.
   if(Glib::ObjectBase::_get_current_wrapper((GObject*) self))
   {
     try
     {
-      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot(data))
+      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
       {
         (*static_cast<SlotType*>(slot))(vec_files, hint_str);
         return;
@@ -202,13 +200,13 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar*
   if (option_name[1] == '-')
   {
     // Long option name.
-    const Glib::ustring long_option_name = Glib::ustring(option_name+2);
+    const auto long_option_name = Glib::ustring(option_name+2);
     iterFind = option_arg_callback_data.find(long_option_name);
   }
   else
   {
     // Short option name.
-    const gchar short_option_name = option_name[1];
+    const auto short_option_name = option_name[1];
     for (iterFind = option_arg_callback_data.begin();
          iterFind != option_arg_callback_data.end(); ++iterFind)
     {
@@ -230,14 +228,14 @@ gboolean Application_option_arg_callback(const gchar* option_name, const gchar*
   {
     if (option_arg->is_filename_option())
     {
-      const Glib::OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename();
+      const auto the_slot = option_arg->get_slot_filename();
       lock.release();
       const std::string cpp_value(value ? value : "");
       return (*the_slot)(cpp_option_name, cpp_value, has_value);
     }
     else
     {
-      const Glib::OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string();
+      const auto the_slot = option_arg->get_slot_string();
       lock.release();
       const Glib::ustring cpp_value(value ? value : "");
       return (*the_slot)(cpp_option_name, cpp_value, has_value);
@@ -303,7 +301,7 @@ void Application::unset_default()
 void Application_Class::open_callback(GApplication* self, GFile** files,
   gint n_files, const gchar *hint)
 {
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+  const auto obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
   // Non-gtkmmproc-generated custom classes implicitly call the default
@@ -314,7 +312,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files,
 
   if(obj_base && obj_base->is_derived_())
   {
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
     if(obj) // This can be NULL during destruction.
     {
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
@@ -325,7 +323,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files,
           vec_files[i] = Glib::wrap(files[i], true);
         }
 
-        const Glib::ustring hint_str = (hint ? hint : Glib::ustring());
+        const auto hint_str = (hint ? hint : Glib::ustring());
 
         obj->on_open(vec_files, hint_str);
         return;
@@ -337,7 +335,7 @@ void Application_Class::open_callback(GApplication* self, GFile** files,
     }
   }
 
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
     g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
     );
 
@@ -353,7 +351,7 @@ Glib::SignalProxy2< void, const Application::type_vec_files&, const Glib::ustrin
 
 void Gio::Application::on_open(const Application::type_vec_files& files, const Glib::ustring& hint)
 {
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
       g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class (The original underlying C class).
   );
 
@@ -397,7 +395,7 @@ void Application::add_main_option_entry(
   if (iterFind != option_arg_callback_data.end())
     return; // Ignore duplicates
 
-  OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot);
+  auto callback_data = new OptionArgCallbackData(this, short_name, slot);
   option_arg_callback_data[long_name] = callback_data;
   lock.release();
 
@@ -415,7 +413,7 @@ void Application::add_main_option_entry_filename(
   if (iterFind != option_arg_callback_data.end())
     return; // Ignore duplicates
 
-  OptionArgCallbackData* callback_data = new OptionArgCallbackData(this, short_name, slot);
+  auto callback_data = new OptionArgCallbackData(this, short_name, slot);
   option_arg_callback_data[long_name] = callback_data;
   lock.release();
 
index 39d3f02..3867ef0 100644 (file)
@@ -30,7 +30,7 @@ void AsyncInitable::init_async(const SlotAsyncReady& slot,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_async_initable_init_async(gobj(), io_priority, Glib::unwrap(cancellable),
     &SignalProxy_async_callback, slot_copy);
@@ -41,7 +41,7 @@ void AsyncInitable::init_async(const SlotAsyncReady& slot, int io_priority)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_async_initable_init_async(gobj(), io_priority, 0,
     &SignalProxy_async_callback, slot_copy);
@@ -51,7 +51,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self,
   int io_priority, GCancellable* cancellable, GAsyncReadyCallback callback,
   gpointer user_data)
 {
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+  const auto obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
   // Non-gtkmmproc-generated custom classes implicitly call the default
@@ -61,7 +61,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self,
   // being overridden:
   if(obj_base && obj_base->is_derived_())
   {
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
     if(obj) // This can be NULL during destruction.
     {
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
@@ -82,7 +82,7 @@ void AsyncInitable_Class::init_async_vfunc_callback(GAsyncInitable* self,
     }
   }
 
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
 )  );
@@ -95,7 +95,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge
 void Gio::AsyncInitable::init_async_vfunc(const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable, int io_priority)
 {
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
 )  );
@@ -110,7 +110,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) /
 gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self,
   GAsyncResult* res, GError** error)
 {
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+  const auto obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper((GObject*)self));
 
   // Non-gtkmmproc-generated custom classes implicitly call the default
@@ -120,7 +120,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self,
   // being overridden:
   if(obj_base && obj_base->is_derived_())
   {
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
     if(obj) // This can be NULL during destruction.
     {
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
@@ -135,7 +135,7 @@ gboolean AsyncInitable_Class::init_finish_vfunc_callback(GAsyncInitable* self,
     }
   }
 
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
 g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Get the interface.
 )  );
@@ -150,7 +150,7 @@ g_type_interface_peek(G_OBJECT_GET_CLASS(self), CppObjectType::get_type()) // Ge
 }
 bool Gio::AsyncInitable::init_finish_vfunc(const Glib::RefPtr<AsyncResult>& res)
 {
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
       g_type_interface_peek_parent( // Get the parent interface of the interface (The original underlying C interface).
 g_type_interface_peek(G_OBJECT_GET_CLASS(gobject_), CppObjectType::get_type()) // Get the interface.
 )  );
index 9697606..b336f18 100644 (file)
@@ -31,8 +31,8 @@ static GObject* unwrap_objectbase_custom(const Glib::RefPtr<Glib::ObjectBase>& c
 
 Glib::RefPtr<Glib::ObjectBase> AsyncResult::get_source_object_base()
 {
-  GObject* cobj = g_async_result_get_source_object(gobj());
-  ObjectBase* cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj);
+  auto cobj = g_async_result_get_source_object(gobj());
+  auto cppobj = Glib::wrap_auto(cobj); //ObjectBase::_get_current_wrapper(cobj);
   return Glib::RefPtr<Glib::ObjectBase>(cppobj); //g_async_result_get_source_object() gives us a ref, unusually.
   //TODO: For some reason this fails: Glib::wrap(cobj);
 }
index b015f9a..af74ea9 100644 (file)
@@ -36,7 +36,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-    SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+    auto slot_copy = new SlotAsyncReady(slot);
 
     g_buffered_input_stream_fill_async(gobj(),
             count,
@@ -53,7 +53,7 @@ void BufferedInputStream::fill_async(const SlotAsyncReady& slot,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-    SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+    auto slot_copy = new SlotAsyncReady(slot);
 
     g_buffered_input_stream_fill_async(gobj(),
             count,
index a266e7e..787990e 100644 (file)
@@ -43,7 +43,7 @@ void slot_cancelled_proxy(GCancellable * /*cancellable*/, gpointer data)
 gulong
 Cancellable::connect(const SlotCancelledCallback& slot)
 {
-    SlotCancelledCallback* slot_copy = new SlotCancelledCallback(slot);
+    auto slot_copy = new SlotCancelledCallback(slot);
     return g_cancellable_connect (gobj(),
                                   G_CALLBACK(slot_cancelled_proxy),
                                   slot_copy,
index 485c7b1..0b4b469 100644 (file)
@@ -65,7 +65,7 @@ void DataInputStream::read_line_async(const SlotAsyncReady& slot, const Glib::Re
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_data_input_stream_read_line_async(gobj(),
                             io_priority,
@@ -138,7 +138,7 @@ void DataInputStream::read_until_async(const std::string& stop_chars, const Slot
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_data_input_stream_read_until_async(gobj(), stop_chars.c_str(),
                             io_priority,
@@ -215,7 +215,7 @@ void DataInputStream::read_upto_async(const std::string& stop_chars, const SlotA
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_data_input_stream_read_upto_async(gobj(), stop_chars.c_str(), -1, /* null-terminated */
                             io_priority,
index 2fe11d9..a8b1fd3 100644 (file)
@@ -47,14 +47,14 @@ bool is_supported(const std::string& address)
 void get_stream(const std::string& address, const SlotAsyncReady slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
   g_dbus_address_get_stream(address.c_str(), Glib::unwrap(cancellable),
     &SignalProxy_async_callback, slot_copy);
 }
 
 void get_stream(const std::string& address, const SlotAsyncReady slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
   g_dbus_address_get_stream(address.c_str(), 0, &SignalProxy_async_callback,
     slot_copy);
 }
@@ -65,7 +65,7 @@ Glib::RefPtr<IOStream> get_stream_finish(const Glib::RefPtr<AsyncResult>& res,
   GError* gerror = 0;
   gchar* g_out_guid = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res),
     &g_out_guid, &gerror));
 
@@ -80,7 +80,7 @@ Glib::RefPtr<IOStream> get_stream_finish(const Glib::RefPtr<AsyncResult>& res)
 {
   GError* gerror = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_finish(Glib::unwrap(res), 0,
     &gerror));
 
@@ -96,7 +96,7 @@ Glib::RefPtr<IOStream> get_stream_sync(const std::string& address,
   GError* gerror = 0;
   gchar* g_out_guid = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(),
     &g_out_guid, Glib::unwrap(cancellable), &gerror));
 
@@ -113,7 +113,7 @@ Glib::RefPtr<IOStream> get_stream_sync(const std::string& address,
   GError* gerror = 0;
   gchar* g_out_guid = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(),
     &g_out_guid, 0, &gerror));
 
@@ -129,7 +129,7 @@ Glib::RefPtr<IOStream> get_stream_sync(const std::string& address,
 {
   GError* gerror = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0,
     Glib::unwrap(cancellable), &gerror));
 
@@ -143,7 +143,7 @@ Glib::RefPtr<IOStream> get_stream_sync(const std::string& address)
 {
   GError* gerror = 0;
 
-  Glib::RefPtr<IOStream> result =
+  auto result =
     Glib::wrap(g_dbus_address_get_stream_sync(address.c_str(), 0, 0, &gerror));
 
   if(gerror)
index f2f6035..3102050 100644 (file)
@@ -68,7 +68,7 @@ static GDBusMessage* DBusConnection_Message_Filter_giomm_callback(
 
   try
   {
-    Glib::RefPtr<Gio::DBus::Message> result = (*the_slot)(
+    auto result = (*the_slot)(
       Glib::wrap(connection, true), Glib::wrap(message, true),
       static_cast<bool>(incoming));
     return (result) ? result->gobj_copy() : 0;
@@ -477,7 +477,7 @@ Glib::RefPtr<Connection> Connection::create_for_address_sync(
 void Connection::get(BusType bus_type, const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_bus_get(static_cast<GBusType>(bus_type), Glib::unwrap(cancellable),
     &SignalProxy_async_callback, slot_copy);
@@ -486,7 +486,7 @@ void Connection::get(BusType bus_type, const SlotAsyncReady& slot,
 //static
 void Connection::get(BusType bus_type, const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_bus_get(static_cast<GBusType>(bus_type), 0, &SignalProxy_async_callback,
     slot_copy);
@@ -499,7 +499,7 @@ void Connection::close()
 
 void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_close(gobj(),
                     Glib::unwrap(cancellable),
@@ -509,7 +509,7 @@ void Connection::close(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellabl
 
 void Connection::close(const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_close(gobj(),
                     0,
@@ -524,7 +524,7 @@ void Connection::flush()
 
 void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_flush(gobj(),
                     Glib::unwrap(cancellable),
@@ -534,7 +534,7 @@ void Connection::flush(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellabl
 
 void Connection::flush(const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_flush(gobj(),
                     0,
@@ -559,7 +559,7 @@ bool Connection::send_message(const Glib::RefPtr<Message>& message,
 
 void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
   volatile guint32 out_serial = 0;
   g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message),
                                       static_cast<GDBusSendMessageFlags>(message->get_flags()),
@@ -571,7 +571,7 @@ void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, i
 
 void Connection::send_message_with_reply(const Glib::RefPtr<Message>& message, int timeout_msec,const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
   volatile guint32 out_serial = 0;
   g_dbus_connection_send_message_with_reply(gobj(), Glib::unwrap(message),
                                       static_cast<GDBusSendMessageFlags>(message->get_flags()),
@@ -635,7 +635,7 @@ void Connection::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(),
     interface_name.c_str(), method_name.c_str(),
@@ -659,7 +659,7 @@ void Connection::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_call(gobj(), bus_name.c_str(), object_path.c_str(),
     interface_name.c_str(), method_name.c_str(),
@@ -737,7 +737,7 @@ void Connection::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_call_with_unix_fd_list(gobj(), bus_name.c_str(),
     object_path.c_str(), interface_name.c_str(), method_name.c_str(),
@@ -762,7 +762,7 @@ void Connection::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_connection_call_with_unix_fd_list(gobj(), bus_name.c_str(),
     object_path.c_str(), interface_name.c_str(), method_name.c_str(),
@@ -805,7 +805,7 @@ guint Connection::signal_subscribe(
   const Glib::ustring& arg0,
   SignalFlags flags)
 {
-  SlotSignal* slot_copy = new SlotSignal(slot);
+  auto slot_copy = new SlotSignal(slot);
 
   return g_dbus_connection_signal_subscribe(gobj(), sender.c_str(),
     interface_name.c_str(), member.c_str(), object_path.c_str(), arg0.c_str(),
@@ -816,7 +816,7 @@ guint Connection::signal_subscribe(
 
 guint Connection::add_filter(const SlotMessageFilter& slot)
 {
-  SlotMessageFilter* slot_copy = new SlotMessageFilter(slot);
+  auto slot_copy = new SlotMessageFilter(slot);
 
   return g_dbus_connection_add_filter(gobj(),
     &DBusConnection_Message_Filter_giomm_callback, slot_copy,
index d295247..49de204 100644 (file)
@@ -37,8 +37,8 @@ extern "C"
 static void Bus_Acquired_giomm_callback(GDBusConnection* connection,
   const gchar* name, gpointer data)
 {
-  OwnSlots* slots = static_cast<OwnSlots*>(data);
-  Gio::DBus::SlotBusAcquired* the_slot = slots->bus_acquired_slot;
+  auto slots = static_cast<OwnSlots*>(data);
+  auto the_slot = slots->bus_acquired_slot;
 
   try
   {
@@ -53,8 +53,8 @@ static void Bus_Acquired_giomm_callback(GDBusConnection* connection,
 static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection,
   const gchar* name, gpointer data)
 {
-  OwnSlots* slots = static_cast<OwnSlots*>(data);
-  Gio::DBus::SlotNameAcquired* the_slot = slots->name_acquired_slot;
+  auto slots = static_cast<OwnSlots*>(data);
+  auto the_slot = slots->name_acquired_slot;
 
   try
   {
@@ -69,8 +69,8 @@ static void Bus_Name_Acquired_giomm_callback(GDBusConnection* connection,
 static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection,
   const gchar* name, gpointer data)
 {
-  OwnSlots* slots = static_cast<OwnSlots*>(data);
-  Gio::DBus::SlotNameLost* the_slot = slots->name_lost_slot;
+  auto slots = static_cast<OwnSlots*>(data);
+  auto the_slot = slots->name_lost_slot;
 
   try
   {
@@ -84,7 +84,7 @@ static void Bus_Name_Lost_giomm_callback(GDBusConnection* connection,
 
 static void Bus_Own_Name_giomm_callback_destroy(void* data)
 {
-  OwnSlots* slots =  static_cast<OwnSlots*>(data);
+  auto slots =  static_cast<OwnSlots*>(data);
 
   if(slots->bus_acquired_slot)
     delete slots->bus_acquired_slot;
@@ -118,7 +118,7 @@ guint own_name(
   BusNameOwnerFlags flags
 )
 {
-  struct OwnSlots* slots = new OwnSlots;
+  auto slots = new OwnSlots;
 
   // Make copies of the slots which will be deleted on destroy notification.
   slots->bus_acquired_slot = new SlotBusAcquired(bus_acquired_slot);
index 3c93d4b..25014f6 100644 (file)
@@ -296,7 +296,7 @@ void Proxy::call(const Glib::ustring& method_name,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_proxy_call(gobj(), method_name.c_str(),
     const_cast<GVariant*>(parameters.gobj()),
@@ -314,7 +314,7 @@ void Proxy::call(const Glib::ustring& method_name,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_proxy_call(gobj(), method_name.c_str(),
     const_cast<GVariant*>(parameters.gobj()),
@@ -378,7 +378,7 @@ void Proxy::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(),
     const_cast<GVariant*>(parameters.gobj()),
@@ -398,7 +398,7 @@ void Proxy::call(
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_dbus_proxy_call_with_unix_fd_list(gobj(), method_name.c_str(),
     const_cast<GVariant*>(parameters.gobj()),
index a248101..da8dd75 100644 (file)
@@ -44,7 +44,7 @@ static char** DBusSubtreeVTable_Enumerate_giomm_callback(
 
   try
   {
-    std::vector<Glib::ustring> result =
+    auto result =
       (*the_slot)(Glib::wrap(connection, true), sender, object_path);
 
     // This will be freed by the caller.
@@ -77,7 +77,7 @@ static GDBusInterfaceInfo** DBusSubtreeVTable_Introspect_giomm_callback(
 
   try
   {
-    std::vector< Glib::RefPtr<Gio::DBus::InterfaceInfo> > result =
+    auto result =
       (*the_slot)(Glib::wrap(connection, true), sender, object_path, node);
 
     // This will be freed by the caller, along with unreferencing its members.
@@ -105,21 +105,21 @@ static const GDBusInterfaceVTable* DBusSubtreeVTable_Dispatch_giomm_callback(
   const char* interface_name, const char* node, void** out_user_data,
   void* user_data)
 {
-  Gio::DBus::SubtreeVTable* vtable =
+  Gio::DBus::SubtreeVTable* vtable_subtree =
     static_cast<Gio::DBus::SubtreeVTable*>(user_data);
 
   Gio::DBus::SubtreeVTable::SlotSubtreeDispatch* the_slot =
-    vtable->get_slot_dispatch();
+    vtable_subtree->get_slot_dispatch();
 
   try
   {
-    const Gio::DBus::InterfaceVTable* vtable =
+    const Gio::DBus::InterfaceVTable* vtable_iface =
       (*the_slot)(Glib::wrap(connection, true), sender, object_path,
       interface_name, (node ? node : ""));
 
-    *out_user_data = const_cast<Gio::DBus::InterfaceVTable*>(vtable);
+    *out_user_data = const_cast<Gio::DBus::InterfaceVTable*>(vtable_iface);
 
-    return vtable->gobj();
+    return vtable_iface->gobj();
   }
   catch(...)
   {
index ca9947b..0900b6a 100644 (file)
@@ -36,8 +36,8 @@ extern "C"
 static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection,
   const gchar* name, const char* name_owner, gpointer data)
 {
-  WatchSlots* slots = static_cast<WatchSlots*>(data);
-  Gio::DBus::SlotNameAppeared* the_slot = slots->name_appeared_slot;
+  auto slots = static_cast<WatchSlots*>(data);
+  auto the_slot = slots->name_appeared_slot;
 
   try
   {
@@ -53,8 +53,8 @@ static void Bus_Name_Appeared_giomm_callback(GDBusConnection* connection,
 static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection,
   const gchar* name, gpointer data)
 {
-  WatchSlots* slots = static_cast<WatchSlots*>(data);
-  Gio::DBus::SlotNameVanished* the_slot = slots->name_vanished_slot;
+  auto slots = static_cast<WatchSlots*>(data);
+  auto the_slot = slots->name_vanished_slot;
 
   try
   {
@@ -68,7 +68,7 @@ static void Bus_Name_Vanished_giomm_callback(GDBusConnection* connection,
 
 static void Bus_Watch_Name_giomm_callback_destroy(void* data)
 {
-  WatchSlots* slots =  static_cast<WatchSlots*>(data);
+  auto slots =  static_cast<WatchSlots*>(data);
 
   if(slots->name_appeared_slot)
     delete slots->name_appeared_slot;
@@ -98,7 +98,7 @@ guint watch_name(
   BusNameWatcherFlags flags
 )
 {
-  struct WatchSlots* slots = new WatchSlots;
+  auto slots = new WatchSlots;
 
   // Make copies of the slots which will be deleted on destroy notification.
   slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot);
@@ -118,7 +118,7 @@ guint watch_name(
   BusNameWatcherFlags flags
 )
 {
-  struct WatchSlots* slots = new WatchSlots;
+  auto slots = new WatchSlots;
 
   // Make copies of the slots which will be deleted on destroy notification.
   slots->name_appeared_slot = new SlotNameAppeared(name_appeared_slot);
index c056861..da3fe0e 100644 (file)
@@ -31,7 +31,7 @@ void Drive::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& c
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_eject_with_operation(gobj(),
                                static_cast<GMountUnmountFlags>(flags),
@@ -46,7 +46,7 @@ void Drive::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_eject_with_operation(gobj(),
                                static_cast<GMountUnmountFlags>(flags),
@@ -61,7 +61,7 @@ void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_eject_with_operation(gobj(),
                                static_cast<GMountUnmountFlags>(flags),
@@ -76,7 +76,7 @@ void Drive::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_eject_with_operation(gobj(),
                                static_cast<GMountUnmountFlags>(flags),
@@ -111,7 +111,7 @@ void Drive::poll_for_media(const SlotAsyncReady& slot, const Glib::RefPtr<Cancel
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_poll_for_media(gobj(),
                          Glib::unwrap(cancellable),
@@ -124,7 +124,7 @@ void Drive::poll_for_media(const SlotAsyncReady& slot)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_poll_for_media(gobj(),
                          0, // cancellable
@@ -149,7 +149,7 @@ Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_stop(gobj(),
                static_cast<GMountUnmountFlags>(flags),
@@ -167,7 +167,7 @@ Drive::stop(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_stop(gobj(),
                static_cast<GMountUnmountFlags>(flags),
@@ -187,7 +187,7 @@ Drive::start(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_start(gobj(),
                 static_cast<GDriveStartFlags>(flags),
@@ -205,7 +205,7 @@ Drive::start(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_drive_start(gobj(),
                 static_cast<GDriveStartFlags>(flags),
index 639d4d7..f94511e 100644 (file)
@@ -36,7 +36,7 @@ SignalProxy_file_progress_callback(goffset current_num_bytes,
                                    goffset total_num_bytes,
                                    gpointer data)
 {
-  Gio::File::SlotFileProgress* the_slot = static_cast<Gio::File::SlotFileProgress*>(data);
+  auto the_slot = static_cast<Gio::File::SlotFileProgress*>(data);
 
   try
   {
@@ -56,14 +56,14 @@ SignalProxy_file_progress_callback(goffset current_num_bytes,
 static void
 SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data)
 {
-  CopySlots* slot_pair = static_cast<CopySlots*>(data);
-  Gio::SlotAsyncReady* the_slot = slot_pair->second;
+  auto slot_pair = static_cast<CopySlots*>(data);
+  auto the_slot = slot_pair->second;
 
   try
   {
     if(*the_slot)
     {
-      Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */);
+      auto result = Glib::wrap(res, true /* take copy */);
       (*the_slot)(result);
     }
   }
@@ -84,14 +84,14 @@ SignalProxy_file_copy_async_callback(GObject*, GAsyncResult* res, void* data)
 static void
 SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data)
 {
-  MeasureSlots* slot_pair = static_cast<MeasureSlots*>(data);
-  Gio::SlotAsyncReady* the_slot = slot_pair->second;
+  auto slot_pair = static_cast<MeasureSlots*>(data);
+  auto the_slot = slot_pair->second;
 
   try
   {
     if(*the_slot)
     {
-      Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */);
+      auto result = Glib::wrap(res, true /* take copy */);
       (*the_slot)(result);
     }
   }
@@ -108,8 +108,8 @@ SignalProxy_file_measure_async_callback(GObject*, GAsyncResult* res, void* data)
 static gboolean
 SignalProxy_load_partial_contents_read_more_callback(const char* file_contents, goffset file_size, gpointer data)
 {
-  LoadPartialSlots* slot_pair = static_cast<LoadPartialSlots*>(data);
-  Gio::File::SlotReadMore* the_slot = slot_pair->first;
+  auto slot_pair = static_cast<LoadPartialSlots*>(data);
+  auto the_slot = slot_pair->first;
 
   bool result = false;
 
@@ -138,7 +138,7 @@ SignalProxy_load_partial_contents_ready_callback(GObject*, GAsyncResult* res, vo
 
   try
   {
-    Glib::RefPtr<Gio::AsyncResult> result = Glib::wrap(res, true /* take copy */);
+    auto result = Glib::wrap(res, true /* take copy */);
     (*the_slot)(result);
   }
   catch(...)
@@ -441,7 +441,7 @@ FileType File::query_file_type(FileQueryInfoFlags flags) const
 Glib::RefPtr<FileInfo> File::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags) const
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -451,7 +451,7 @@ Glib::RefPtr<FileInfo> File::query_info(const Glib::RefPtr<Cancellable>& cancell
 Glib::RefPtr<FileInfo> File::query_info(const std::string& attributes, FileQueryInfoFlags flags) const
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_query_info(const_cast<GFile*>(gobj()), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -496,7 +496,7 @@ File::query_info_async(const SlotAsyncReady& slot, const std::string& attributes
 Glib::RefPtr<FileInfo> File::query_filesystem_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -506,7 +506,7 @@ Glib::RefPtr<FileInfo> File::query_filesystem_info(const Glib::RefPtr<Cancellabl
 Glib::RefPtr<FileInfo> File::query_filesystem_info(const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_query_filesystem_info(gobj(), attributes.c_str(), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -548,7 +548,7 @@ File::query_filesystem_info_async(const SlotAsyncReady& slot, const std::string&
 Glib::RefPtr<FileEnumerator> File::enumerate_children(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes, FileQueryInfoFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileEnumerator> retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -558,7 +558,7 @@ Glib::RefPtr<FileEnumerator> File::enumerate_children(const Glib::RefPtr<Cancell
 Glib::RefPtr<FileEnumerator> File::enumerate_children(const std::string& attributes, FileQueryInfoFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileEnumerator> retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_enumerate_children(gobj(), attributes.c_str(), ((GFileQueryInfoFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1505,7 +1505,7 @@ File::replace_contents_bytes_async(const SlotAsyncReady& slot,
 Glib::RefPtr<FileOutputStream> File::replace(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1515,7 +1515,7 @@ Glib::RefPtr<FileOutputStream> File::replace(const Glib::RefPtr<Cancellable>& ca
 Glib::RefPtr<FileOutputStream> File::replace(const std::string& etag, bool make_backup, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_replace(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1526,7 +1526,7 @@ Glib::RefPtr<FileOutputStream> File::replace(const std::string& etag, bool make_
 Glib::RefPtr<FileIOStream> File::replace_readwrite(const Glib::RefPtr<Cancellable>& cancellable, const std::string& etag, bool make_backup, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileIOStream> retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1536,7 +1536,7 @@ Glib::RefPtr<FileIOStream> File::replace_readwrite(const Glib::RefPtr<Cancellabl
 Glib::RefPtr<FileIOStream> File::replace_readwrite(const std::string& etag, bool make_backup, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileIOStream> retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_replace_readwrite(gobj(), etag.empty() ? 0 : etag.c_str(), static_cast<int>(make_backup), ((GFileCreateFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1548,7 +1548,7 @@ Glib::RefPtr<FileIOStream> File::replace_readwrite(const std::string& etag, bool
 Glib::RefPtr<FileMonitor> File::monitor_directory(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1558,7 +1558,7 @@ Glib::RefPtr<FileMonitor> File::monitor_directory(const Glib::RefPtr<Cancellable
 Glib::RefPtr<FileMonitor> File::monitor_directory(FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor_directory(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1568,7 +1568,7 @@ Glib::RefPtr<FileMonitor> File::monitor_directory(FileMonitorFlags flags)
 Glib::RefPtr<FileMonitor> File::monitor_file(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1578,7 +1578,7 @@ Glib::RefPtr<FileMonitor> File::monitor_file(const Glib::RefPtr<Cancellable>& ca
 Glib::RefPtr<FileMonitor> File::monitor_file(FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor_file(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1589,7 +1589,7 @@ Glib::RefPtr<FileMonitor> File::monitor_file(FileMonitorFlags flags)
 Glib::RefPtr<FileMonitor> File::monitor(const Glib::RefPtr<Cancellable>& cancellable, FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1599,7 +1599,7 @@ Glib::RefPtr<FileMonitor> File::monitor(const Glib::RefPtr<Cancellable>& cancell
 Glib::RefPtr<FileMonitor> File::monitor(FileMonitorFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileMonitor> retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_monitor(gobj(), ((GFileMonitorFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1811,7 +1811,7 @@ File::copy_attributes(const Glib::RefPtr<File>& destination, FileCopyFlags flags
 Glib::RefPtr<FileOutputStream> File::create_file(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1821,7 +1821,7 @@ Glib::RefPtr<FileOutputStream> File::create_file(const Glib::RefPtr<Cancellable>
 Glib::RefPtr<FileOutputStream> File::create_file(FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_create(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1831,7 +1831,7 @@ Glib::RefPtr<FileOutputStream> File::create_file(FileCreateFlags flags)
 Glib::RefPtr<FileIOStream> File::create_file_readwrite(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileIOStream> retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1841,7 +1841,7 @@ Glib::RefPtr<FileIOStream> File::create_file_readwrite(const Glib::RefPtr<Cancel
 Glib::RefPtr<FileIOStream> File::create_file_readwrite(FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileIOStream> retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_create_readwrite(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1851,7 +1851,7 @@ Glib::RefPtr<FileIOStream> File::create_file_readwrite(FileCreateFlags flags)
 Glib::RefPtr<FileOutputStream> File::append_to(const Glib::RefPtr<Cancellable>& cancellable, FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -1861,7 +1861,7 @@ Glib::RefPtr<FileOutputStream> File::append_to(const Glib::RefPtr<Cancellable>&
 Glib::RefPtr<FileOutputStream> File::append_to(FileCreateFlags flags)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileOutputStream> retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_append_to(gobj(), ((GFileCreateFlags)(flags)), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
index b432045..7332e3d 100644 (file)
@@ -35,7 +35,7 @@ bool FileAttributeInfoList::empty() const
 FileAttributeInfo
 FileAttributeInfoList::lookup(const std::string& name) const
 {
-  GFileAttributeInfoList* cobject = const_cast<GFileAttributeInfoList*>(gobj());
+  auto cobject = const_cast<GFileAttributeInfoList*>(gobj());
   const GFileAttributeInfo* cinfo =
     g_file_attribute_info_list_lookup (cobject, name.c_str());
 
index 49a893a..d5cb85c 100644 (file)
@@ -32,7 +32,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, const Glib::RefPtr<
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_enumerator_next_files_async(gobj(),
                                      num_files,
@@ -48,7 +48,7 @@ FileEnumerator::next_files_async(const SlotAsyncReady& slot, int num_files, int
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_enumerator_next_files_async(gobj(),
                                      num_files,
@@ -66,7 +66,7 @@ FileEnumerator::close_async(int io_priority,
 // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_enumerator_close_async(gobj(),
                                 io_priority,
@@ -82,7 +82,7 @@ FileEnumerator::close_async(int io_priority,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_enumerator_close_async(gobj(),
                                 io_priority,
index d10eb68..b14a601 100644 (file)
@@ -200,8 +200,8 @@ public:
   // helper setters
 
   _WRAP_METHOD(void set_file_type(FileType type), g_file_info_set_file_type)
-  _WRAP_METHOD(void set_is_hidden(bool is_hidden = true), g_file_info_set_is_hidden)
-  _WRAP_METHOD(void set_is_symlink(bool is_symlink = true), g_file_info_set_is_symlink)
+  _WRAP_METHOD(void set_is_hidden(bool hidden = true), g_file_info_set_is_hidden)
+  _WRAP_METHOD(void set_is_symlink(bool symlink = true), g_file_info_set_is_symlink)
   _WRAP_METHOD(void set_name(const std::string& name), g_file_info_set_name)
 
   //TODO: This should take a ustring instead. See https://bugzilla.gnome.org/show_bug.cgi?id=615950#c4
index 9dc275e..087f970 100644 (file)
@@ -27,7 +27,7 @@ namespace Gio
 Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -37,7 +37,7 @@ Glib::RefPtr<FileInfo> FileInputStream::query_info(const Glib::RefPtr<Cancellabl
 Glib::RefPtr<FileInfo> FileInputStream::query_info(const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_input_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -50,7 +50,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_input_stream_query_info_async(gobj(),
                                        const_cast<char*>(attributes.c_str()),
@@ -66,7 +66,7 @@ FileInputStream::query_info_async(const SlotAsyncReady& slot, const std::string&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_input_stream_query_info_async(gobj(),
                                        const_cast<char*>(attributes.c_str()),
index 5ae6ac5..ed8757b 100644 (file)
@@ -27,7 +27,7 @@ namespace Gio
 Glib::RefPtr<FileInfo> FileIOStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -37,7 +37,7 @@ Glib::RefPtr<FileInfo> FileIOStream::query_info(const Glib::RefPtr<Cancellable>&
 Glib::RefPtr<FileInfo> FileIOStream::query_info(const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_io_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -50,7 +50,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPtr<Ca
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_io_stream_query_info_async(gobj(),
                                     const_cast<char*>(attributes.c_str()),
@@ -66,7 +66,7 @@ FileIOStream::query_info_async(const SlotAsyncReady& slot, const std::string& at
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_io_stream_query_info_async(gobj(),
                                     const_cast<char*>(attributes.c_str()),
index e46308c..7b940fe 100644 (file)
@@ -29,7 +29,7 @@ namespace Gio
 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellable>& cancellable, const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
+  auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -41,7 +41,7 @@ Glib::RefPtr<FileInfo> FileOutputStream::query_info(const Glib::RefPtr<Cancellab
 Glib::RefPtr<FileInfo> FileOutputStream::query_info(const std::string& attributes)
 {
   GError* gerror = 0;
-  Glib::RefPtr<FileInfo> retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
+  auto retvalue = Glib::wrap(g_file_output_stream_query_info(gobj(), g_strdup((attributes).c_str()), 0, &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -56,7 +56,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const Glib::RefPt
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_output_stream_query_info_async(gobj(),
                                         const_cast<char*>(attributes.c_str()),
@@ -72,7 +72,7 @@ FileOutputStream::query_info_async(const SlotAsyncReady& slot, const std::string
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_file_output_stream_query_info_async(gobj(),
                                         const_cast<char*>(attributes.c_str()),
index d7c3a4e..9f9a22c 100644 (file)
@@ -798,6 +798,11 @@ an owner for the destination name in response to this method
 invocation.
 </parameter_description>
 </parameter>
+<parameter name="G_DBUS_CALL_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION">
+<parameter_description> the caller is prepared to
+wait for interactive authorization. Since 2.46.
+</parameter_description>
+</parameter>
 </parameters>
 </enum>
 
@@ -1388,6 +1393,12 @@ Since: 2.26
 owner for the destination name in response to this message.
 </parameter_description>
 </parameter>
+<parameter name="G_DBUS_MESSAGE_FLAGS_ALLOW_INTERACTIVE_AUTHORIZATION">
+<parameter_description> If set on a method
+call, this flag means that the caller is prepared to wait for interactive
+authorization. Since 2.46.
+</parameter_description>
+</parameter>
 </parameters>
 </enum>
 
@@ -4035,6 +4046,16 @@ Since: 2.38
 </description>
 </property>
 
+<property name="GPropertyAction:invert-boolean">
+<description>
+If %TRUE, the state of the action will be the negation of the
+property value, provided the property is boolean.
+
+Since: 2.46
+
+</description>
+</property>
+
 <property name="GPropertyAction:name">
 <description>
 The name of the action.  This is mostly meaningful for identifying
@@ -6347,6 +6368,24 @@ Since: 2.26
 </description>
 </property>
 
+<property name="GWin32RegistryKey:path">
+<description>
+A path to the key in the registry, in UTF-8.
+
+Since: 2.46
+
+</description>
+</property>
+
+<property name="GWin32RegistryKey:path-utf16">
+<description>
+A path to the key in the registry, in UTF-16.
+
+Since: 2.46
+
+</description>
+</property>
+
 <property name="GZlibCompressor:file-info">
 <description>
 If set to a non-%NULL #GFileInfo object, and #GZlibCompressor:format is
@@ -6920,8 +6959,7 @@ Since: 2.28
 </parameter_description>
 </parameter>
 </parameters>
-<return> the state type, if the action
-is stateful
+<return> the state type, if the action is stateful
 
 </return>
 </function>
@@ -27317,7 +27355,9 @@ If @etag is specified (not %NULL), any existing file must have that etag,
 or the error %G_IO_ERROR_WRONG_ETAG will be returned.
 
 If @make_backup is %TRUE, this function will attempt to make a backup
-of @file.
+of @file. Internally, it uses g_file_replace(), so will try to replace the
+file contents in the safest way possible. For example, atomic renames are
+used when replacing local files’ contents.
 
 If @cancellable is not %NULL, then the operation can be cancelled by
 triggering the cancellable object from another thread. If the operation
@@ -34774,6 +34814,28 @@ Since: 2.20
 <return></return>
 </function>
 
+<function name="g_native_socket_address_new">
+<description>
+Creates a new #GNativeSocketAddress for @address and @port.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="address">
+<parameter_description> a #GNativeAddress
+</parameter_description>
+</parameter>
+<parameter name="port">
+<parameter_description> a port number
+</parameter_description>
+</parameter>
+</parameters>
+<return> a new #GNativeSocketAddress
+
+</return>
+</function>
+
 <function name="g_network_address_get_hostname">
 <description>
 Gets @addr's hostname. This might be either UTF-8 or ASCII-encoded,
@@ -38750,7 +38812,7 @@ Free the returned object with g_object_unref()
 
 <function name="g_resource_ref">
 <description>
-Atomically increments the reference count of @array by one. This
+Atomically increments the reference count of @resource by one. This
 function is MT-safe and may be called from any thread.
 
 Since: 2.32
@@ -38770,7 +38832,7 @@ Since: 2.32
 <function name="g_resource_unref">
 <description>
 Atomically decrements the reference count of @resource by one. If the
-reference count drops to 0, all memory allocated by the array is
+reference count drops to 0, all memory allocated by the resource is
 released. This function is MT-safe and may be called from any
 thread.
 
@@ -40774,6 +40836,29 @@ Since: 2.44
 </return>
 </function>
 
+<function name="g_settings_schema_list_keys">
+<description>
+Introspects the list of keys on @schema.
+
+You should probably not be calling this function from &quot;normal&quot; code
+(since you should already know what keys are in your schema).  This
+function is intended for introspection reasons.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="schema">
+<parameter_description> a #GSettingsSchema
+</parameter_description>
+</parameter>
+</parameters>
+<return> a list of the keys on
+@schema
+
+</return>
+</function>
+
 <function name="g_settings_schema_ref">
 <description>
 Increase the reference count of @schema, returning a new reference.
@@ -45447,6 +45532,9 @@ mode of the #GSocket.
 On success, the returned #GSocket takes ownership of @fd. On failure, the
 caller must close @fd themselves.
 
+Since GLib 2.46, it is no longer a fatal error to call this on a non-socket
+descriptor.  Instead, a GError will be set with code %G_IO_ERROR_FAILED
+
 Since: 2.22
 
 </description>
@@ -47144,9 +47232,8 @@ Since: 2.40
 Returns the value of the environment variable @variable in the
 environment of processes launched from this launcher.
 
-The returned string is in the GLib file name encoding.  On UNIX, this
-means that it can be an arbitrary byte string.  On Windows, it will
-be UTF-8.
+On UNIX, the returned string can be an arbitrary byte string.
+On Windows, it will be UTF-8.
 
 Since: 2.40
 
@@ -47262,9 +47349,8 @@ g_environ_unsetenv(), etc.
 As an alternative, you can use g_subprocess_launcher_setenv(),
 g_subprocess_launcher_unsetenv(), etc.
 
-All strings in this array are expected to be in the GLib file name
-encoding.  On UNIX, this means that they can be arbitrary byte
-strings.  On Windows, they should be in UTF-8.
+On UNIX, all strings in this array can be arbitrary byte strings.
+On Windows, they should be in UTF-8.
 
 Since: 2.40
 
@@ -47410,10 +47496,9 @@ Since: 2.40
 Sets the environment variable @variable in the environment of
 processes launched from this launcher.
 
-Both the variable's name and value should be in the GLib file name
-encoding. On UNIX, this means that they can be arbitrary byte
-strings. On Windows, they should be in UTF-8.
-
+On UNIX, both the variable's name and value can be arbitrary byte
+strings, except that the variable's name cannot contain '='.
+On Windows, they should be in UTF-8.
 
 Since: 2.40
 
@@ -47639,9 +47724,8 @@ Since: 2.40
 Removes the environment variable @variable from the environment of
 processes launched from this launcher.
 
-The variable name should be in the GLib file name encoding.  On UNIX,
-this means that they can be arbitrary byte strings.  On Windows, they
-should be in UTF-8.
+On UNIX, the variable's name can be an arbitrary byte string not
+containing '='. On Windows, it should be in UTF-8.
 
 Since: 2.40
 
@@ -53974,6 +54058,971 @@ Since: 2.26
 <return></return>
 </function>
 
+<function name="g_win32_registry_key_erase_change_indicator">
+<description>
+Erases change indicator of the @key.
+
+Subsequent calls to g_win32_registry_key_has_changed() will return %FALSE
+until the key is put on watch again by calling
+g_win32_registry_key_watch() again.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_key_get_child">
+<description>
+Opens a @subkey of the @key.
+
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a parent #GWin32RegistryKey
+</parameter_description>
+</parameter>
+<parameter name="subkey">
+<parameter_description> name of a child key to open (in UTF-8), relative to @key
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to a %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> a #GWin32RegistryKey or %NULL if can't be opened. Free
+with g_object_unref().
+</return>
+</function>
+
+<function name="g_win32_registry_key_get_child_w">
+<description>
+Opens a @subkey of the @key.
+
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a parent #GWin32RegistryKey
+</parameter_description>
+</parameter>
+<parameter name="subkey">
+<parameter_description> name of a child key to open (in UTF-8), relative to @key
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to a %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> a #GWin32RegistryKey or %NULL if can't be opened. Free
+with g_object_unref().
+</return>
+</function>
+
+<function name="g_win32_registry_key_get_path">
+<description>
+Get full path to the key
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+</parameters>
+<return> a full path to the key (in UTF-8),
+or %NULL if it can't be converted to UTF-8.
+
+</return>
+</function>
+
+<function name="g_win32_registry_key_get_path_w">
+<description>
+Get full path to the key
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+</parameters>
+<return> a full path to the key (in UTF-16)
+
+</return>
+</function>
+
+<function name="g_win32_registry_key_get_value">
+<description>
+Get data from a value of a key. String data is guaranteed to be
+appropriately terminated and will be in UTF-8.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+<parameter name="auto_expand">
+<parameter_description> (in) %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR
+to G_WIN32_REGISTRY_VALUE_STR.
+</parameter_description>
+</parameter>
+<parameter name="value_name">
+<parameter_description> name of the value to get (in UTF-8).
+Empty string means the '(Default)' value.
+</parameter_description>
+</parameter>
+<parameter name="value_type">
+<parameter_description> type of the value retrieved.
+</parameter_description>
+</parameter>
+<parameter name="value_data">
+<parameter_description> contents of the value.
+</parameter_description>
+</parameter>
+<parameter name="value_data_size">
+<parameter_description> size of the buffer pointed
+by @value_data.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE on success, %FALSE on failure.
+
+</return>
+</function>
+
+<function name="g_win32_registry_key_get_value_w">
+<description>
+Get data from a value of a key.
+
+Get data from a value of a key. String data is guaranteed to be
+appropriately terminated and will be in UTF-16.
+
+When calling with value_data == NULL (to get data size without getting
+the data itself) remember that returned size corresponds to possibly
+unterminated string data (if value is some kind of string), because
+termination cannot be checked and fixed unless the data is retreived
+too.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+<parameter name="auto_expand">
+<parameter_description> (in) %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR
+to G_WIN32_REGISTRY_VALUE_STR.
+</parameter_description>
+</parameter>
+<parameter name="value_name">
+<parameter_description> name of the value to get (in UTF-16).
+Empty string means the '(Default)' value.
+</parameter_description>
+</parameter>
+<parameter name="value_type">
+<parameter_description> type of the value retrieved.
+</parameter_description>
+</parameter>
+<parameter name="value_data">
+<parameter_description> contents of the value.
+</parameter_description>
+</parameter>
+<parameter name="value_data_size">
+<parameter_description> size of the buffer pointed
+by @value_data.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE on success, %FALSE on failure.
+
+</return>
+</function>
+
+<function name="g_win32_registry_key_has_changed">
+<description>
+Check the @key's status indicator.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the @key was put under watch at some point and has changed
+since then, %FALSE if it either wasn't changed or wasn't watched at all.
+
+</return>
+</function>
+
+<function name="g_win32_registry_key_new">
+<description>
+Creates an object that represents a registry key specified by @path.
+@path must start with one of the following pre-defined names:
+- HKEY_CLASSES_ROOT
+- HKEY_CURRENT_CONFIG
+- HKEY_CURRENT_USER
+- HKEY_CURRENT_USER_LOCAL_SETTINGS
+- HKEY_LOCAL_MACHINE
+- HKEY_PERFORMANCE_DATA
+- HKEY_PERFORMANCE_NLSTEXT
+- HKEY_PERFORMANCE_TEXT
+- HKEY_USERS
+@path must not end with '\\'.
+
+
+</description>
+<parameters>
+<parameter name="path">
+<parameter_description> absolute full name of a key to open (in UTF-8)
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to a %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> a #GWin32RegistryKey or %NULL if can't
+be opened. Free with g_object_unref().
+</return>
+</function>
+
+<function name="g_win32_registry_key_new_w">
+<description>
+Creates an object that represents a registry key specified by @path.
+@path must start with one of the following pre-defined names:
+- HKEY_CLASSES_ROOT
+- HKEY_CURRENT_CONFIG
+- HKEY_CURRENT_USER
+- HKEY_CURRENT_USER_LOCAL_SETTINGS
+- HKEY_LOCAL_MACHINE
+- HKEY_PERFORMANCE_DATA
+- HKEY_PERFORMANCE_NLSTEXT
+- HKEY_PERFORMANCE_TEXT
+- HKEY_USERS
+@path must not end with L'\\'.
+
+
+</description>
+<parameters>
+<parameter name="path">
+<parameter_description> absolute full name of a key to open (in UTF-16)
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to a %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> a #GWin32RegistryKey or %NULL if can't
+be opened. Free with g_object_unref().
+</return>
+</function>
+
+<function name="g_win32_registry_key_watch">
+<description>
+Puts @key under a watch.
+
+When the key changes, an APC will be queued in the current thread. The APC
+will run when the current thread enters alertable state (GLib main loop
+should do that; if you are not using it, see MSDN documentation for W32API
+calls that put thread into alertable state). When it runs, it will
+atomically switch an indicator in the @key. If a callback was specified,
+it is invoked at that point. Subsequent calls to
+g_win32_registry_key_has_changed() will return %TRUE, and the callback (if
+it was specified) will not be invoked anymore.
+Calling g_win32_registry_key_erase_change_indicator() will reset the indicator,
+and g_win32_registry_key_has_changed() will start returning %FALSE.
+To resume the watch, call g_win32_registry_key_watch_for_changes() again.
+
+Calling g_win32_registry_key_watch_for_changes() for a key that is already
+being watched is allowed and affects nothing.
+
+The fact that the key is being watched will be used internally to update
+key path (if it changes).
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey
+</parameter_description>
+</parameter>
+<parameter name="watch_children">
+<parameter_description> (in) %TRUE also watch the children of the @key, %FALSE
+to watch the key only.
+</parameter_description>
+</parameter>
+<parameter name="change_flags">
+<parameter_description> specifies the types of changes to watch for.
+</parameter_description>
+</parameter>
+<parameter name="callback">
+<parameter_description> a function to invoke when a change occurs.
+</parameter_description>
+</parameter>
+<parameter name="user_data">
+<parameter_description> a pointer to pass to @callback on invocation.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE on success, %FALSE on failure.
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_assign">
+<description>
+Assigns the value of @other to @iter.  This function
+is not useful in applications, because iterators can be assigned
+with `GWin32RegistrySubkeyIter i = j;`. The
+function is used by language bindings.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+<parameter name="other">
+<parameter_description> another #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_clear">
+<description>
+Frees internal buffers of a #GWin32RegistrySubkeyIter.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_copy">
+<description>
+Creates a dynamically-allocated copy of an iterator. Dynamically-allocated
+state of the iterator is duplicated too.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> an iterator
+</parameter_description>
+</parameter>
+</parameters>
+<return> a copy of the @iter,
+free with g_win32_registry_subkey_iter_free ()
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_free">
+<description>
+Free an iterator allocated on the heap. For iterators that are allocated
+on the stack use g_win32_registry_subkey_iter_clear () instead.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a dynamically-allocated iterator
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_get_name">
+<description>
+Gets the name of the subkey at the @iter potision.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+<parameter name="subkey_name">
+<parameter_description> Pointer to a location
+to store the name of a subkey (in UTF-8). Free with g_free().
+</parameter_description>
+</parameter>
+<parameter name="subkey_name_len">
+<parameter_description> Pointer to a location to store the
+length of @subkey_name, in gchars, excluding NUL-terminator.
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the name was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_get_name_w">
+<description>
+Same as g_win32_registry_subkey_iter_get_next(), but outputs UTF-16-encoded
+data, without converting it to UTF-8 first.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+<parameter name="subkey_name">
+<parameter_description> Pointer to a location
+to store the name of a subkey (in UTF-16).
+</parameter_description>
+</parameter>
+<parameter name="subkey_name_len">
+<parameter_description> Pointer to a location
+to store the length of @subkey_name, in gunichar2s, excluding
+NUL-terminator.
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the name was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_init">
+<description>
+Initialises (without allocating) a #GWin32RegistrySubkeyIter.  @iter may be
+completely uninitialised prior to this call; its old value is
+ignored.
+
+The iterator remains valid for as long as @key exists.
+Clean up its internal buffers with a call to
+g_win32_registry_subkey_iter_clear() when done.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a pointer to a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey to iterate over
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if iterator was initialized successfully, %FALSE on error.
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_n_subkeys">
+<description>
+Queries the number of subkeys items in the key that we are
+iterating over.  This is the total number of subkeys -- not the number
+of items remaining.
+
+This information is accurate at the point of iterator initialization,
+and may go out of sync with reality even while subkeys are enumerated.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+</parameters>
+<return> the number of subkeys in the key
+
+</return>
+</function>
+
+<function name="g_win32_registry_subkey_iter_next">
+<description>
+Moves iterator to the next subkey.
+Enumeration errors can be ignored if @skip_errors is %TRUE
+
+Here is an example for iterating with g_win32_registry_subkey_iter_next():
+|[&lt;!-- language=&quot;C&quot; --&gt;
+// recursively iterate a key
+void
+iterate_key_recursive (GWin32RegistryKey *key)
+{
+GWin32RegistrySubkeyIter iter;
+gchar *name;
+GWin32RegistryKey *child;
+
+if (!g_win32_registry_subkey_iter_init (&amp;iter, key, NULL))
+return;
+
+while (g_win32_registry_subkey_iter_next (&amp;iter, TRUE, NULL))
+{
+if (!g_win32_registry_subkey_iter_get_name (&amp;iter, &amp;name, NULL, NULL))
+continue;
+
+g_print (&quot;subkey '%s'\n&quot;, name);
+child = g_win32_registry_key_get_child (key, name, NULL);
+
+if (child)
+iterate_key_recursive (child);
+}
+
+g_win32_registry_subkey_iter_clear (&amp;iter);
+}
+]|
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistrySubkeyIter
+</parameter_description>
+</parameter>
+<parameter name="skip_errors">
+<parameter_description> %TRUE if iterator should silently ignore errors (such as
+the actual number of subkeys being less than expected) and
+proceed forward
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if next subkey info was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_assign">
+<description>
+Assigns the value of @other to @iter.  This function
+is not useful in applications, because iterators can be assigned
+with `GWin32RegistryValueIter i = j;`. The
+function is used by language bindings.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="other">
+<parameter_description> another #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_value_iter_clear">
+<description>
+Frees internal buffers of a #GWin32RegistryValueIter.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_value_iter_copy">
+<description>
+Creates a dynamically-allocated copy of an iterator. Dynamically-allocated
+state of the iterator is duplicated too.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> an iterator
+</parameter_description>
+</parameter>
+</parameters>
+<return> a copy of the @iter,
+free with g_win32_registry_value_iter_free ().
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_free">
+<description>
+Free an iterator allocated on the heap. For iterators that are allocated
+on the stack use g_win32_registry_value_iter_clear () instead.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a dynamically-allocated iterator
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_win32_registry_value_iter_get_data">
+<description>
+Stores the data of the value currently being iterated over in @value_data,
+and its length - in @value_data_len (if not %NULL).
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="value_data">
+<parameter_description> Pointer to a
+location to store the data of the value (in UTF-8, if it's a string).
+</parameter_description>
+</parameter>
+<parameter name="value_data_size">
+<parameter_description> Pointer to a location to store the length
+of @value_data, in bytes (including any NUL-terminators, if it's a
+string).
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if value data was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_get_data_w">
+<description>
+Stores the data of the value currently being iterated over in @value_data,
+and its length - in @value_data_len (if not %NULL).
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="auto_expand">
+<parameter_description> %TRUE to automatically expand G_WIN32_REGISTRY_VALUE_EXPAND_STR to
+G_WIN32_REGISTRY_VALUE_STR.
+</parameter_description>
+</parameter>
+<parameter name="value_data">
+<parameter_description> Pointer to a
+location to store the data of the value (in UTF-16, if it's a string).
+</parameter_description>
+</parameter>
+<parameter name="value_data_len">
+<parameter_description> Pointer to a location to store the size
+of @value_data, in bytes (including any NUL-terminators, if it's a
+string).
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if value data was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_get_name">
+<description>
+Stores the name of the value currently being iterated over in @value_name,
+and its length - in @value_name_len (if not %NULL).
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="value_name">
+<parameter_description> Pointer to a location
+to store the name of a value (in UTF-8).
+</parameter_description>
+</parameter>
+<parameter name="value_name_len">
+<parameter_description> Pointer to a location to store the length
+of @value_name, in gchars, excluding NUL-terminator.
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if value name was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_get_name_w">
+<description>
+Stores the name of the value currently being iterated over in @value_name,
+and its length - in @value_name (if not %NULL).
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="value_name">
+<parameter_description> Pointer to a location
+to store the name of a value (in UTF-16).
+</parameter_description>
+</parameter>
+<parameter name="value_name_len">
+<parameter_description> Pointer to a location to store the length
+of @value_name, in gunichar2s, excluding NUL-terminator.
+%NULL if length is not needed.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if value name was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_get_value_type">
+<description>
+Stores the type of the value currently being iterated over in @value_type.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="value_type">
+<parameter_description> Pointer to a location to store the type of
+the value.
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if value type was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_init">
+<description>
+Initialises (without allocating) a #GWin32RegistryValueIter.  @iter may be
+completely uninitialised prior to this call; its old value is
+ignored.
+
+The iterator remains valid for as long as @key exists.
+Clean up its internal buffers with a call to
+g_win32_registry_value_iter_clear() when done.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a pointer to a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="key">
+<parameter_description> a #GWin32RegistryKey to iterate over
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if iterator was initialized successfully, %FALSE on error.
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_n_values">
+<description>
+Queries the number of values items in the key that we are
+iterating over.  This is the total number of values -- not the number
+of items remaining.
+
+This information is accurate at the point of iterator initialization,
+and may go out of sync with reality even while values are enumerated.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+</parameters>
+<return> the number of values in the key
+
+</return>
+</function>
+
+<function name="g_win32_registry_value_iter_next">
+<description>
+Advances iterator to the next value in the key. If no more values remain then
+FALSE is returned.
+Enumeration errors can be ignored if @skip_errors is %TRUE
+
+Here is an example for iterating with g_win32_registry_value_iter_next():
+|[&lt;!-- language=&quot;C&quot; --&gt;
+// iterate values of a key
+void
+iterate_values_recursive (GWin32RegistryKey *key)
+{
+GWin32RegistryValueIter iter;
+gchar *name;
+GWin32RegistryValueType val_type;
+gchar *val_data;
+
+if (!g_win32_registry_value_iter_init (&amp;iter, key, NULL))
+return;
+
+while (g_win32_registry_value_iter_next (&amp;iter, TRUE, NULL))
+{
+if ((!g_win32_registry_value_iter_get_value_type (&amp;iter, &amp;value)) ||
+((val_type != G_WIN32_REGISTRY_VALUE_STR) &amp;&amp;
+(val_type != G_WIN32_REGISTRY_VALUE_EXPAND_STR)))
+continue;
+
+if (g_win32_registry_value_iter_get_value (&amp;iter, TRUE, &amp;name, NULL,
+&amp;val_data, NULL, NULL))
+g_print (&quot;value '%s' = '%s'\n&quot;, name, val_data);
+}
+
+g_win32_registry_value_iter_clear (&amp;iter);
+}
+]|
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="iter">
+<parameter_description> a #GWin32RegistryValueIter
+</parameter_description>
+</parameter>
+<parameter name="skip_errors">
+<parameter_description> %TRUE if iterator should silently ignore errors (such as
+the actual number of values being less than expected) and
+proceed forward
+</parameter_description>
+</parameter>
+<parameter name="error">
+<parameter_description> a pointer to %NULL #GError, or %NULL
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if next value info was retrieved, %FALSE otherwise.
+
+</return>
+</function>
+
 <function name="g_zlib_compressor_get_file_info">
 <description>
 Returns the #GZlibCompressor:file-info property.
index 7b77fa4..76295bf 100644 (file)
@@ -33,7 +33,7 @@ Icon::equal(const Glib::RefPtr<Icon>& other) const
 Glib::RefPtr<Icon> Icon::create(const std::string& str)
 {
   GError* gerror = 0;
-  GIcon* icon = g_icon_new_for_string(str.c_str(), &gerror);
+  auto icon = g_icon_new_for_string(str.c_str(), &gerror);
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
index 82d0c13..54a8262 100644 (file)
@@ -31,7 +31,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, c
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_async(gobj(),
                             buffer,
@@ -48,7 +48,7 @@ InputStream::read_async(void* buffer, gsize count, const SlotAsyncReady& slot, i
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_async(gobj(),
                             buffer,
@@ -66,7 +66,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_all_async(gobj(),
                             buffer,
@@ -83,7 +83,7 @@ InputStream::read_all_async(void* buffer, gsize count, const SlotAsyncReady& slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_all_async(gobj(),
                             buffer,
@@ -101,7 +101,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, const Gli
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_bytes_async(gobj(),
                             count,
@@ -117,7 +117,7 @@ InputStream::read_bytes_async(gsize count, const SlotAsyncReady& slot, int io_pr
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_read_bytes_async(gobj(),
                             count,
@@ -134,7 +134,7 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, const Glib::Ref
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_skip_async(gobj(),
                             count,
@@ -150,7 +150,7 @@ InputStream::skip_async(gsize count, const SlotAsyncReady& slot, int io_priority
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_skip_async(gobj(),
                             count,
@@ -166,7 +166,7 @@ InputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancella
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_close_async(gobj(),
                              io_priority,
@@ -181,7 +181,7 @@ InputStream::close_async(const SlotAsyncReady& slot, int io_priority)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_input_stream_close_async(gobj(),
                              io_priority,
index c1aae46..49b8280 100644 (file)
@@ -31,7 +31,7 @@ IOStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_io_stream_close_async(gobj(),
                           io_priority,
@@ -46,7 +46,7 @@ IOStream::close_async(const SlotAsyncReady& slot, int io_priority)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_io_stream_close_async(gobj(),
                           io_priority,
@@ -63,7 +63,7 @@ IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_io_stream_splice_async(gobj(), Glib::unwrap(stream2),
     static_cast<GIOStreamSpliceFlags>(flags), io_priority,
@@ -77,7 +77,7 @@ IOStream::splice_async(const Glib::RefPtr<IOStream>& stream2,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_io_stream_splice_async(gobj(), Glib::unwrap(stream2),
     static_cast<GIOStreamSpliceFlags>(flags), io_priority, 0,
index 2ff4d60..c11a44b 100644 (file)
@@ -30,7 +30,7 @@ LoadableIcon::load(int size, Glib::ustring& type, const Glib::RefPtr<Cancellable
 {
   char* c_type;
   GError* gerror = 0;
-  Glib::RefPtr<InputStream> retval =
+  auto retval =
       Glib::wrap(g_loadable_icon_load(gobj(),
                  size,
                  &c_type,
@@ -51,7 +51,7 @@ LoadableIcon::load(int size, Glib::ustring& type)
 {
   char* c_type;
   GError* gerror = 0;
-  Glib::RefPtr<InputStream> retval =
+  auto retval =
       Glib::wrap(g_loadable_icon_load(gobj(),
                  size,
                  &c_type,
@@ -74,7 +74,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot, const
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_loadable_icon_load_async(gobj(),
                              size,
@@ -89,7 +89,7 @@ LoadableIcon::load_async(int size, const SlotAsyncReady& slot)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_loadable_icon_load_async(gobj(),
                              size,
index 0dfd768..344506d 100644 (file)
@@ -41,7 +41,7 @@ private:
 
 void destroy_data_callback(void* user_data)
 {
-  SlotWithData* slot_with_data = static_cast<SlotWithData*>(user_data);
+  auto slot_with_data = static_cast<SlotWithData*>(user_data);
   g_return_if_fail(slot_with_data != 0);
 
   try
@@ -84,8 +84,8 @@ _DEPRECATE_IFDEF_END
 
 void MemoryInputStream::add_data(const void* data, gssize len, const SlotDestroyData& destroy_slot)
 {
-  SlotWithData* slot_with_data = new SlotWithData(destroy_slot, const_cast<void*>(data));
-  GBytes* bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data);
+  auto slot_with_data = new SlotWithData(destroy_slot, const_cast<void*>(data));
+  auto bytes = g_bytes_new_with_free_func(data, len, &destroy_data_callback, slot_with_data);
   g_memory_input_stream_add_bytes(gobj(), bytes);
   g_bytes_unref(bytes); // g_memory_input_stream_add_bytes() takes a reference
 }
index 6d1ac66..522a700 100644 (file)
@@ -32,7 +32,7 @@ void Mount::unmount(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_unmount_with_operation(gobj(),
                                  GMountUnmountFlags(flags),
@@ -47,7 +47,7 @@ void Mount::unmount(const SlotAsyncReady& slot, MountUnmountFlags flags)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_unmount_with_operation(gobj(),
                                  GMountUnmountFlags(flags),
@@ -73,7 +73,7 @@ void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_unmount_with_operation(gobj(),
                                  GMountUnmountFlags(flags),
@@ -89,7 +89,7 @@ void Mount::unmount(const Glib::RefPtr<MountOperation>& mount_operation,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_unmount_with_operation(gobj(),
                                  GMountUnmountFlags(flags),
@@ -116,7 +116,7 @@ void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsy
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_remount(gobj(),
                   static_cast<GMountMountFlags>(flags),
@@ -131,7 +131,7 @@ void Mount::remount(const Glib::RefPtr<MountOperation>& operation, const SlotAsy
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_remount(gobj(),
                   static_cast<GMountMountFlags>(flags),
@@ -166,7 +166,7 @@ void Mount::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>& c
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_eject_with_operation(gobj(),
                                GMountUnmountFlags(flags),
@@ -181,7 +181,7 @@ void Mount::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_eject_with_operation(gobj(),
                                GMountUnmountFlags(flags),
@@ -206,7 +206,7 @@ void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_eject_with_operation(gobj(),
                                GMountUnmountFlags(flags),
@@ -221,7 +221,7 @@ void Mount::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Slo
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_eject_with_operation(gobj(),
                                GMountUnmountFlags(flags),
@@ -247,7 +247,7 @@ void Mount::guess_content_type(const SlotAsyncReady& slot, const Glib::RefPtr<Ca
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_guess_content_type(gobj(),
                   force_rescan,
@@ -261,7 +261,7 @@ void Mount::guess_content_type(const SlotAsyncReady& slot, bool force_rescan)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_mount_guess_content_type(gobj(),
                   force_rescan,
index 182b507..20cae4a 100644 (file)
@@ -29,7 +29,7 @@ Glib::RefPtr<NetworkAddress>
 NetworkAddress::parse(const std::string& host_and_port, guint16 default_port)
 {
     GError *error = 0;
-    GNetworkAddress *address = G_NETWORK_ADDRESS
+    auto *address = G_NETWORK_ADDRESS
         (g_network_address_parse (host_and_port.c_str (), default_port,
                                                         &error));
     if (error)
index aaa5ee1..550a6ac 100644 (file)
@@ -26,7 +26,7 @@ void NetworkMonitor::can_reach_async(const Glib::RefPtr<SocketConnectable>& conn
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_network_monitor_can_reach_async(gobj(),
     Glib::unwrap(connectable),
index 0ed1e13..5ac47fb 100644 (file)
@@ -30,7 +30,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_write_async(gobj(),
                               buffer,
@@ -47,7 +47,7 @@ OutputStream::write_async(const void* buffer, gsize count, const SlotAsyncReady&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_write_async(gobj(),
                               buffer,
@@ -66,7 +66,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_write_all_async(gobj(),
                               buffer,
@@ -83,7 +83,7 @@ OutputStream::write_all_async(const void* buffer, gsize count, const SlotAsyncRe
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_write_all_async(gobj(),
                               buffer,
@@ -101,7 +101,7 @@ OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAs
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_splice_async(gobj(),
                                Glib::unwrap(source),
@@ -118,7 +118,7 @@ OutputStream::splice_async(const Glib::RefPtr<InputStream>& source, const SlotAs
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_splice_async(gobj(),
                                Glib::unwrap(source),
@@ -135,7 +135,7 @@ OutputStream::flush_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancell
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_flush_async(gobj(),
                               io_priority,
@@ -150,7 +150,7 @@ OutputStream::flush_async(const SlotAsyncReady& slot, int io_priority)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_flush_async(gobj(),
                               io_priority,
@@ -165,7 +165,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, const Glib::RefPtr<Cancell
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_close_async(gobj(),
                               io_priority,
@@ -180,7 +180,7 @@ OutputStream::close_async(const SlotAsyncReady& slot, int io_priority)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_output_stream_close_async(gobj(),
                               io_priority,
index 232333e..f524836 100644 (file)
@@ -31,7 +31,7 @@ void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_proxy_connect_async(gobj(),
     Glib::unwrap(connection),
@@ -46,7 +46,7 @@ void Proxy::connect_async(const Glib::RefPtr<IOStream>& connection, const Glib::
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_proxy_connect_async(gobj(),
     Glib::unwrap(connection),
index 3fd2d6a..01a93b8 100644 (file)
@@ -30,7 +30,7 @@ namespace Gio
 std::vector<Glib::ustring> ProxyResolver::lookup(const Glib::ustring& uri)
 {
   GError* gerror = 0;
-  std::vector<Glib::ustring> retvalue =
+  auto retvalue =
     Glib::ArrayHandler<Glib::ustring>::array_to_vector(g_proxy_resolver_lookup(gobj(), uri.c_str(), 0, &(gerror)), Glib::OWNERSHIP_DEEP);
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
@@ -43,7 +43,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_proxy_resolver_lookup_async(gobj(),
     uri.c_str(),
@@ -57,7 +57,7 @@ void ProxyResolver::lookup_async(const Glib::ustring& uri, const SlotAsyncReady&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_proxy_resolver_lookup_async(gobj(),
     uri.c_str(),
index 2f5f694..0c5f959 100644 (file)
@@ -39,7 +39,7 @@ Resolver::lookup_by_name_async(const Glib::ustring& hostname,
                                const SlotAsyncReady& slot,
                                const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_by_name_async (gobj(),
                                    hostname.c_str(),
@@ -52,7 +52,7 @@ void
 Resolver::lookup_by_name_async(const Glib::ustring& hostname,
                                const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_by_name_async (gobj(),
                                    hostname.c_str(),
@@ -66,7 +66,7 @@ Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address,
                                   const SlotAsyncReady& slot,
                                   const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_by_address_async (gobj(),
                                       Glib::unwrap(address),
@@ -79,7 +79,7 @@ void
 Resolver::lookup_by_address_async(const Glib::RefPtr<InetAddress>& address,
                                   const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_by_address_async (gobj(),
                                       Glib::unwrap(address),
@@ -95,7 +95,7 @@ Resolver::lookup_service_async(const Glib::ustring& service,
                                const SlotAsyncReady& slot,
                                const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_service_async (gobj(),
                                    service.c_str(),
@@ -112,7 +112,7 @@ Resolver::lookup_service_async(const Glib::ustring& service,
                                const Glib::ustring& domain,
                                const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_service_async (gobj(),
                                    service.c_str(),
@@ -129,7 +129,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname,
                                const SlotAsyncReady& slot,
                                const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_records_async(gobj(),
                                   (rrname.empty() ? 0 : rrname.c_str()),
@@ -144,7 +144,7 @@ Resolver::lookup_records_async(const Glib::ustring& rrname,
                                ResolverRecordType record_type,
                                const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_resolver_lookup_records_async(gobj(),
                                   (rrname.empty() ? 0 : rrname.c_str()),
index 03e4807..98b6ccd 100644 (file)
@@ -24,7 +24,7 @@ namespace Gio
 
 void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) const
 {
-  GVariant* const g_value = g_settings_get_value(const_cast<GSettings*>(gobj()), key.c_str());
+  const auto g_value = g_settings_get_value(const_cast<GSettings*>(gobj()), key.c_str());
   if(!g_value)
     return;
 
@@ -33,7 +33,7 @@ void Settings::get_value(const Glib::ustring& key, Glib::VariantBase& value) con
 
 bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value) const
 {
-  GVariant* const g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str());
+  const auto g_value = g_settings_get_user_value(const_cast<GSettings*>(gobj()), key.c_str());
   if(!g_value)
     return false;
 
@@ -43,7 +43,7 @@ bool Settings::get_user_value(const Glib::ustring& key, Glib::VariantBase& value
 
 void Settings::get_default_value(const Glib::ustring& key, Glib::VariantBase& value) const
 {
-  GVariant* const g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str());
+  const auto g_value = g_settings_get_default_value(const_cast<GSettings*>(gobj()), key.c_str());
   if(!g_value)
     return;
 
index 7a4a211..107493f 100644 (file)
@@ -58,7 +58,7 @@ gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer,
 {
   GError* gerror = 0;
   GSocketAddress* caddr = 0;
-  gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror));
+  auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -72,7 +72,7 @@ gssize Socket::receive_from(Glib::RefPtr<SocketAddress>& address, char* buffer,
 {
   GError* gerror = 0;
   GSocketAddress* caddr = 0;
-  gssize retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror));
+  auto retvalue = g_socket_receive_from(gobj(), &caddr, buffer, size, 0, &(gerror));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -86,7 +86,7 @@ gssize Socket::receive_with_blocking(gchar* buffer, gsize size, bool blocking,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
   GError* gerror = 0;
-  gssize const retvalue = g_socket_receive_with_blocking(gobj(), buffer, size,
+  const auto retvalue = g_socket_receive_with_blocking(gobj(), buffer, size,
     blocking, Glib::unwrap(cancellable), &(gerror));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
@@ -98,7 +98,7 @@ gssize Socket::send_with_blocking(gchar* buffer, gsize size, bool blocking,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
   GError* gerror = 0;
-  gssize const retvalue = g_socket_send_with_blocking(gobj(), buffer, size,
+  const auto retvalue = g_socket_send_with_blocking(gobj(), buffer, size,
     blocking, Glib::unwrap(cancellable), &(gerror));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
index b783ec8..d7aca9b 100644 (file)
@@ -31,7 +31,7 @@ namespace Gio {
         // Create a copy of the slot.
         // A pointer to it will be passed through the callback's data parameter
         // and deleted in the callback.
-        SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+        auto slot_copy = new SlotAsyncReady(slot);
 
         g_socket_address_enumerator_next_async(gobj(),
                                                Glib::unwrap(cancellable),
index ec97035..6448c21 100644 (file)
@@ -32,7 +32,7 @@ SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_async (gobj(),
                                  connectable->gobj (),
@@ -48,7 +48,7 @@ SocketClient::connect_async(const Glib::RefPtr<SocketConnectable>& connectable,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_async (gobj(),
                                  connectable->gobj (),
@@ -66,7 +66,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_host_async (gobj(),
                                          host_and_port.c_str (),
@@ -84,7 +84,7 @@ SocketClient::connect_to_host_async(const Glib::ustring& host_and_port,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_host_async (gobj(),
                                          host_and_port.c_str (),
@@ -103,7 +103,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_service_async (gobj(),
                                             domain.c_str (),
@@ -121,7 +121,7 @@ SocketClient::connect_to_service_async(const Glib::ustring& domain,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_service_async (gobj(),
                                             domain.c_str (),
@@ -139,7 +139,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_uri_async (gobj(),
     uri.c_str(), default_port,
@@ -155,7 +155,7 @@ SocketClient::connect_to_uri_async(const Glib::ustring& uri, guint16 default_por
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_client_connect_to_uri_async (gobj(),
     uri.c_str(), default_port,
index 8bd8578..79094c1 100644 (file)
@@ -28,7 +28,7 @@ SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address,
                                 const SlotAsyncReady& slot,
                                 const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_connection_connect_async(gobj(),
                                     Glib::unwrap(address),
@@ -41,7 +41,7 @@ void
 SocketConnection::connect_async(const Glib::RefPtr<SocketAddress>& address,
                                 const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_connection_connect_async(gobj(),
                                     Glib::unwrap(address),
index b55c605..75552e4 100644 (file)
@@ -93,7 +93,7 @@ bool SocketListener::add_inet_port(guint16 port)
 guint16 SocketListener::add_any_inet_port()
 {
   GError* gerror = 0;
-  const guint16 retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror);
+  const auto retvalue = g_socket_listener_add_any_inet_port(gobj(), 0, &gerror);
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -105,7 +105,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+  auto retvalue = g_socket_listener_accept_socket(gobj(),
                                                       &retobj,
                                                       Glib::unwrap(cancellable),
                                                       &gerror);
@@ -122,7 +122,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+  auto retvalue = g_socket_listener_accept_socket(gobj(),
                                                       &retobj,
                                                       0,
                                                       &gerror);
@@ -138,7 +138,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(Glib::RefPtr<Glib::Object>& s
 Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellable>& cancellable)
 {
   GError* gerror = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+  auto retvalue = g_socket_listener_accept_socket(gobj(),
                                                       0,
                                                       Glib::unwrap(cancellable),
                                                       &gerror);
@@ -151,7 +151,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket(const Glib::RefPtr<Cancellabl
 Glib::RefPtr<Socket> SocketListener::accept_socket()
 {
   GError* gerror = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket(gobj(),
+  auto retvalue = g_socket_listener_accept_socket(gobj(),
                                                       0,
                                                       0,
                                                       &gerror);
@@ -167,7 +167,7 @@ void SocketListener::accept_socket_async(const Glib::RefPtr<Cancellable>& cancel
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_listener_accept_socket_async(gobj(),
                                         Glib::unwrap(cancellable),
@@ -180,7 +180,7 @@ void SocketListener::accept_socket_async(const SlotAsyncReady& slot)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_listener_accept_socket_async(gobj(),
                                         0,
@@ -192,7 +192,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<Asy
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(),
+  auto retvalue = g_socket_listener_accept_socket_finish(gobj(),
                                                              Glib::unwrap(result),
                                                              &retobj,
                                                              &gerror);
@@ -207,7 +207,7 @@ Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<Asy
 Glib::RefPtr<Socket> SocketListener::accept_socket_finish(const Glib::RefPtr<AsyncResult>& result)
 {
   GError* gerror = 0;
-  GSocket* retvalue = g_socket_listener_accept_socket_finish(gobj(),
+  auto retvalue = g_socket_listener_accept_socket_finish(gobj(),
                                                              Glib::unwrap(result),
                                                              0,
                                                              &gerror);
@@ -222,7 +222,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+  auto retvalue = g_socket_listener_accept(gobj(),
                                                          &retobj,
                                                          Glib::unwrap(cancellable),
                                                          &gerror);
@@ -239,7 +239,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+  auto retvalue = g_socket_listener_accept(gobj(),
                                                          &retobj,
                                                          0,
                                                          &gerror);
@@ -255,7 +255,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(Glib::RefPtr<Object>& sour
 Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancellable>& cancellable)
 {
   GError* gerror = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+  auto retvalue = g_socket_listener_accept(gobj(),
                                                          0,
                                                          Glib::unwrap(cancellable),
                                                          &gerror);
@@ -268,7 +268,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept(const Glib::RefPtr<Cancell
 Glib::RefPtr<SocketConnection> SocketListener::accept()
 {
   GError* gerror = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept(gobj(),
+  auto retvalue = g_socket_listener_accept(gobj(),
                                                          0,
                                                          0,
                                                          &gerror);
@@ -284,7 +284,7 @@ void SocketListener::accept_async(const SlotAsyncReady& slot)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_listener_accept_async(gobj(),
                                  0,
@@ -297,7 +297,7 @@ void SocketListener::accept_async(const Glib::RefPtr<Cancellable>& cancellable,
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_socket_listener_accept_async(gobj(),
                                  Glib::unwrap(cancellable),
@@ -309,7 +309,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<
 {
   GError* gerror = 0;
   GObject *retobj = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(),
+  auto retvalue = g_socket_listener_accept_finish(gobj(),
                                                                 Glib::unwrap(result),
                                                                 &retobj,
                                                                 &gerror);
@@ -324,7 +324,7 @@ Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<
 Glib::RefPtr<SocketConnection> SocketListener::accept_finish(const Glib::RefPtr<AsyncResult>& result)
 {
   GError* gerror = 0;
-  GSocketConnection* retvalue = g_socket_listener_accept_finish(gobj(),
+  auto retvalue = g_socket_listener_accept_finish(gobj(),
                                                                 Glib::unwrap(result),
                                                                 0,
                                                                 &gerror);
index 2341973..bddc969 100644 (file)
@@ -27,7 +27,7 @@ namespace Gio
 void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_unix_connection_receive_credentials_async(gobj(),
                                               Glib::unwrap(cancellable),
@@ -37,7 +37,7 @@ void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot,
 
 void UnixConnection::receive_credentials_async(const SlotAsyncReady& slot)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_unix_connection_receive_credentials_async(gobj(),
                                               0,
@@ -49,7 +49,7 @@ void
 UnixConnection::send_credentials_async(const SlotAsyncReady& slot,
   const Glib::RefPtr<Cancellable>& cancellable)
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_unix_connection_send_credentials_async(gobj(),
                                            Glib::unwrap(cancellable),
@@ -61,7 +61,7 @@ void
 UnixConnection::send_credentials_async(const SlotAsyncReady& slot)
 
 {
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_unix_connection_send_credentials_async(gobj(),
                                            0,
index aa26c9c..b17b0f6 100644 (file)
@@ -50,7 +50,7 @@ UnixFDList::UnixFDList(const Glib::ArrayHandle<int>& fds, int n_fds)
 const Glib::ArrayHandle<int> UnixFDList::peek_fds() const
 {
   int length = 0;
-  const int* fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()), &length);
+  const auto fds = g_unix_fd_list_peek_fds(const_cast<GUnixFDList*>(gobj()), &length);
   // The array is terminated with a -1, but that terminating element is
   // not included in the length that g_unix_fd_list_peek_fds() returns.
   return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_NONE);
@@ -59,7 +59,7 @@ const Glib::ArrayHandle<int> UnixFDList::peek_fds() const
 Glib::ArrayHandle<int> UnixFDList::steal_fds()
 {
   int length = 0;
-  const int* fds = g_unix_fd_list_steal_fds(gobj(), &length);
+  const auto fds = g_unix_fd_list_steal_fds(gobj(), &length);
   // The array is terminated with a -1, but that terminating element is
   // not included in the length that g_unix_fd_list_steal_fds() returns.
   return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_DEEP);
index d112bb6..7849a20 100644 (file)
@@ -25,7 +25,7 @@ namespace Gio
 Glib::ArrayHandle<int> UnixFDMessage::steal_fds()
 {
   int length = 0;
-  const int* fds = g_unix_fd_message_steal_fds(gobj(), &length);
+  const auto fds = g_unix_fd_message_steal_fds(gobj(), &length);
   // The array is terminated with a -1, but that terminating element is
   // not included in the length that g_unix_fd_message_steal_fds() returns.
   return Glib::ArrayHandle<int>(fds, length, Glib::OWNERSHIP_DEEP);
index d06790a..0bffbcb 100644 (file)
@@ -33,7 +33,7 @@ Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsy
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_mount(gobj(),
                  static_cast<GMountMountFlags>(flags),
@@ -50,7 +50,7 @@ Volume::mount(const Glib::RefPtr<MountOperation>& mount_operation, const SlotAsy
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_mount(gobj(),
                  static_cast<GMountMountFlags>(flags),
@@ -88,7 +88,7 @@ void Volume::eject(const SlotAsyncReady& slot, const Glib::RefPtr<Cancellable>&
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_eject_with_operation(gobj(),
                                 static_cast<GMountUnmountFlags>(flags),
@@ -103,7 +103,7 @@ void Volume::eject(const SlotAsyncReady& slot, MountUnmountFlags flags)
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_eject_with_operation(gobj(),
                                 static_cast<GMountUnmountFlags>(flags),
@@ -128,7 +128,7 @@ void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Sl
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_eject_with_operation(gobj(),
                                 static_cast<GMountUnmountFlags>(flags),
@@ -143,7 +143,7 @@ void Volume::eject(const Glib::RefPtr<MountOperation>& mount_operation, const Sl
   // Create a copy of the slot.
   // A pointer to it will be passed through the callback's data parameter
   // and deleted in the callback.
-  SlotAsyncReady* slot_copy = new SlotAsyncReady(slot);
+  auto slot_copy = new SlotAsyncReady(slot);
 
   g_volume_eject_with_operation(gobj(),
                                 static_cast<GMountUnmountFlags>(flags),
index f6257f3..4fa95da 100644 (file)
@@ -197,7 +197,7 @@ DispatchNotifier::DispatchNotifier(const Glib::RefPtr<MainContext>& context)
     //   sigc::mem_fun(*this, &DispatchNotifier::pipe_io_handler), fd, Glib::IO_IN);
     // except for source->set_can_recurse(true).
 
-    const Glib::RefPtr<IOSource> source = IOSource::create(fd, Glib::IO_IN);
+    const auto source = IOSource::create(fd, Glib::IO_IN);
 
     // If the signal emission in pipe_io_handler() starts a new main loop,
     // the event source shall not be blocked while that loop runs. (E.g. while
index 5784414..d55cb43 100644 (file)
@@ -42,9 +42,9 @@ Error::Error()
   gobject_ (0)
 {}
 
-Error::Error(GQuark domain, int code, const Glib::ustring& message)
+Error::Error(GQuark error_domain, int error_code, const Glib::ustring& message)
 :
-  gobject_ (g_error_new_literal(domain, code, message.c_str()))
+  gobject_ (g_error_new_literal(error_domain, error_code, message.c_str()))
 {}
 
 Error::Error(GError* gobject, bool take_copy)
@@ -103,9 +103,9 @@ Glib::ustring Error::what() const
   return gobject_->message;
 }
 
-bool Error::matches(GQuark domain, int code) const
+bool Error::matches(GQuark error_domain, int error_code) const
 {
-  return g_error_matches(gobject_, domain, code);
+  return g_error_matches(gobject_, error_domain, error_code);
 }
 
 GError* Error::gobj()
@@ -146,11 +146,11 @@ void Error::register_cleanup()
 }
 
 // static
-void Error::register_domain(GQuark domain, Error::ThrowFunc throw_func)
+void Error::register_domain(GQuark error_domain, Error::ThrowFunc throw_func)
 {
   g_assert(throw_func_table != 0);
 
-  (*throw_func_table)[domain] = throw_func;
+  (*throw_func_table)[error_domain] = throw_func;
 }
 
 // static, noreturn
index b68df85..d2701da 100644 (file)
@@ -32,7 +32,7 @@ class Error : public Glib::Exception
 {
 public:
   Error();
-  Error(GQuark domain, int code, const Glib::ustring& message);
+  Error(GQuark error_domain, int error_code, const Glib::ustring& message);
   explicit Error(GError* gobject, bool take_copy = false);
 
   Error(const Error& other);
@@ -44,7 +44,7 @@ public:
   int code() const;
   virtual Glib::ustring what() const;
 
-  bool matches(GQuark domain, int code) const;
+  bool matches(GQuark error_domain, int error_code) const;
 
   GError* gobj();
   const GError* gobj() const;
@@ -57,7 +57,7 @@ public:
 
   static void register_init();
   static void register_cleanup();
-  static void register_domain(GQuark domain, ThrowFunc throw_func);
+  static void register_domain(GQuark error_domain, ThrowFunc throw_func);
 
   static void throw_exception(GError* gobject) G_GNUC_NORETURN;
 
index 1955be1..d9a1c95 100644 (file)
@@ -117,7 +117,7 @@ public:
   {
     size_type j = 0;
     iterator i;
-    for(i = begin(), j = 0; i != end(), j < l; ++i, ++j)
+    for(i = begin(), j = 0; i != end() && j < l; ++i, ++j)
       ;
     return (*i);
   }
index 1d9d915..81ffa40 100644 (file)
@@ -497,7 +497,7 @@ SignalIO::SignalIO(GMainContext* context)
 sigc::connection SignalIO::connect(const sigc::slot<bool,IOCondition>& slot,
                                    int fd, IOCondition condition, int priority)
 {
-  const Glib::RefPtr<IOSource> source = IOSource::create(fd, condition);
+  const auto source = IOSource::create(fd, condition);
 
   if(priority != G_PRIORITY_DEFAULT)
     source->set_priority(priority);
@@ -513,7 +513,7 @@ sigc::connection SignalIO::connect(const sigc::slot<bool,IOCondition>& slot,
                                    const Glib::RefPtr<IOChannel>& channel,
                                    IOCondition condition, int priority)
 {
-  const Glib::RefPtr<IOSource> source = IOSource::create(channel, condition);
+  const auto source = IOSource::create(channel, condition);
 
   if(priority != G_PRIORITY_DEFAULT)
     source->set_priority(priority);
index 94d495c..30b40a6 100644 (file)
@@ -107,7 +107,7 @@ public:
    * is equivalent to:
    * @code
    * bool timeout_handler() { ... }
-   * const Glib::RefPtr<Glib::TimeoutSource> timeout_source = Glib::TimeoutSource::create(1000);
+   * const auto timeout_source = Glib::TimeoutSource::create(1000);
    * timeout_source->connect(sigc::ptr_fun(&timeout_handler));
    * timeout_source->attach(Glib::MainContext::get_default());
    * @endcode
@@ -165,7 +165,7 @@ public:
    * is equivalent to:
    * @code
    * bool timeout_handler() { ... }
-   * const Glib::RefPtr<Glib::TimeoutSource> timeout_source = Glib::TimeoutSource::create(5000);
+   * const auto timeout_source = Glib::TimeoutSource::create(5000);
    * timeout_source->connect(sigc::ptr_fun(&timeout_handler));
    * timeout_source->attach(Glib::MainContext::get_default());
    * @endcode
@@ -232,7 +232,7 @@ public:
    * is equivalent to:
    * @code
    * bool idle_handler() { ... }
-   * const Glib::RefPtr<Glib::IdleSource> idle_source = Glib::IdleSource::create();
+   * const auto idle_source = Glib::IdleSource::create();
    * idle_source->connect(sigc::ptr_fun(&idle_handler));
    * idle_source->attach(Glib::MainContext::get_default());
    * @endcode
@@ -291,7 +291,7 @@ public:
    * is equivalent to:
    * @code
    * bool io_handler(Glib::IOCondition io_condition) { ... }
-   * const Glib::RefPtr<Glib::IOSource> io_source = Glib::IOSource::create(fd, Glib::IO_IN | Glib::IO_HUP);
+   * const auto io_source = Glib::IOSource::create(fd, Glib::IO_IN | Glib::IO_HUP);
    * io_source->connect(sigc::ptr_fun(&io_handler));
    * io_source->attach(Glib::MainContext::get_default());
    * @endcode
@@ -319,7 +319,7 @@ public:
    * is equivalent to:
    * @code
    * bool io_handler(Glib::IOCondition io_condition) { ... }
-   * const Glib::RefPtr<Glib::IOSource> io_source = Glib::IOSource::create(channel, Glib::IO_IN | Glib::IO_HUP);
+   * const auto io_source = Glib::IOSource::create(channel, Glib::IO_IN | Glib::IO_HUP);
    * io_source->connect(sigc::ptr_fun(&io_handler));
    * io_source->attach(Glib::MainContext::get_default());
    * @endcode
index e5201db..8a1b10a 100644 (file)
@@ -133,23 +133,23 @@ IOStatus StreamIOChannel::close_vfunc()
 {
   bool failed = false;
 
-  if(std::fstream *const stream = dynamic_cast<std::fstream*>(stream_in_))
+  if(std::fstream *const fstream = dynamic_cast<std::fstream*>(stream_in_))
   {
-    stream->clear();
-    stream->close();
-    failed = stream->fail();
+    fstream->clear();
+    fstream->close();
+    failed = fstream->fail();
   }
-  else if(std::ifstream *const stream = dynamic_cast<std::ifstream*>(stream_in_))
+  else if(std::ifstream *const ifstream = dynamic_cast<std::ifstream*>(stream_in_))
   {
-    stream->clear();
-    stream->close();
-    failed = stream->fail();
+    ifstream->clear();
+    ifstream->close();
+    failed = ifstream->fail();
   }
-  else if(std::ofstream *const stream = dynamic_cast<std::ofstream*>(stream_out_))
+  else if(std::ofstream *const ofstream = dynamic_cast<std::ofstream*>(stream_out_))
   {
-    stream->clear();
-    stream->close();
-    failed = stream->fail();
+    ofstream->clear();
+    ofstream->close();
+    failed = ofstream->fail();
   }
   else
   {
index bc7590c..ad6b6ef 100644 (file)
@@ -305,7 +305,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const
   struct tm tm_data;
   g_date_to_struct_tm(&gobject_, &tm_data);
 
-  const std::string locale_format = locale_from_utf8(format);
+  const auto locale_format = locale_from_utf8(format);
 
   gsize bufsize = std::max<gsize>(2 * locale_format.size(), 128);
 
@@ -316,7 +316,7 @@ Glib::ustring Date::format_string(const Glib::ustring& format) const
     // Set the first byte to something other than '\0', to be able to
     // recognize whether strftime actually failed or just returned "".
     buf.get()[0] = '\1';
-    const gsize len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data);
+    const auto len = strftime(buf.get(), bufsize, locale_format.c_str(), &tm_data);
 
     if(len != 0 || buf.get()[0] == '\0')
     {
index a9c4221..82bcd56 100644 (file)
@@ -149,7 +149,7 @@ public:
   _WRAP_METHOD(DateTime to_timezone(const TimeZone& tz) const, g_date_time_to_timezone)
   _WRAP_METHOD(DateTime to_local() const, g_date_time_to_local)
   _WRAP_METHOD(DateTime to_utc() const, g_date_time_to_utc)
-  _WRAP_METHOD(Glib::ustring format(const Glib::ustring& format) const, g_date_time_format)
+  _WRAP_METHOD(Glib::ustring format(const Glib::ustring& format_str) const, g_date_time_format)
 };
 
 } // namespace Glib
index 59fe145..42be941 100644 (file)
@@ -125,7 +125,7 @@ bool file_test(const std::string& filename, FileTest test)
 int mkstemp(std::string& filename_template)
 {
   const ScopedPtr<char> buf (g_strndup(filename_template.data(), filename_template.size()));
-  const int fileno = g_mkstemp(buf.get());
+  const auto fileno = g_mkstemp(buf.get());
 
   filename_template = buf.get();
   return fileno;
@@ -139,7 +139,7 @@ int file_open_tmp(std::string& name_used, const std::string& prefix)
   GError* error = 0;
   ScopedPtr<char> buf_name_used;
 
-  const int fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error);
+  const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error);
 
   if(error)
     Glib::Error::throw_exception(error);
@@ -153,7 +153,7 @@ int file_open_tmp(std::string& name_used)
   GError* error = 0;
   ScopedPtr<char> buf_name_used;
 
-  const int fileno = g_file_open_tmp(0, buf_name_used.addr(), &error);
+  const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error);
 
   if(error)
     Glib::Error::throw_exception(error);
index 99b8218..1708607 100644 (file)
@@ -5468,6 +5468,54 @@ Pushes the @data into the @queue. @data must not be %NULL.
 <return></return>
 </function>
 
+<function name="g_async_queue_push_front">
+<description>
+Pushes the @data into the @queue. @data must not be %NULL.
+In contrast to g_async_queue_push(), this function
+pushes the new item ahead of the items already in the queue,
+so that it will be the next one to be popped off the queue.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="queue">
+<parameter_description> a #GAsyncQueue
+</parameter_description>
+</parameter>
+<parameter name="data">
+<parameter_description> @data to push into the @queue
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
+<function name="g_async_queue_push_front_unlocked">
+<description>
+Pushes the @data into the @queue. @data must not be %NULL.
+In contrast to g_async_queue_push_unlocked(), this function
+pushes the new item ahead of the items already in the queue,
+so that it will be the next one to be popped off the queue.
+
+This function must be called while holding the @queue's lock.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="queue">
+<parameter_description> a #GAsyncQueue
+</parameter_description>
+</parameter>
+<parameter name="data">
+<parameter_description> @data to push into the @queue
+</parameter_description>
+</parameter>
+</parameters>
+<return></return>
+</function>
+
 <function name="g_async_queue_push_sorted">
 <description>
 Inserts @data into @queue using @func to determine the new
@@ -5602,6 +5650,52 @@ lock.
 <return></return>
 </function>
 
+<function name="g_async_queue_remove">
+<description>
+Remove an item from the queue. This function does not block.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="queue">
+<parameter_description> a #GAsyncQueue
+</parameter_description>
+</parameter>
+<parameter name="data">
+<parameter_description> the @data to remove from the @queue
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the item was removed
+
+</return>
+</function>
+
+<function name="g_async_queue_remove_unlocked">
+<description>
+Remove an item from the queue. This function does not block.
+
+This function must be called while holding the @queue's lock.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="queue">
+<parameter_description> a #GAsyncQueue
+</parameter_description>
+</parameter>
+<parameter name="data">
+<parameter_description> the @data to remove from the @queue
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the item was removed
+
+</return>
+</function>
+
 <function name="g_async_queue_sort">
 <description>
 Sorts @queue using @func.
@@ -47391,6 +47485,29 @@ Returns the number of currently unused threads.
 </return>
 </function>
 
+<function name="g_thread_pool_move_to_front">
+<description>
+Moves the item to the front of the queue of unprocessed
+items, so that it will be processed next.
+
+Since: 2.46
+
+</description>
+<parameters>
+<parameter name="pool">
+<parameter_description> a #GThreadPool
+</parameter_description>
+</parameter>
+<parameter name="data">
+<parameter_description> an unprocessed item in the pool
+</parameter_description>
+</parameter>
+</parameters>
+<return> %TRUE if the item was found and moved
+
+</return>
+</function>
+
 <function name="g_thread_pool_new">
 <description>
 This function creates a new thread pool.
index b93b6ce..8617a07 100644 (file)
   )
 )
 
+(define-method remove
+  (of-object "GAsyncQueue")
+  (c-name "g_async_queue_remove")
+  (return-type "gboolean")
+  (parameters
+    '("gpointer" "item")
+  )
+)
+
+(define-method remove_unlocked
+  (of-object "GAsyncQueue")
+  (c-name "g_async_queue_remove_unlocked")
+  (return-type "gboolean")
+  (parameters
+    '("gpointer" "item")
+  )
+)
+
+(define-method push_front
+  (of-object "GAsyncQueue")
+  (c-name "g_async_queue_push_front")
+  (return-type "none")
+  (parameters
+    '("gpointer" "item")
+  )
+)
+
+(define-method push_front_unlocked
+  (of-object "GAsyncQueue")
+  (c-name "g_async_queue_push_front_unlocked")
+  (return-type "none")
+  (parameters
+    '("gpointer" "item")
+  )
+)
+
 (define-method timed_pop
   (of-object "GAsyncQueue")
   (c-name "g_async_queue_timed_pop")
   )
 )
 
+(define-method move_to_front
+  (of-object "GThreadPool")
+  (c-name "g_thread_pool_move_to_front")
+  (return-type "gboolean")
+  (parameters
+    '("gpointer" "data")
+  )
+)
+
 (define-method set_max_threads
   (of-object "GThreadPool")
   (c-name "g_thread_pool_set_max_threads")
index d0a18aa..e093a50 100644 (file)
@@ -160,7 +160,7 @@ IOChannel::~IOChannel()
       reinterpret_cast<GlibmmIOChannel*>(gobject_)->wrapper = 0;
     }
 
-    GIOChannel *const tmp_gobject = gobject_;
+    const auto tmp_gobject = gobject_;
     gobject_ = 0;
 
     g_io_channel_unref(tmp_gobject);
@@ -170,7 +170,7 @@ IOChannel::~IOChannel()
 Glib::RefPtr<IOChannel> IOChannel::create_from_file(const std::string& filename, const std::string& mode)
 {
   GError* gerror = 0;
-  GIOChannel *const channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror);
+  const auto channel = g_io_channel_new_file(filename.c_str(), mode.c_str(), &gerror);
 
   if(gerror)
   {
@@ -211,7 +211,7 @@ IOStatus IOChannel::read_line(Glib::ustring& line)
   GError* gerror = 0;
   gsize   bytes = 0;
 
-  const GIOStatus status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror);
+  const auto status = g_io_channel_read_line(gobj(), buf.addr(), &bytes, 0, &gerror);
 
   if(gerror)
   {
@@ -232,7 +232,7 @@ IOStatus IOChannel::read_to_end(Glib::ustring& str)
   GError* gerror = 0;
   gsize   bytes = 0;
 
-  const GIOStatus status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror);
+  const auto status = g_io_channel_read_to_end(gobj(), buf.addr(), &bytes, &gerror);
 
   if(gerror)
   {
@@ -253,7 +253,7 @@ IOStatus IOChannel::read(Glib::ustring& str, gsize count)
   GError* gerror = 0;
   gsize   bytes = 0;
 
-  const GIOStatus status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror);
+  const auto status = g_io_channel_read_chars(gobj(), buf.get(), count, &bytes, &gerror);
 
  if(gerror)
   {
@@ -272,7 +272,7 @@ IOStatus IOChannel::set_encoding(const std::string& encoding)
 {
   GError* gerror = 0;
 
-  const GIOStatus status = g_io_channel_set_encoding(
+  const auto status = g_io_channel_set_encoding(
       gobj(), (encoding.empty()) ? 0 : encoding.c_str(), &gerror);
 
   if(gerror)
@@ -394,7 +394,7 @@ Glib::RefPtr<IOChannel> wrap(GIOChannel* gobject, bool take_copy)
 GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
                                    gsize* bytes_read, GError** err)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
@@ -415,7 +415,7 @@ GIOStatus GlibmmIOChannel::io_read(GIOChannel* channel, char* buf, gsize count,
 GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize count,
                                     gsize* bytes_written, GError** err)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
@@ -435,7 +435,7 @@ GIOStatus GlibmmIOChannel::io_write(GIOChannel* channel, const char* buf, gsize
 
 GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType type, GError** err)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
@@ -455,7 +455,7 @@ GIOStatus GlibmmIOChannel::io_seek(GIOChannel* channel, gint64 offset, GSeekType
 
 GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
@@ -477,11 +477,11 @@ GIOStatus GlibmmIOChannel::io_close(GIOChannel* channel, GError** err)
 // static
 GSource* GlibmmIOChannel::io_create_watch(GIOChannel* channel, GIOCondition condition)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
-    const Glib::RefPtr<Source> source = wrapper->create_watch_vfunc((IOCondition) condition);
+    const auto source = wrapper->create_watch_vfunc((IOCondition) condition);
     return (source) ? source->gobj_copy() : 0;
   }
   catch(...)
@@ -506,7 +506,7 @@ void GlibmmIOChannel::io_free(GIOChannel* channel)
 
 GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GError** err)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
@@ -527,7 +527,7 @@ GIOStatus GlibmmIOChannel::io_set_flags(GIOChannel* channel, GIOFlags flags, GEr
 // static
 GIOFlags GlibmmIOChannel::io_get_flags(GIOChannel* channel)
 {
-  IOChannel *const wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
+  const auto wrapper = reinterpret_cast<GlibmmIOChannel*>(channel)->wrapper;
 
   try
   {
index 3c3d530..93bf749 100644 (file)
@@ -269,11 +269,11 @@ public:
    * Any pending data to be written will be flushed if @a flush is <tt>true</tt>.
    * The channel will not be freed until the last reference is dropped.
    * Accessing the channel after closing it is considered an error.
-   * @param flush Whether to flush() pending data before closing the channel.
+   * @param flush_pending Whether to flush() pending data before closing the channel.
    * @return The status of the operation.
    * @throw Glib::IOChannelError
    */
-  _WRAP_METHOD(IOStatus close(bool flush = true), g_io_channel_shutdown, errthrow)
+  _WRAP_METHOD(IOStatus close(bool flush_pending = true), g_io_channel_shutdown, errthrow)
 
   /** Get the IOChannel internal buffer size.
    * @return The buffer size.
index 601b928..ecc1ac8 100644 (file)
@@ -84,7 +84,7 @@ void OptionContext::set_main_group(OptionGroup& group)
 /*
 OptionGroup OptionContext::get_main_group() const
 {
-  const GOptionGroup* cobj = g_option_context_get_main_group(const_cast<GOptionContext*>( gobj()) );
+  const auto cobj = g_option_context_get_main_group(const_cast<GOptionContext*>( gobj()) );
   OptionGroup cppObj(const_cast<GOptionGroup*>(cobj), true); // take_copy
   return cppObj;
 }
@@ -95,7 +95,7 @@ void OptionContext::set_translate_func (const SlotTranslate& slot)
 {
   //Create a copy of the slot. A pointer to this will be passed through the callback's data parameter.
   //It will be deleted when SignalProxy_translate_gtk_callback_destroy() is called.
-  SlotTranslate* slot_copy = new SlotTranslate(slot);
+  auto slot_copy = new SlotTranslate(slot);
 
   g_option_context_set_translate_func(
       gobj(), &OptionContextPrivate::SignalProxy_translate_gtk_callback, slot_copy,
index da0f0b8..42313bc 100644 (file)
@@ -75,7 +75,7 @@ static gboolean g_callback_pre_parse(GOptionContext* context,
 {
   OptionContext cppContext(context, false /* take_ownership */);
 
-  OptionGroup* option_group = static_cast<OptionGroup*>(data);
+  auto option_group = static_cast<OptionGroup*>(data);
   if(!option_group)
   {
     OptionError(OptionError::FAILED, "Glib::OptionGroup: g_callback_pre_parse(): "
@@ -108,7 +108,7 @@ static void g_callback_error(GOptionContext* context,
 
   OptionContext cppContext(context, false /* take_ownership */);
 
-  OptionGroup* option_group = static_cast<OptionGroup*>(data);
+  auto option_group = static_cast<OptionGroup*>(data);
   if(option_group)
     return option_group->on_error(cppContext, *option_group);
 }
@@ -157,10 +157,9 @@ gboolean OptionGroup::post_parse_callback(GOptionContext* context,
 
   //The C args have now been given values by g_option_context_parse().
   //Convert C values to C++ values:
-  for(type_map_entries::iterator iter = option_group->map_entries_.begin();
-      iter != option_group->map_entries_.end(); ++iter)
+  for(auto& the_pair : option_group->map_entries_)
   {
-    CppOptionEntry& cpp_entry = iter->second;
+    auto& cpp_entry = the_pair.second;
     cpp_entry.convert_c_to_cpp();
   }
 
@@ -198,17 +197,17 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar*
   if(option_name[1] == '-')
   {
     //Long option name.
-    const Glib::ustring long_option_name = Glib::ustring(option_name+2);
+    const auto long_option_name = Glib::ustring(option_name+2);
     iterFind = option_group->map_entries_.find(long_option_name);
   }
   else
   {
     //Short option name.
-    const gchar short_option_name = option_name[1];
+    const auto short_option_name = option_name[1];
     for(iterFind = option_group->map_entries_.begin();
         iterFind != option_group->map_entries_.end(); ++iterFind)
     {
-      const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second;
+      const auto& cppOptionEntry = iterFind->second;
       if (cppOptionEntry.entry_ &&
           cppOptionEntry.entry_->get_short_name() == short_option_name)
         break;
@@ -222,7 +221,7 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar*
     return false;
   }
 
-  const OptionGroup::CppOptionEntry& cppOptionEntry = iterFind->second;
+  const auto& cppOptionEntry = iterFind->second;
   if (cppOptionEntry.carg_type_ != G_OPTION_ARG_CALLBACK)
   {
     OptionError(OptionError::FAILED, "Glib::OptionGroup::option_arg_callback() "
@@ -237,13 +236,13 @@ gboolean OptionGroup::option_arg_callback(const gchar* option_name, const gchar*
   {
     if (option_arg->is_filename_option())
     {
-      const OptionGroup::SlotOptionArgFilename* the_slot = option_arg->get_slot_filename();
+      const auto the_slot = option_arg->get_slot_filename();
       const std::string cpp_value(value ? value : "");
       return (*the_slot)(cpp_option_name, cpp_value, has_value);
     }
     else
     {
-      const OptionGroup::SlotOptionArgString* the_slot = option_arg->get_slot_string();
+      const auto the_slot = option_arg->get_slot_string();
       const Glib::ustring cpp_value(value ? value : "");
       return (*the_slot)(cpp_option_name, cpp_value, has_value);
     }
@@ -286,9 +285,9 @@ OptionGroup::OptionGroup(GOptionGroup* castitem)
 OptionGroup::~OptionGroup()
 {
   //Free any C types that were allocated during add_entry():
-  for(type_map_entries::iterator iter = map_entries_.begin(); iter != map_entries_.end(); ++iter)
+  for(auto& the_pair : map_entries_)
   {
-    CppOptionEntry& cpp_entry = iter->second;
+    auto& cpp_entry = the_pair.second;
     cpp_entry.release_c_arg();
   }
 
@@ -375,7 +374,7 @@ void OptionGroup::add_entry_filename(const OptionEntry& entry, const SlotOptionA
 
 void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg arg_type, void* cpp_arg)
 {
-  const Glib::ustring name = entry.get_long_name();
+  const auto name = entry.get_long_name();
   type_map_entries::iterator iterFind = map_entries_.find(name);
   if (iterFind == map_entries_.end()) //If we have not added this entry already
   {
@@ -395,7 +394,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar
       for (type_map_entries::iterator iter = map_entries_.begin();
            iter != map_entries_.end(); ++iter)
       {
-        const CppOptionEntry& cpp_entry = iter->second;
+        const auto& cpp_entry = iter->second;
         if (cpp_entry.cpparg_ == cpp_arg &&
             cpp_entry.carg_type_ == arg_type &&
             cpp_entry.carg_)
@@ -429,7 +428,7 @@ void OptionGroup::add_entry_with_wrapper(const OptionEntry& entry, GOptionArg ar
   {
     //Delete the OptionArgCallback instance that was allocated by add_entry()
     //or add_entry_filename().
-    OptionArgCallback* option_arg = static_cast<OptionArgCallback*>(cpp_arg);
+    auto option_arg = static_cast<OptionArgCallback*>(cpp_arg);
     delete option_arg;
   }
 }
@@ -454,7 +453,7 @@ void OptionGroup::set_translate_func(const SlotTranslate& slot)
   // Create a copy of the slot. A pointer to this will be passed through the
   // callback's data parameter.  It will be deleted when
   // OptionGroup_Translate_glibmm_callback_destroy() is called.
-  SlotTranslate* slot_copy = new SlotTranslate(slot);
+  auto slot_copy = new SlotTranslate(slot);
   g_option_group_set_translate_func(gobj(),
     &OptionGroup_Translate_glibmm_callback, slot_copy,
     &OptionGroup_Translate_glibmm_callback_destroy);
@@ -658,7 +657,7 @@ void OptionGroup::CppOptionEntry::release_c_arg()
       {
         //Delete the OptionArgCallback instance that was allocated by add_entry()
         //or add_entry_filename().
-        OptionArgCallback* option_arg = static_cast<OptionArgCallback*>(cpparg_);
+        auto option_arg = static_cast<OptionArgCallback*>(cpparg_);
         delete option_arg;
         cpparg_ = 0;
 
@@ -687,7 +686,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp()
     case G_OPTION_ARG_STRING:
     {
       char** typed_arg = static_cast<char**>(carg_);
-      Glib::ustring* typed_cpp_arg = static_cast<Glib::ustring*>(cpparg_);
+      auto typed_cpp_arg = static_cast<Glib::ustring*>(cpparg_);
       if(typed_arg && *typed_arg && typed_cpp_arg)
       {
         *typed_cpp_arg = *typed_arg;
@@ -697,7 +696,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp()
     case G_OPTION_ARG_FILENAME:
     {
       char** typed_arg = static_cast<char**>(carg_);
-      std::string* typed_cpp_arg = static_cast<std::string*>(cpparg_);
+      auto typed_cpp_arg = static_cast<std::string*>(cpparg_);
       if(typed_arg && *typed_arg && typed_cpp_arg)
       {
         *typed_cpp_arg = *typed_arg;
@@ -717,7 +716,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp()
     case G_OPTION_ARG_STRING_ARRAY:
     {
       char*** typed_arg = static_cast<char***>(carg_);
-      vecustrings* typed_cpp_arg = static_cast<vecustrings*>(cpparg_);
+      auto typed_cpp_arg = static_cast<vecustrings*>(cpparg_);
       if(typed_arg && *typed_arg && typed_cpp_arg)
       {
         typed_cpp_arg->clear();
@@ -757,7 +756,7 @@ void OptionGroup::CppOptionEntry::convert_c_to_cpp()
     case G_OPTION_ARG_FILENAME_ARRAY:
     {
       char*** typed_arg = static_cast<char***>(carg_);
-      vecstrings* typed_cpp_arg = static_cast<vecstrings*>(cpparg_);
+      auto typed_cpp_arg = static_cast<vecstrings*>(cpparg_);
       if(typed_arg && *typed_arg && typed_cpp_arg)
       {
         typed_cpp_arg->clear();
index af91d4a..4f56581 100644 (file)
@@ -25,7 +25,7 @@ Glib::RefPtr<Glib::Regex> Regex::create(const Glib::ustring& pattern,
                                         RegexMatchFlags match_options)
 {
   GError* gerror = 0;
-  GRegex* regex  = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options,
+  auto regex  = g_regex_new(pattern.c_str(), (GRegexCompileFlags)compile_options,
                                (GRegexMatchFlags)match_options, &gerror);
 
   if(gerror)
@@ -207,7 +207,7 @@ bool Regex::match_all(const Glib::ustring& string, gssize string_len, int start_
 Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options)
 {
   GError* gerror = 0;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror)));
+  auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -218,7 +218,7 @@ Glib::ustring Regex::replace(const Glib::ustring& string, int start_position, co
 Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_position, const Glib::ustring& replacement, RegexMatchFlags match_options)
 {
   GError* gerror = 0;
-  Glib::ustring retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror)));
+  auto retvalue = Glib::convert_return_gchar_ptr_to_ustring(g_regex_replace_literal(gobj(), string.c_str(), -1, start_position, replacement.c_str(), ((GRegexMatchFlags)(match_options)), &(gerror)));
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -228,7 +228,7 @@ Glib::ustring Regex::replace_literal(const Glib::ustring& string, int start_posi
 Glib::StringArrayHandle Regex::split(const Glib::ustring& string, int start_position, RegexMatchFlags match_options, int max_tokens) const
 {
   GError* gerror = 0;
-  Glib::StringArrayHandle retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP);
+  auto retvalue = Glib::StringArrayHandle(g_regex_split_full(const_cast<GRegex*>(gobj()), string.c_str(), -1, start_position, ((GRegexMatchFlags)(match_options)), max_tokens, &(gerror)), Glib::OWNERSHIP_DEEP);
   if(gerror)
     ::Glib::Error::throw_exception(gerror);
 
@@ -242,19 +242,19 @@ MatchInfo::MatchInfo()
 {
 }
 
-MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_ownership)
+MatchInfo::MatchInfo(GMatchInfo* castitem, bool take_the_ownership)
 : gobject_(castitem),
-  take_ownership(take_ownership)
+  take_ownership(take_the_ownership)
 {
 }
 
-void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_ownership)
+void MatchInfo::set_gobject(GMatchInfo* castitem, bool take_the_ownership)
 {
-  if(gobject_ && take_ownership)
+  if(gobject_ && this->take_ownership)
     g_match_info_free(gobject_);
 
   gobject_ = castitem;
-  this->take_ownership = take_ownership;
+  this->take_ownership = take_the_ownership;
 }
 
 MatchInfo::~MatchInfo()
index 1b0d5e8..f35af4a 100644 (file)
@@ -222,10 +222,10 @@ public:
 
   /** C object constructor.
    * @param castitem The C object.
-   * @param take_ownership Whether to destroy the C object with the wrapper or
+   * @param take_the_ownership Whether to destroy the C object with the wrapper or
    * not.
    */
-  explicit MatchInfo(GMatchInfo* castitem, bool take_ownership = true);
+  explicit MatchInfo(GMatchInfo* castitem, bool take_the_ownership = true); //TODO: Rename to take_ownership when we can rename the member variable.
 
   /// Destructor.
   virtual ~MatchInfo();
@@ -272,7 +272,7 @@ public:
 
 protected:
   GMatchInfo* gobject_;      // The C object.
-  bool take_ownership;       // Bool signaling ownership.
+  bool take_ownership;       // Bool signaling ownership. //TODO: Give this a _ suffix when we can break API.
 
 protected:
   // So that Glib::Regex::match() can set the C object.
index a95d597..2f275f9 100644 (file)
@@ -58,7 +58,7 @@ public:
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
   static inline sigc::slot_base* data_to_slot(void* data)
   {
-    SignalProxyConnectionNode *const pConnectionNode = static_cast<SignalProxyConnectionNode*>(data);
+    const auto pConnectionNode = static_cast<SignalProxyConnectionNode*>(data);
 
     // Return 0 if the connection is blocked.
     return (!pConnectionNode->slot_.blocked()) ? &pConnectionNode->slot_ : 0;
index 8e2a250..ef9eed2 100644 (file)
@@ -74,7 +74,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
                             int* standard_error)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
   GError* gerror = 0;
 
   g_spawn_async_with_pipes(
@@ -102,7 +102,7 @@ void spawn_async_with_pipes(const std::string& working_directory,
                             int* standard_error)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
   GError* gerror = 0;
 
   g_spawn_async_with_pipes(
@@ -127,7 +127,7 @@ void spawn_async(const std::string& working_directory,
                  Pid* child_pid)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
   GError* gerror = 0;
 
   g_spawn_async(
@@ -151,7 +151,7 @@ void spawn_async(const std::string& working_directory,
                  Pid* child_pid)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
   GError* gerror = 0;
 
   g_spawn_async(
@@ -177,7 +177,7 @@ void spawn_sync(const std::string& working_directory,
                 int* exit_status)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
 
   Glib::ScopedPtr<char> buf_standard_output;
   Glib::ScopedPtr<char> buf_standard_error;
@@ -211,7 +211,7 @@ void spawn_sync(const std::string& working_directory,
                 int* exit_status)
 {
   const bool setup_slot = !child_setup.empty();
-  SlotSpawnChildSetup child_setup_ = child_setup;
+  auto child_setup_ = child_setup;
 
   Glib::ScopedPtr<char> buf_standard_output;
   Glib::ScopedPtr<char> buf_standard_error;
index cfc3895..2116b52 100644 (file)
@@ -26,7 +26,7 @@ extern "C"
 
 static void* call_thread_entry_slot(void* data)
 {
-  sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data);
+  const auto slot = reinterpret_cast<sigc::slot_base*>(data);
 
   try
   {
@@ -71,11 +71,11 @@ void thread_init_impl()
 Thread* Thread::create(const sigc::slot<void>& slot, bool /* joinable */)
 {
   // Make a copy of slot on the heap
-  sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);
+  const auto slot_copy = new sigc::slot<void>(slot);
 
   GError* error = 0;
 
-  GThread *const thread = g_thread_try_new(NULL,
+  const auto thread = g_thread_try_new(NULL,
       &call_thread_entry_slot, slot_copy, &error);
 
   if(error)
@@ -97,11 +97,11 @@ Thread* Thread::create(const sigc::slot<void>& slot, unsigned long stack_size,
                        bool joinable, bool bound, ThreadPriority priority)
 {
   // Make a copy of slot on the heap
-  sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);
+  const auto slot_copy = new sigc::slot<void>(slot);
 
   GError* error = 0;
 
-  GThread *const thread = g_thread_create_full(
+  const auto thread = g_thread_create_full(
       &call_thread_entry_slot, slot_copy, stack_size, joinable,
       bound, (GThreadPriority) priority, &error);
 
index 05fc76c..49ad107 100644 (file)
@@ -40,7 +40,7 @@ extern "C"
 
 static void* call_thread_entry_slot(void* data)
 {
-  sigc::slot_base *const slot = reinterpret_cast<sigc::slot_base*>(data);
+  const auto slot = reinterpret_cast<sigc::slot_base*>(data);
 
   try
   {
@@ -78,10 +78,10 @@ namespace Threads
 Thread* Thread::create(const sigc::slot<void>& slot, const std::string& name)
 {
   // Make a copy of slot on the heap.
-  sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);
+  const auto slot_copy = new sigc::slot<void>(slot);
 
   GError* error = 0;
-  GThread* thread = g_thread_try_new(name.empty() ? 0 : name.c_str(),
+  auto thread = g_thread_try_new(name.empty() ? 0 : name.c_str(),
     &call_thread_entry_slot, slot_copy, &error);
 
   if (error)
index 114e978..8b82aed 100644 (file)
@@ -48,7 +48,7 @@ ValueArray::ValueArray(guint n_preallocated) :
 
 bool ValueArray::get_nth(guint index, Glib::ValueBase& value)
 {
-  GValue* const g_value = g_value_array_get_nth(gobj(), index);
+  const auto g_value = g_value_array_get_nth(gobj(), index);
 
   if(g_value)
   {
index fd47549..7523db5 100644 (file)
@@ -287,7 +287,7 @@ const VariantType& Variant<VariantBase>::variant_type()
 
 Variant<VariantBase> Variant<VariantBase>::create(const VariantBase& data)
 {
-  Variant<VariantBase> result = Variant<VariantBase>(g_variant_new_variant(const_cast<GVariant*>(data.gobj())));
+  auto result = Variant<VariantBase>(g_variant_new_variant(const_cast<GVariant*>(data.gobj())));
   return result;
 }
 
@@ -318,7 +318,7 @@ const VariantType& Variant<Glib::ustring>::variant_type()
 Variant<Glib::ustring>
 Variant<Glib::ustring>::create(const Glib::ustring& data)
 {
-  Variant<Glib::ustring> result =
+  auto result =
     Variant<Glib::ustring>(g_variant_new_string(data.c_str()));
   return result;
 }
@@ -374,7 +374,7 @@ const VariantType& Variant<std::string>::variant_type()
 Variant<std::string>
 Variant<std::string>::create(const std::string& data)
 {
-  Variant<std::string> result =
+  auto result =
     Variant<std::string>(g_variant_new_bytestring(data.c_str()));
   return result;
 }
@@ -451,15 +451,14 @@ Variant<type_vec_ustring>::create(const type_vec_ustring& data)
   GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj());
 
   // Add the elements of the vector into the builder.
-  for(type_vec_ustring::const_iterator iter = data.begin();
-   iter < data.end(); iter++)
+  for(const auto& str : data)
   {
     g_variant_builder_add(builder,
-      element_variant_type.get_string().c_str(), iter->c_str());
+      element_variant_type.get_string().c_str(), str.c_str());
   }
 
   // Create the variant using the builder.
-  Variant<type_vec_ustring> result =
+  auto result =
     Variant<type_vec_ustring>(g_variant_new(
       array_variant_type.get_string().c_str(), builder));
 
@@ -541,7 +540,7 @@ Variant<type_vec_string>::create(const type_vec_string& data)
 
   // Create the variant using g_variant_new_bytestring_array() (passing the
   // newly constructed array.
-  Variant<type_vec_string> result =
+  auto result =
     Variant<type_vec_string>(g_variant_new_bytestring_array(str_array,
       data.size()));
 
@@ -566,7 +565,7 @@ Variant<type_vec_string>::create_from_object_paths(const type_vec_string& data)
 
   // Create the variant using g_variant_new_objv() (passing the
   // newly constructed array.
-  Variant<type_vec_string> result =
+  auto result =
     Variant<type_vec_string>(g_variant_new_objv(str_array, data.size()));
 
   g_strfreev(str_array);
index b92d825..5f9a440 100644 (file)
@@ -1090,10 +1090,9 @@ Variant< std::vector<T> >::create(const std::vector<T>& data)
   GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj());
 
   // Add the elements of the vector into the builder.
-  for(typename std::vector<T>::const_iterator iter = data.begin();
-   iter < data.end(); iter++)
+  for(const auto& element : data)
   {
-    Glib::Variant<T> variant = Glib::Variant<T>::create(*iter);
+    Glib::Variant<T> variant = Glib::Variant<T>::create(element);
     g_variant_builder_add_value(builder, variant.gobj());
   }
 
@@ -1177,11 +1176,10 @@ Variant< std::map<K, V> >::create(const std::map<K, V>& data)
   GVariantBuilder* builder = g_variant_builder_new(array_variant_type.gobj());
 
   // Add the elements of the map into the builder.
-  for(typename std::map<K, V>::const_iterator iter = data.begin();
-    iter != data.end(); iter++)
+  for(const auto& element : data)
   {
-    Variant< std::pair<K, V> > dict_entry =
-      Variant< std::pair<K, V> >::create(*iter);
+    auto dict_entry =
+      Variant< std::pair<K, V> >::create(element);
 
     g_variant_builder_add_value(builder, dict_entry.gobj());
   }
index 92e50a3..4247da8 100644 (file)
@@ -47,13 +47,13 @@ const VariantType& Variant<$1>::variant_type()
 
 Variant<$1> Variant<$1>::create($1 data)
 {
-  Variant<$1> result = Variant<$1>(g_variant_new_$3(data));
+  auto result = Variant<$1>(g_variant_new_$3(data));
   return result;
 }
 ifelse($4,,,[
 Variant<$1> Variant<$1>::create_$4($1 data)
 {
-  Variant<$1> result = Variant<$1>(g_variant_new_$4(data));
+  auto result = Variant<$1>(g_variant_new_$4(data));
   return result;
 }
 ])dnl
index 71d34d9..46153d6 100644 (file)
@@ -54,14 +54,14 @@ VariantType& VariantType::operator=(const GVariantType* castitem)
 VariantType VariantType::create_tuple(const std::vector<VariantType>& items)
 {
   typedef GVariantType* var_ptr;
-  var_ptr* const var_array = new var_ptr[items.size()];
+  const auto var_array = new var_ptr[items.size()];
 
   for(std::vector<VariantType>::size_type i = 0; i < items.size(); i++)
   {
     var_array[i] = const_cast<GVariantType*>(items[i].gobj());
   }
 
-  VariantType result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size()));
+  auto result = Glib::wrap(g_variant_type_new_tuple(var_array, items.size()));
   delete[] var_array;
   return result;
 }
index c9f79e5..12136fa 100644 (file)
@@ -29,9 +29,9 @@ int main(int, char**)
   Glib::init();
   Gio::init();
 
-  Glib::RefPtr<Glib::MainLoop> mainloop = Glib::MainLoop::create();
+  auto mainloop = Glib::MainLoop::create();
 
-  Glib::RefPtr<Gio::File> file = Gio::File::create_for_path("/etc/passwd");
+  auto file = Gio::File::create_for_path("/etc/passwd");
   file->read_async(&on_read_async);
 
   mainloop->run();
index ae51ec2..797ed22 100644 (file)
@@ -34,14 +34,14 @@ int main(int, char**)
 
   try
   {
-    Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(TEST_FILE);
+    auto file = Gio::File::create_for_path(TEST_FILE);
     if(!file)
     {
       std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;
       return EXIT_FAILURE; 
     }
 
-    Glib::RefPtr<Gio::FileInputStream> stream = file->read();
+    auto stream = file->read();
     if(!stream)
     {
       std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl;
index 813fa4e..8228bd2 100644 (file)
@@ -43,7 +43,7 @@ int main(int, char**)
   std::memset(buffer, 0, sizeof buffer);
   try
   {
-    Glib::RefPtr<Gio::MemoryInputStream> stream = Gio::MemoryInputStream::create();
+    auto stream = Gio::MemoryInputStream::create();
     if (!stream)
     {
       std::cerr << "Could not create a MemoryInputStream." << std::endl;
index e88c460..175cadf 100644 (file)
@@ -22,14 +22,14 @@ int main(int, char**)
 
   try
   {
-    Glib::RefPtr<Gio::File> file = Gio::File::create_for_path(TEST_FILE);
+    auto file = Gio::File::create_for_path(TEST_FILE);
     if(!file)
     {
       std::cerr << "Gio::File::create_for_path() returned an empty RefPtr." << std::endl;
       return EXIT_FAILURE; 
     }
 
-    Glib::RefPtr<Gio::FileInputStream> stream = file->read();
+    auto stream = file->read();
     if(!stream)
     {
       std::cerr << "Gio::File::read() returned an empty RefPtr." << std::endl;
index a14fe9f..7a4d4bf 100644 (file)
@@ -29,7 +29,7 @@ bool on_accept_certificate(const Glib::RefPtr<const Gio::TlsCertificate>& cert,
   std::cout << "Outputing certificate data:" << std::endl <<
     cert->property_certificate_pem().get_value();
 
-  Glib::RefPtr<const Gio::TlsCertificate> issuer = cert->get_issuer();
+  auto issuer = cert->get_issuer();
 
   std::cout << "Outputing the issuer's certificate data:" << std::endl <<
     issuer->property_certificate_pem().get_value();
@@ -74,16 +74,16 @@ int main(int, char**)
   std::cout << "Successfully resolved address of test host '" << test_host <<
     "'." << std::endl;
 
-  Glib::RefPtr<Gio::InetAddress> first_inet_address = inet_addresses[0];
+  auto first_inet_address = inet_addresses[0];
 
   std::cout << "First address of test host is " <<
     first_inet_address->to_string() << "." << std::endl;
 
-  Glib::RefPtr<Gio::Socket> socket =
+  auto socket =
     Gio::Socket::create(first_inet_address->get_family(),
     Gio::SOCKET_TYPE_STREAM, Gio::SOCKET_PROTOCOL_TCP);
 
-  Glib::RefPtr<Gio::InetSocketAddress> address =
+  auto address =
     Gio::InetSocketAddress::create(first_inet_address, 443);
 
   try
@@ -105,7 +105,7 @@ int main(int, char**)
       "." << std::endl;
   }
 
-  Glib::RefPtr<Gio::TcpConnection> conn = Glib::RefPtr<Gio::TcpConnection>::cast_dynamic(Gio::SocketConnection::create(socket));
+  auto conn = Glib::RefPtr<Gio::TcpConnection>::cast_dynamic(Gio::SocketConnection::create(socket));
 
   if(!conn || !conn->is_connected())
   {
@@ -120,11 +120,9 @@ int main(int, char**)
     address->get_address()->to_string() << ":" << address->get_port() <<
     "." << std::endl;
 
-  Glib::RefPtr<Gio::TlsClientConnection> tls_connection;
-
   try
   {
-    Glib::RefPtr<Gio::TlsClientConnection> tls_connection =
+    auto tls_connection =
       Gio::TlsClientConnection::create(conn, address);
 
     tls_connection->signal_accept_certificate().connect(
@@ -135,7 +133,7 @@ int main(int, char**)
     std::cout << "Attempting to get the issuer's certificate from the "
       "connection." << std::endl;
 
-    Glib::RefPtr<Gio::TlsCertificate> issuer_certificate =
+    auto issuer_certificate =
       tls_connection->get_peer_certificate()->get_issuer();
 
     if(!issuer_certificate)
@@ -148,12 +146,12 @@ int main(int, char**)
       std::endl;
 
     std::cout << "Attempting to use the connection's database." << std::endl;
-    Glib::RefPtr<Gio::TlsDatabase> database = tls_connection->get_database();
+    auto database = tls_connection->get_database();
 
     std::cout << "Looking up the certificate's issuer in the database." <<
       std::endl;
 
-    Glib::RefPtr<Gio::TlsCertificate> db_certificate =
+    auto db_certificate =
       database->lookup_certificate_issuer(issuer_certificate);
 
     if(!db_certificate)
index c678c37..837b7ae 100644 (file)
@@ -74,8 +74,7 @@ my_p_key_compare(const type_p_key_value& key_a, const type_p_key_value& key_b)
 int
 main()
 {
-  type_key_value::const_iterator i;
-  Glib::RefPtr< Glib::BalancedTree<type_key_value, type_key_value> > tree = Glib::BalancedTree<type_key_value, type_key_value>::create();
+  auto tree = Glib::BalancedTree<type_key_value, type_key_value>::create();
 
   for (type_key_value::size_type i = 0; i < str.size(); ++i)
     tree->insert(str.substr(i, 1), str.substr(i, 1));
@@ -138,7 +137,7 @@ main()
   value = tree->search(sigc::ptr_fun(my_search), "|");
   g_assert(value == NULL);
 
-  Glib::RefPtr< Glib::BalancedTree<type_p_key_value, type_p_key_value> > ptree = Glib::BalancedTree<type_p_key_value, type_p_key_value>::create(sigc::ptr_fun(my_p_key_compare));
+  auto ptree = Glib::BalancedTree<type_p_key_value, type_p_key_value>::create(sigc::ptr_fun(my_p_key_compare));
 
   for (type_key_value::size_type i = 0; i < str.size(); ++i)
     pstr.push_back(new type_key_value(str.substr(i, 1)));
index ec0ea93..c748215 100644 (file)
@@ -20,9 +20,9 @@ public:
 
 protected:
   //Implement vfuncs:
-  virtual Glib::ustring get_name_vfunc() const;
-  virtual Glib::VariantType get_state_type_vfunc() const;
-  virtual Glib::VariantBase get_state_hint_vfunc() const;
+  Glib::ustring get_name_vfunc() const override;
+  Glib::VariantType get_state_type_vfunc() const override;
+  Glib::VariantBase get_state_hint_vfunc() const override;
 };
 
 CustomAction::CustomAction()
index fbf7002..56bd02d 100644 (file)
@@ -50,8 +50,8 @@ bool mark_and_quit(const Glib::Threads::Thread* expected_thread,
 void thread_function(const Glib::Threads::Thread* first_thread,
   const Glib::RefPtr<Glib::MainLoop>& first_mainloop)
 {
-  Glib::RefPtr<Glib::MainContext> second_context = Glib::MainContext::create();
-  Glib::RefPtr<Glib::MainLoop> second_mainloop = Glib::MainLoop::create(second_context);
+  auto second_context = Glib::MainContext::create();
+  auto second_mainloop = Glib::MainLoop::create(second_context);
 
   // Show how Glib::MainContext::invoke() can be used for calling a function,
   // possibly executed in another thread.
@@ -75,7 +75,7 @@ int main(int, char**)
 {
   Glib::init();
 
-  Glib::RefPtr<Glib::MainLoop> first_mainloop = Glib::MainLoop::create();
+  auto first_mainloop = Glib::MainLoop::create();
 
   // This thread shall be the owner of the default main context, when
   // thread_function() calls mark_and_quit() via Glib::MainContext::invoke(),
index 2139d43..ca11143 100644 (file)
@@ -41,23 +41,23 @@ int on_compare(const Glib::ValueBase& v1, const Glib::ValueBase& v2)
 
 int main(int, char**)
 {
-  const int VALUES = 10;
+  const int VALUES_COUNT = 10;
 
   Glib::init();
 
-  Glib::Value<int> value[VALUES];
+  Glib::Value<int> values[VALUES_COUNT];
   Glib::ValueArray array;
 
-  for(int i = 0; i < VALUES; i++)
+  for(int i = 0; i < VALUES_COUNT; i++)
   {
-    value[i].init(Glib::Value<int>::value_type());
-    value[i].set(i + 1); //  (i + 1) ==> Set to natural counting numbers.
-    array.prepend(value[i]);
+    values[i].init(Glib::Value<int>::value_type());
+    values[i].set(i + 1); //  (i + 1) ==> Set to natural counting numbers.
+    array.prepend(values[i]);
   }
 
   ostr << "Array members before sorting:" << std::endl;
 
-  for(int i = 0; i < VALUES; i++)
+  for(int i = 0; i < VALUES_COUNT; i++)
   {
     Glib::ValueBase value;
 
@@ -69,18 +69,18 @@ int main(int, char**)
       break;
     }
 
-    Glib::Value<int> int_val = static_cast< Glib::Value<int>& >(value);
+    auto int_val = static_cast< Glib::Value<int>& >(value);
     ostr << int_val.get() << " ";
   }
   ostr << std::endl; // End of line for list of array elements.
 
   // Sort array and remove last element:
-  array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES - 1);
+  array.sort(sigc::ptr_fun(&on_compare)).remove(VALUES_COUNT - 1);
 
   ostr << "Array members after sorting without last element:" <<
     std::endl;
 
-  for(int i = 0; i < VALUES - 1; i++)
+  for(int i = 0; i < VALUES_COUNT - 1; i++)
   {
     Glib::ValueBase value;
 
@@ -92,7 +92,7 @@ int main(int, char**)
       break;
     }
 
-    Glib::Value<int> int_val = static_cast< Glib::Value<int>& >(value);
+    auto int_val = static_cast< Glib::Value<int>& >(value);
     ostr << int_val.get() << " ";
   }
   ostr << std::endl; // End of line for list of array elements.
index 484cb8f..47943de 100644 (file)
@@ -26,10 +26,10 @@ int main(int, char**)
   for(guint i = 0; i < int_vector.size(); i++)
     ostr << int_vector[i] << std::endl;
 
-  Glib::Variant< std::vector<int> > integers_variant =
+  auto integers_variant =
     Glib::Variant< std::vector<int> >::create(int_vector);
 
-  std::vector<int> int_vector2 = integers_variant.get();
+  auto int_vector2 = integers_variant.get();
 
   ostr << "The size of the copied vector is " << int_vector2.size() <<
     '.' << std::endl;
@@ -53,7 +53,7 @@ int main(int, char**)
   //vector<std::string>:
   std::vector<std::string> vec_strings;
   vec_strings.push_back("a");
-  Glib::Variant<std::vector<std::string> > variant_vec_strings =
+  auto variant_vec_strings =
     Glib::Variant<std::vector<std::string> >::create(vec_strings);
 
   //Dict:
@@ -65,7 +65,7 @@ int main(int, char**)
   ostr << "The original dictionary entry is (" << dict_entry.first <<
     ", " << dict_entry.second << ")." << std::endl;
 
-  Glib::Variant<TypeDictEntry> dict_entry_variant =
+  auto dict_entry_variant =
     Glib::Variant<TypeDictEntry>::create(dict_entry);
 
   TypeDictEntry copy_entry = dict_entry_variant.get();
@@ -92,7 +92,7 @@ int main(int, char**)
     ostr << "(" << i << ", " << orig_dict[i] << ")." << std::endl;
   }
 
-  Glib::Variant<TypeDict> orig_dict_variant =
+  auto orig_dict_variant =
     Glib::Variant<TypeDict>::create(orig_dict);
 
   TypeDict dict_copy = orig_dict_variant.get();
@@ -106,7 +106,7 @@ int main(int, char**)
 
   index = 3;
 
-  std::pair<unsigned, Glib::ustring> a_pair = orig_dict_variant.get_child(index);
+  auto a_pair = orig_dict_variant.get_child(index);
 
   ostr << "Element number " << index + 1 << " in the variant is: (" <<
     a_pair.first << ", " << a_pair.second << ")." << std::endl;
@@ -134,7 +134,7 @@ int main(int, char**)
 
     Glib::ustring s = "String " + ss.str();
 
-    Glib::Variant<int> v = Glib::Variant<int>::create(i);
+    auto v = Glib::Variant<int>::create(i);
 
     complex_dict1.insert(
       std::pair< Glib::ustring, Glib::Variant<int> >("Map 1 " + s, v));
@@ -150,7 +150,7 @@ int main(int, char**)
   complex_vector.push_back(complex_dict1);
   complex_vector.push_back(complex_dict2);
 
-  Glib::Variant<ComplexVecType> complex_variant =
+  auto complex_variant =
     Glib::Variant<ComplexVecType>::create(complex_vector);
 
   // This will output the type string aa{sv}.
@@ -166,10 +166,8 @@ int main(int, char**)
 
     ComplexDictType map = copy_complex_vector[i];
 
-    for(ComplexDictType::const_iterator iter = map.begin();
-      iter != map.end(); iter++)
+    for(const auto& entry : map)
     {
-      std::pair< Glib::ustring, Glib::Variant<int> > entry = *iter;
       ostr << entry.first << " -> " << entry.second.get() << "." << std::endl;
     }
     ostr << std::endl;
@@ -189,7 +187,7 @@ static void test_dynamic_cast_ustring_types()
 
   try
   {
-    Glib::Variant<Glib::ustring> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<Glib::ustring> >(vbase_string);
     ostr << "Casted string Glib::Variant<Glib::ustring>: " << derived.get() << std::endl;
   }
@@ -204,7 +202,7 @@ static void test_dynamic_cast_ustring_types()
 
   try
   {
-    Glib::Variant<Glib::ustring> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<Glib::ustring> >(vbase_objectpath);
     ostr << "Casted object path Glib::Variant<Glib::ustring>: " << derived.get() << std::endl;
   }
@@ -218,7 +216,7 @@ static void test_dynamic_cast_ustring_types()
 
   try
   {
-    Glib::Variant<Glib::ustring> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<Glib::ustring> >(vbase_signature);
     ostr << "Casted signature Glib::Variant<Glib::ustring>: " << derived.get() << std::endl;
   }
@@ -237,7 +235,7 @@ static void test_dynamic_cast_string_types()
 
   try
   {
-    Glib::Variant<std::string> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<std::string> >(vbase_string);
     ostr << "Casted string Glib::Variant<std::string>: " << derived.get() << std::endl;
   }
@@ -252,7 +250,7 @@ static void test_dynamic_cast_string_types()
 
   try
   {
-    Glib::Variant<std::string> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<std::string> >(vbase_objectpath);
     ostr << "Casted object path Glib::Variant<std::string>: " << derived.get() << std::endl;
   }
@@ -266,7 +264,7 @@ static void test_dynamic_cast_string_types()
 
   try
   {
-    Glib::Variant<std::string> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic< Glib::Variant<std::string> >(vbase_signature);
     ostr << "Casted signature Glib::Variant<std::string>: " << derived.get() << std::endl;
   }
@@ -303,18 +301,18 @@ void test_dynamic_cast_composite_types()
   try
   {
     typedef std::map<Glib::ustring, std::vector<std::string> > composite_type;
-    Glib::Variant<composite_type> derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic<Glib::Variant<composite_type> >(cppdict);
 
     ostr << "Cast composite type (get_type_string()=" << derived.get_type_string()
          << ", variant_type().get_string()=" << derived.variant_type().get_string() << "): ";
     composite_type var = derived.get();
-    for (composite_type::const_iterator iter1 = var.begin(); iter1 != var.end(); ++iter1)
+    for (const auto& the_pair : var)
     {
-      ostr << "\n  " << iter1->first << ":";
-      const std::vector<std::string>& vec = iter1->second;
-      for (std::vector<std::string>::const_iterator iter2 = vec.begin(); iter2 != vec.end(); ++iter2)
-        ostr << "  " << *iter2;
+      ostr << "\n  " << the_pair.first << ":";
+      const auto& vec = the_pair.second;
+      for (const auto& str : vec)
+        ostr << "  " << str;
     }
     ostr << std::endl;
   }
@@ -325,7 +323,7 @@ void test_dynamic_cast_composite_types()
 
   try
   {
-    Glib::Variant<std::map<Glib::ustring, std::string > > derived =
+    auto derived =
       Glib::VariantBase::cast_dynamic<Glib::Variant<std::map<Glib::ustring, std::string> > >(cppdict);
     g_assert_not_reached();
   }
@@ -336,9 +334,9 @@ void test_dynamic_cast_composite_types()
 
 static void test_dynamic_cast()
 {
-  Glib::Variant<int> v1 = Glib::Variant<int>::create(10);
+  auto v1 = Glib::Variant<int>::create(10);
   Glib::VariantBase& v2 = v1;
-  Glib::Variant<int> v3 = Glib::VariantBase::cast_dynamic<Glib::Variant<int> >(v2);
+  auto v3 = Glib::VariantBase::cast_dynamic<Glib::Variant<int> >(v2);
   g_assert(v3.get() == 10);
 
   Glib::VariantBase v5 = v1;
@@ -385,7 +383,7 @@ static void test_dynamic_cast()
 
   type_dict_sv var_map;
   type_map_sv map;
-  Glib::Variant<Glib::ustring> var_string =
+  auto var_string =
     Glib::Variant<Glib::ustring>::create("test variant");
   map["test key"] = var_string;
   var_map = type_dict_sv::create(map);
@@ -396,7 +394,7 @@ static void test_dynamic_cast()
 
   try
   {
-    Glib::Variant<std::map<Glib::ustring, Glib::ustring> > var_wrong_map =
+    auto var_wrong_map =
       Glib::VariantBase::cast_dynamic<Glib::Variant<std::map<Glib::ustring, Glib::ustring> > >(ref_var_base);
     g_assert_not_reached();
   }
@@ -409,9 +407,9 @@ static void test_dynamic_cast()
   g_assert(var_string.get() == "test variant");
 
   // A variant of type v
-  Glib::Variant<Glib::VariantBase> var_v = Glib::Variant<Glib::VariantBase>::create(var_string);
+  auto var_v = Glib::Variant<Glib::VariantBase>::create(var_string);
   g_assert(var_v.get_type_string() == "v");
-  Glib::Variant<Glib::ustring> var_s2 =
+  auto var_s2 =
     Glib::VariantBase::cast_dynamic<Glib::Variant<Glib::ustring> >(var_v.get());
   g_assert(var_s2.get() == "test variant");
 
index f209348..8477f05 100644 (file)
@@ -220,13 +220,13 @@ std::string get_signals(GType gtype, GTypeIsAPointerFunc is_a_pointer_func)
       {
         strResult += "  (parameters\n";
 
-        for(unsigned i = 0; i < signalQuery.n_params; i++)
+        for(unsigned j = 0; j < signalQuery.n_params; j++)
         {
-          GType typeParamMangled = pParameters[i];
+          GType typeParamMangled = pParameters[j];
 
           //Parameter name:
           //We can't get the real parameter name from the GObject system. It's not registered with g_signal_new().
-          gchar* pchNum = g_strdup_printf("%d", i);
+          gchar* pchNum = g_strdup_printf("%d", j);
           std::string strParamName = "p" + std::string(pchNum);
           g_free(pchNum);
           pchNum = 0;
index 1a9b731..fc46097 100644 (file)
@@ -135,6 +135,20 @@ __CPPNAME__::__CPPNAME__`'(const __CPPNAME__& other)
   gobject_ ((other.gobject_) ? __BOXEDTYPE_FUNC_COPY`'(other.gobject_) : 0)
 {}
 
+__CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other)
+:
+  gobject_(other.gobject_)
+{
+  other.gobject_ = 0;
+}
+
+__CPPNAME__& __CPPNAME__::operator=(__CPPNAME__`'&& other)
+{
+  __CPPNAME__ temp (other);
+  swap(temp);
+  return *this;
+}
+
 ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else
 __CPPNAME__::__CPPNAME__`'(__CNAME__* gobject, bool make_a_copy)
 :
@@ -208,6 +222,9 @@ ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else
   __CPPNAME__`'(const __CPPNAME__& other);
   __CPPNAME__& operator=(const __CPPNAME__& other);
 
+  __CPPNAME__`'(__CPPNAME__&& other);
+  __CPPNAME__& operator=(__CPPNAME__&& other);
+
 _IMPORT(SECTION_DTOR_DOCUMENTATION)
   ~__CPPNAME__`'();
 
index fb6d387..8d25e6a 100644 (file)
@@ -92,7 +92,7 @@ const Glib::Interface_Class& __CPPNAME__`'_Class::init()
 
 void __CPPNAME__`'_Class::iface_init_function(void* g_iface, void*)
 {
-  BaseClassType *const klass = static_cast<BaseClassType*>(g_iface);
+  const auto klass = static_cast<BaseClassType*>(g_iface);
 
   //This is just to avoid an "unused variable" warning when there are no vfuncs or signal handlers to connect.
   //This is a temporary fix until I find out why I can not seem to derive a GtkFileChooser interface. murrayc
index 9e53649..b98502f 100644 (file)
@@ -122,7 +122,7 @@ ifelse(__OPAQUE_FUNC_COPY,NONE,`dnl
 ',`dnl else
 __CPPNAME__& __CPPNAME__::operator=(const __CPPNAME__`'& src)
 {
-  __CNAME__ *const new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0;
+  const auto new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0;
 
   if(gobject_)
     __OPAQUE_FUNC_FREE`'(gobject_);
index c9242ba..cec87fa 100644 (file)
@@ -116,7 +116,7 @@ const __CNAME__* __CPPNAME__::gobj() const
 __CNAME__* __CPPNAME__::gobj_copy() const
 {
   // See the comment at the top of this file, if you want to know why the cast works.
-  __CNAME__ *const gobject = reinterpret_cast<__CNAME__*>(const_cast<__CPPNAME__*>(this));
+  const auto gobject = reinterpret_cast<__CNAME__*>(const_cast<__CPPNAME__*>(this));
   __OPAQUE_FUNC_REF`'(gobject);
   return gobject;
 }
index 4175b57..3442ad1 100644 (file)
@@ -190,7 +190,7 @@ ifdef(`__BOOL_DO_NOT_DERIVE_GTYPE__',`dnl
 
 void __CPPNAME__`'_Class::class_init_function(void* g_class, void* class_data)
 {
-  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
+  const auto klass = static_cast<BaseClassType*>(g_class);
   CppClassParent::class_init_function(klass, class_data);
 
 _IMPORT(SECTION_PCC_CLASS_INIT_VFUNCS)
index 7becc7c..fe4075d 100644 (file)
@@ -28,10 +28,10 @@ dnl If a slot type has been specified insert a slot copy declaration.
 dnl See if the slot should or should not be copied
 `ifelse(`$20',,dnl
 `  // Create a copy of the slot.
-  $18* slot_copy = new $18($19); ',dnl
+  auto slot_copy = new $18($19); ',dnl
 dnl
 `  // Use the original slot (not a copy).
-  $18* slot_copy = const_cast<$18*>(&$19);')
+  auto slot_copy = const_cast<$18*>(&$19);')
 
 ')`'dnl
 dnl Insert the declarations for C output parameters
@@ -68,10 +68,10 @@ ifelse(`$18',,,dnl
 dnl See if the slot should or should not be copied
 `ifelse(`$20',,dnl
 `  // Create a copy of the slot.
-  $18* slot_copy = new $18($19); ',dnl
+  auto slot_copy = new $18($19); ',dnl
 dnl
 `  // Use the original slot (not a copy).
-  $18* slot_copy = const_cast<$18*>(&$19);')
+  auto slot_copy = const_cast<$18*>(&$19);')
 
 ')`'dnl
 dnl Insert the declarations for C output parameters
@@ -130,10 +130,10 @@ ifelse(`$15',,,dnl
 dnl See if the slot should or should not be copied
 `ifelse(`$17',,dnl
 `  // Create a copy of the slot.
-  $15* slot_copy = new $15($16); ',dnl
+  auto slot_copy = new $15($16); ',dnl
 dnl
 `  // Use the original slot (not a copy).
-  $15* slot_copy = const_cast<$15*>(&$16);')
+  auto slot_copy = const_cast<$15*>(&$16);')
 
 ')`'dnl
 dnl Insert declarations for C the output parameters
@@ -161,10 +161,10 @@ ifelse(`$15',,,dnl
 dnl See if the slot should or should not be copied
 `ifelse(`$17',,dnl
 `  // Create a copy of the slot.
-  $15* slot_copy = new $15($16); ',dnl
+  auto slot_copy = new $15($16); ',dnl
 dnl
 `  // Use the original slot (not a copy).
-  $15* slot_copy = const_cast<$15*>(&$16);')
+  auto slot_copy = const_cast<$15*>(&$16);')
 
 ')`'dnl
 dnl Insert the declarations for the C output parameters
index cb8cdf0..cc0473c 100644 (file)
@@ -67,13 +67,13 @@ static $2 __CPPNAME__`'_signal_$4_callback`'(__CNAME__`'* self, _COMMA_SUFFIX($3
   using namespace __NAMESPACE__;
   typedef sigc::slot< $5`'_COMMA_PREFIX($6) > SlotType;
 
-  __CPPNAME__* obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
+  auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
   if(obj)
   {
     try
     {
-      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
+      if(const auto slot = Glib::SignalProxyNormal::data_to_slot`'(data))
 ifelse(`$2',void,`dnl
         (*static_cast<SlotType*>(slot))($7);
 ',`dnl else
@@ -109,13 +109,13 @@ static $2 __CPPNAME__`'_signal_$4_notify_callback`'(__CNAME__`'* self, _COMMA_SU
   using namespace __NAMESPACE__;
   typedef sigc::slot< void`'_COMMA_PREFIX($6) > SlotType;
 
-  __CPPNAME__* obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
+  auto obj = dynamic_cast<__CPPNAME__*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
   // Do not try to call a signal on a disassociated wrapper.
   if(obj)
   {
     try
     {
-      if(sigc::slot_base *const slot = Glib::SignalProxyNormal::data_to_slot`'(data))
+      if(const auto slot = Glib::SignalProxyNormal::data_to_slot`'(data))
         (*static_cast<SlotType*>(slot))($7);
     }
     catch(...)
@@ -235,7 +235,7 @@ $4 __CPPNAME__`'_Class::$2_callback`'($5)
 dnl  First, do a simple cast to ObjectBase. We will have to do a dynamic_cast
 dnl  eventually, but it is not necessary to check whether we need to call
 dnl  the vfunc.
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+  const auto obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper`'((GObject*)$8));
 
 _IMPORT(SECTION_CHECK)
@@ -248,7 +248,7 @@ _IMPORT(SECTION_CHECK)
   {
 dnl  We need to do a dynamic cast to get the real object type, to call the
 dnl  C++ vfunc on it.
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
     if(obj) // This can be NULL during destruction.
     {
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
@@ -279,7 +279,7 @@ ifelse($11, `', `dnl
     }
   }
 
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
 ifdef(`__BOOL_IS_INTERFACE__',`dnl
         _IFACE_PARENT_FROM_OBJECT($8)dnl
 ',`dnl
@@ -325,7 +325,7 @@ ifelse(`$9',,,`#ifdef $9'
 )dnl
 $3 __NAMESPACE__::__CPPNAME__::on_$1`'($5)
 {
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
 ifdef(`__BOOL_IS_INTERFACE__',`dnl
       _IFACE_PARENT_FROM_OBJECT(gobject_)dnl
 ',`dnl
index 8cbf908..6ed4989 100644 (file)
@@ -37,13 +37,13 @@ ifelse(`$11',,,`#ifdef $11'
 $4 __CPPNAME__`'_Class::$2_vfunc_callback`'($5)
 {
 ifelse(`$14',,,dnl
-`  const $13* slot = static_cast<$13*>($14);
+`  const auto slot = static_cast<$13*>($14);
 
 ')dnl
 dnl  First, do a simple cast to ObjectBase. We will have to do a dynamic_cast
 dnl  eventually, but it is not necessary to check whether we need to call
 dnl  the vfunc.
-  Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
+  const auto obj_base = static_cast<Glib::ObjectBase*>(
       Glib::ObjectBase::_get_current_wrapper`'((GObject*)$8));
 
 _IMPORT(SECTION_CHECK)
@@ -56,7 +56,7 @@ _IMPORT(SECTION_CHECK)
   {
 dnl  We need to do a dynamic cast to get the real object type, to call the
 dnl  C++ vfunc on it.
-    CppObjectType *const obj = dynamic_cast<CppObjectType* const>(obj_base);
+    const auto obj = dynamic_cast<CppObjectType* const>(obj_base);
     if(obj) // This can be NULL during destruction.
     {
       try // Trap C++ exceptions which would normally be lost because this is a C callback.
@@ -70,9 +70,9 @@ ifelse($9,refreturn_ctype,`dnl Assume Glib::unwrap_copy() is correct if refretur
         return Glib::unwrap_copy`'(`obj->$1'($7));
 ',`dnl not refreturn_ctype
 ifelse($10,keep_return,`dnl
-        static GQuark quark_return_value = g_quark_from_static_string("__NAMESPACE__::__CPPNAME__::$1");
+        static auto quark_return_value = g_quark_from_static_string("__NAMESPACE__::__CPPNAME__::$1");
 
-        $3* return_value = static_cast<$3*>(g_object_get_qdata(obj_base->gobj(), quark_return_value));
+        auto return_value = static_cast<$3*>(g_object_get_qdata(obj_base->gobj(), quark_return_value));
         if (!return_value)
         {
           return_value = new $3`'();
@@ -158,13 +158,13 @@ ifelse(`$11',,,dnl
 dnl See if the slot should or should not be copied
 `ifelse(`$13',,dnl
 `  // Create a copy of the slot.
-  $11* slot_copy = new $11($12); ',dnl
+  auto slot_copy = new $11($12); ',dnl
 dnl
 `  // Use the original slot (not a copy).
-  $11* slot_copy = const_cast<$11*>(&$12);')
+  auto slot_copy = const_cast<$11*>(&$12);')
 
 ')dnl
-  BaseClassType *const base = static_cast<BaseClassType*>(
+  const auto base = static_cast<BaseClassType*>(
 ifdef(`__BOOL_IS_INTERFACE__',`dnl
       _IFACE_PARENT_FROM_OBJECT(gobject_)dnl
 ',`dnl
index 099a1e4..e0f0c29 100644 (file)
@@ -617,6 +617,9 @@ sub output_wrap_sig_decl($$$$$$$$$$$$$$)
   {
     # Strip leading whitespace
     $doxycomment =~ s/^\s+//;
+    # Add a level of m4 quotes. Necessary if $commentblock contains __FT__ or __BT__.
+    # DocsParser::lookup_documentation() adds it in $documentation.
+    $commentblock = "`" . $commentblock . "'";
 
     # We don't have something to add, so just use $commentblock with
     # opening and closing tokens added.