[ekiga] Simplify platform code



commit f188915a80cdb1a622cdb21723596b20cd0fdc7e
Author: Eugen Dedu <Eugen Dedu pu-pm univ-fcomte fr>
Date:   Thu Aug 9 14:51:20 2012 +0200

    Simplify platform code

 lib/Makefile.am                               |   10 ++---
 lib/platform/platform-generic.c               |   49 -------------------------
 lib/platform/{platform-win32.c => platform.c} |   13 ++++++-
 lib/platform/{gm-platform.h => platform.h}    |    2 +-
 src/gui/main.cpp                              |    2 +-
 5 files changed, 17 insertions(+), 59 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 6f7ce4d..95f9328 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -86,14 +86,12 @@ libekiga_la_SOURCES += \
 # Sources out of the platform directory
 ##
 
-libekiga_la_SOURCES += $(top_srcdir)/lib/platform/gm-platform.h
+libekiga_la_SOURCES += \
+	$(top_srcdir)/lib/platform/platform.h \
+	$(top_srcdir)/lib/platform/platform.c
 
 if WIN32
-libekiga_la_SOURCES += \
-	$(top_srcdir)/lib/platform/platform-win32.c \
-	$(top_srcdir)/lib/platform/winpaths.h
-else
-libekiga_la_SOURCES += $(top_srcdir)/lib/platform/platform-generic.c
+libekiga_la_SOURCES += $(top_srcdir)/lib/platform/winpaths.h
 endif
 
 ##
diff --git a/lib/platform/platform-win32.c b/lib/platform/platform.c
similarity index 93%
rename from lib/platform/platform-win32.c
rename to lib/platform/platform.c
index 9ac144e..7a422b8 100644
--- a/lib/platform/platform-win32.c
+++ b/lib/platform/platform.c
@@ -27,14 +27,16 @@
 
 
 /*
- *                         platform-win32.c  -  description
+ *                         platform.c  -  description
  *                         ------------------------------------------
  *   begin                : Nov 2006
  *   copyright            : (C) 2006-2007 by Julien Puydt
  *   description          : Implementation of platform-specific workarounds
  */
 
-#include "gm-platform.h"
+#include "platform.h"
+
+#ifdef WIN32
 #include "winpaths.h"
 
 /* Yes, static variables should be avoided -- but we will need those paths
@@ -44,22 +46,28 @@
 static gchar *basedir = NULL;
 static gchar *sysconfdir = NULL;
 static gchar *datadir = NULL;
+#endif
 
 void
 gm_platform_init ()
 {
+#ifdef WIN32
   basedir = g_strdup (g_win32_get_package_installation_directory_of_module (NULL));
   sysconfdir = g_strdup (basedir);
   datadir = g_strdup (basedir);
+#endif
 }
 
 void gm_platform_shutdown ()
 {
+#ifdef WIN32
   g_free (basedir);
   g_free (sysconfdir);
   g_free (datadir);
+#endif
 }
 
+#ifdef WIN32
 const gchar *
 win32_sysconfdir ()
 {
@@ -71,3 +79,4 @@ win32_datadir ()
 {
   return datadir;
 }
+#endif
diff --git a/lib/platform/gm-platform.h b/lib/platform/platform.h
similarity index 96%
rename from lib/platform/gm-platform.h
rename to lib/platform/platform.h
index a7d8455..64faaf5 100644
--- a/lib/platform/gm-platform.h
+++ b/lib/platform/platform.h
@@ -27,7 +27,7 @@
 
 
 /*
- *                         gm-platform.h  -  description
+ *                         platform.h  -  description
  *                         ------------------------------------------
  *   begin                : written in 2006 by Julien Puydt
  *   copyright            : (c) 2006-2007 by Julien Puydt
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 8286516..a73ca5a 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -38,7 +38,7 @@
 #include "config.h"
 #include "common.h"
 
-#include "platform/gm-platform.h"
+#include "platform/platform.h"
 
 #include <glib/gi18n.h>
 



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