[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 30/96: Cleanup last gconf hook TODOs, remove superfluous TextView fontname lookup and save

noreply at xfce.org noreply at xfce.org
Thu Nov 27 22:20:35 CET 2014


This is an automated email from the git hooks/post-receive script.

nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.

commit de60c1f4a7010554a6f5eee6203db000ea17a076
Author: Omega Weapon <OmegaPhil at gmail.com>
Date:   Mon Nov 4 19:30:13 2013 +0000

    Cleanup last gconf hook TODOs, remove superfluous TextView fontname lookup and save
---
 src/preferences-window.cpp |   15 -----------
 src/text-view.cpp          |   61 ++------------------------------------------
 2 files changed, 2 insertions(+), 74 deletions(-)

diff --git a/src/preferences-window.cpp b/src/preferences-window.cpp
index 9824a9a..f4ba7e1 100644
--- a/src/preferences-window.cpp
+++ b/src/preferences-window.cpp
@@ -159,21 +159,6 @@ PreferencesWindow::PreferencesWindow(Applet &applet_, monitor_seq monitors)
   ui->get_widget("monitor_flame_options", monitor_flame_options);
   ui->get_widget("flame_colorbutton", flame_colorbutton);
   connect_monitor_colorbutton(flame_colorbutton);
-  
-  
-  // connect GConf
-  // TODO: Do these even need to be set up? When a chnge is made, then the relevant function is to be called
-  /*
-  client->notify_add(dir + "/background_interval",
-		     sigc::mem_fun(*this, &PreferencesWindow::
-				background_color_listener));
-
-  client->notify_add(dir + "/viewer/size",
-		     sigc::mem_fun(*this, &PreferencesWindow::size_listener));
-
-  client->notify_add(dir + "/viewer/font",
-		     sigc::mem_fun(*this, &PreferencesWindow::font_listener));
-  */
 
   // Fill in values
   viewer_type_listener(0, applet.get_viewer_type());
diff --git a/src/text-view.cpp b/src/text-view.cpp
index 921c64e..a2ed4de 100644
--- a/src/text-view.cpp
+++ b/src/text-view.cpp
@@ -99,66 +99,9 @@ void TextView::do_display()
 
 void TextView::do_update()
 {
-  bool font_missing = true;
-
-  /* First update viewer font
-   * Keeping with the default settings group for viewer settings
-   * Search for settings file */
-  gchar* file = xfce_panel_plugin_lookup_rc_file(applet->panel_applet);
-
-  if (file)
-  {
-    // One exists - loading readonly settings
-    XfceRc* settings = xfce_rc_simple_open(file, true);
-    g_free(file);
-
-    // Ensuring default group is in focus
-    xfce_rc_set_group(settings, "[NULL]");
-
-    // Loading font_name
-    if (xfce_rc_has_entry(settings, "viewer_font"))
-    {
-      font = xfce_rc_read_entry(settings, "viewer_font", "");
-      font_missing = false;
-    }
-
-    // Close settings file
-    xfce_rc_close(settings);
-  }
-
-  /* Saving if font was not recorded. XFCE4 configuration is done in
-   * read and write stages, so this needs to be separated */
-  if (font_missing)
-  {
-    // Search for a writeable settings file, create one if it doesnt exist
-    file = xfce_panel_plugin_save_location(applet->panel_applet, true);
-
-    if (file)
-    {
-      // Opening setting file
-      XfceRc* settings = xfce_rc_simple_open(file, false);
-      g_free(file);
-
-      // Ensuring default group is in focus
-      xfce_rc_set_group(settings, "[NULL]");
-
-      // Saving viewer size
-      xfce_rc_write_entry(settings, "viewer_font", font.c_str());
-
-      // Close settings file
-      xfce_rc_close(settings);
-    }
-    else
-    {
-      // Unable to obtain writeable config file - informing user
-      std::cerr << _("Unable to obtain writeable config file path in "
-        "order to update font in TextView::do_update call!\n");
-    }
-  }
-
-  // then update
+  // Update
   for (text_iterator i = texts.begin(), end = texts.end(); i != end; ++i)
-    (*i)->update(font);
+    (*i)->update(applet->get_viewer_font());
 }
 
 void TextView::do_attach(Monitor *monitor)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list