[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 21/96: CanvasView size is maintained in applet - dont try to reread it from the config on every do_update...
noreply at xfce.org
noreply at xfce.org
Thu Nov 27 22:20:26 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 25617eca751e4bf94130c2b3e26c7f9fd8841b2e
Author: Omega Weapon <OmegaPhil at gmail.com>
Date: Sat Nov 2 16:52:28 2013 +0000
CanvasView size is maintained in applet - dont try to reread it from the config on every do_update...
---
src/canvas-view.cpp | 54 ++-------------------------------------------------
1 file changed, 2 insertions(+), 52 deletions(-)
diff --git a/src/canvas-view.cpp b/src/canvas-view.cpp
index 43f84de..3c6f207 100644
--- a/src/canvas-view.cpp
+++ b/src/canvas-view.cpp
@@ -54,61 +54,11 @@ void CanvasView::do_display()
void CanvasView::do_update()
{
- size = 60;
- bool size_missing = true;
-
// Debug code
//std::cout << "In CanvasView::do_update!\n";
- /* Obtaining size
- * 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);
-
- // Loading size
- if (xfce_rc_has_entry(settings, "viewer_size"))
- {
- size = xfce_rc_read_int_entry(settings, "viewer_size", 60);
- size_missing = false;
- }
-
- // Close settings file
- xfce_rc_close(settings);
- }
-
- /* Setting default viewer size then updating config if it hasn't been
- * saved. XFCE4 configuration is done in read and write stages, so
- * this needs to be separated */
- if (size_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);
-
- // Saving viewer size
- xfce_rc_write_int_entry(settings, "viewer_size", size);
-
- // 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 viewer size in CanvasView::do_update call!\n");
- }
- }
+ // Size is maintained in applet
+ size = applet->get_viewer_size();
// Ensure the canvas is shown
resize_canvas();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list