dasher r3527 - in trunk: . Src/Gtk2



Author: alarson
Date: Tue Apr 29 04:04:34 2008
New Revision: 3527
URL: http://svn.gnome.org/viewvc/dasher?rev=3527&view=rev

Log:
free() vs g_free() and misc cleanups uncovered during review of
experimental_win_gtk changes.


Modified:
   trunk/ChangeLog
   trunk/Src/Gtk2/Canvas.cpp
   trunk/Src/Gtk2/DasherControl.cpp
   trunk/Src/Gtk2/Preferences.cpp
   trunk/Src/Gtk2/dasher_main.cpp
   trunk/Src/Gtk2/module_settings_window.cpp

Modified: trunk/Src/Gtk2/Canvas.cpp
==============================================================================
--- trunk/Src/Gtk2/Canvas.cpp	(original)
+++ trunk/Src/Gtk2/Canvas.cpp	Tue Apr 29 04:04:34 2008
@@ -189,7 +189,7 @@
   // gtk_main_iteration_do(0);
 }
 
-void CCanvas::DrawRectangle(int x1, int y1, int x2, int y2, int Color, int iOutlineColour, Opts::ColorSchemes ColorScheme, bool bDrawOutline, bool bFill, int iThickness) {
+void CCanvas::DrawRectangle(screenint x1, screenint y1, screenint x2, screenint y2, int Color, int iOutlineColour, Opts::ColorSchemes ColorScheme, bool bDrawOutline, bool bFill, int iThickness) {
 
   //  std::cout << "Raw Rectangle, (" << x1 << ", " << y1 << ") - (" << x2 << ", " << y2 << ")" << std::endl;
 
@@ -383,7 +383,7 @@
   END_DRAWING;
 }
 
-void CCanvas::DrawString(const std::string &String, int x1, int y1, int size) {
+void CCanvas::DrawString(const std::string &String, screenint x1, screenint y1, int size) {
   
 #if WITH_CAIRO
 #else
@@ -415,8 +415,7 @@
   END_DRAWING;
 }
 
-void CCanvas::TextSize(const std::string &String, int *Width, int *Height, int size) {
-
+void CCanvas::TextSize(const std::string &String, screenint *Width, screenint *Height, int size) {
 #if WITH_CAIRO
   PangoLayout *pLayout(m_pPangoCache->GetLayout(cr, String, size));
 #else

Modified: trunk/Src/Gtk2/DasherControl.cpp
==============================================================================
--- trunk/Src/Gtk2/DasherControl.cpp	(original)
+++ trunk/Src/Gtk2/DasherControl.cpp	Tue Apr 29 04:04:34 2008
@@ -111,7 +111,7 @@
 void CDasherControl::SetupPaths() {
   char *home_dir;
   char *user_data_dir;
-  char *system_data_dir;
+  const char *system_data_dir;
 
   home_dir = getenv("HOME");
   user_data_dir = new char[strlen(home_dir) + 10];

Modified: trunk/Src/Gtk2/Preferences.cpp
==============================================================================
--- trunk/Src/Gtk2/Preferences.cpp	(original)
+++ trunk/Src/Gtk2/Preferences.cpp	Tue Apr 29 04:04:34 2008
@@ -22,7 +22,7 @@
 
 struct _BoolTranslation {
   gint iParameter;
-  gchar *szWidgetName;
+  const gchar *szWidgetName;
   GtkWidget *pWidget;
 };
 
@@ -54,9 +54,9 @@
 
 struct _StringTranslation {
   gint iParameter;
-  gchar *szWidgetName;
+  const gchar *szWidgetName;
   GtkWidget *pWidget;
-  gchar *szHelperName;
+  const gchar *szHelperName;
   GtkWidget *pHelper;
 };
 
@@ -335,7 +335,7 @@
   gtk_tree_model_get(pModel, pIter, 2, &szComparison, -1);
 
   if(!strcmp(szTarget, szComparison)) {
-    free(szComparison);
+    g_free(szComparison);
     // Todo: set selection here?
     gtk_tree_view_set_cursor((GtkTreeView *)pPointers[1], pPath, NULL, false);
 
@@ -344,7 +344,7 @@
     return true;
   }
 
-  free(szComparison);
+  g_free(szComparison);
   
   return false;
 }
@@ -488,7 +488,7 @@
     gtk_tree_model_get(pModel, &oIter, 0, &iParameter, 1, &pHelper, 2, &szValue, 4, &pHelperWindow, 5, &pHelperWindowRef, -1);
     
     dasher_app_settings_set_string(pPrivate->pAppSettings, iParameter, szValue);
-    free(szValue);
+    g_free(szValue);
 
     if(pHelper) {
       gtk_widget_set_sensitive(GTK_WIDGET(pHelper), pHelperWindow != NULL);

Modified: trunk/Src/Gtk2/dasher_main.cpp
==============================================================================
--- trunk/Src/Gtk2/dasher_main.cpp	(original)
+++ trunk/Src/Gtk2/dasher_main.cpp	Tue Apr 29 04:04:34 2008
@@ -1286,7 +1286,7 @@
     else 
       dasher_app_settings_set_string(pPrivate->pAppSettings, SP_ALPHABET_ID, szSelected);
 
-    free(szSelected);
+    g_free(szSelected);
   }
 }
 

Modified: trunk/Src/Gtk2/module_settings_window.cpp
==============================================================================
--- trunk/Src/Gtk2/module_settings_window.cpp	(original)
+++ trunk/Src/Gtk2/module_settings_window.cpp	Tue Apr 29 04:04:34 2008
@@ -93,7 +93,7 @@
   
   GtkWidget *pFrame = gtk_frame_new(szFrameTitle);
 
-  free(szFrameTitle);
+  g_free(szFrameTitle);
 
   gtk_container_add(GTK_CONTAINER(pDasherControl->window.vbox), pFrame);
   g_object_set(G_OBJECT(pFrame), "border-width", 8, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]