[devhelp] build: remove OSX specific handling



commit 93477e51228f60e6036eaab8c213b97c263c27a8
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Fri Feb 1 13:56:29 2013 +0100

    build: remove OSX specific handling
    
    It's all unmaintained anyway.

 src/dh-book-manager.c |   82 -------------------------------------------------
 src/dh-main.c         |   16 ---------
 src/dh-util.c         |   33 -------------------
 src/dh-window.c       |   16 ---------
 4 files changed, 0 insertions(+), 147 deletions(-)
---
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index beb2b3f..fe14534 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -98,11 +98,6 @@ static void    book_manager_set_property      (GObject        *object,
                                                const GValue   *value,
                                                GParamSpec     *pspec);
 
-#ifdef GDK_WINDOWING_QUARTZ
-static void    book_manager_add_from_xcode_docset (DhBookManager *book_manager,
-                                                   const gchar   *dir_path);
-#endif
-
 static void
 book_manager_finalize (GObject *object)
 {
@@ -370,12 +365,6 @@ dh_book_manager_populate (DhBookManager *book_manager)
                                                     *system_dirs);
                 system_dirs++;
         }
-
-#ifdef GDK_WINDOWING_QUARTZ
-        book_manager_add_from_xcode_docset (
-                book_manager,
-                "/Library/Developer/Shared/Documentation/DocSets");
-#endif
 }
 
 static gchar *
@@ -558,76 +547,6 @@ book_manager_add_from_dir (DhBookManager *book_manager,
         g_dir_close (dir);
 }
 
-#ifdef GDK_WINDOWING_QUARTZ
-static gboolean
-seems_docset_dir (const gchar *path)
-{
-        gchar    *tmp;
-        gboolean  seems_like_devhelp = FALSE;
-
-        g_return_val_if_fail (path, FALSE);
-
-        /* Do some sanity checking on the directory first so we don't have
-         * to go through several hundreds of files in every docset.
-         */
-        tmp = g_build_filename (path, "style.css", NULL);
-        if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
-                gchar *tmp;
-
-                tmp = g_build_filename (path, "index.sgml", NULL);
-                if (g_file_test (tmp, G_FILE_TEST_EXISTS)) {
-                        seems_like_devhelp = TRUE;
-                }
-                g_free (tmp);
-        }
-        g_free (tmp);
-
-        return seems_like_devhelp;
-}
-
-static void
-book_manager_add_from_xcode_docset (DhBookManager *book_manager,
-                                    const gchar   *dir_path)
-{
-        GDir        *dir;
-        const gchar *name;
-
-        g_return_if_fail (book_manager);
-        g_return_if_fail (dir_path);
-
-        if (!seems_docset_dir (dir_path)) {
-                return;
-        }
-
-        /* Open directory */
-        dir = g_dir_open (dir_path, 0, NULL);
-        if (!dir) {
-                return;
-        }
-
-        /* Monitor the directory for changes (if it works on MacOSX,
-         * not sure if GIO implements GFileMonitor based on FSEvents
-         * or what */
-        book_manager_monitor_path (book_manager, dir_path);
-
-        /* And iterate it, looking for files ending with .devhelp2 */
-        while ((name = g_dir_read_name (dir)) != NULL) {
-                if (g_strcmp0 (strrchr (name, '.'),
-                               ".devhelp2") == 0) {
-                        gchar *book_path;
-
-                        book_path = g_build_filename (dir_path, name, NULL);
-                        /* Add book from filepath */
-                        book_manager_add_from_filepath (book_manager,
-                                                        book_path);
-                        g_free (book_path);
-                }
-        }
-
-        g_dir_close (dir);
-}
-#endif
-
 static void
 book_manager_book_deleted_cb (DhBook   *book,
                               gpointer  user_data)
@@ -912,4 +831,3 @@ dh_book_manager_new (void)
 {
         return g_object_new (DH_TYPE_BOOK_MANAGER, NULL);
 }
-
diff --git a/src/dh-main.c b/src/dh-main.c
index c2a108d..71d14a6 100644
--- a/src/dh-main.c
+++ b/src/dh-main.c
@@ -106,22 +106,6 @@ main (int argc, char **argv)
         GError  *error = NULL;
         gint     status;
 
-#ifdef GDK_WINDOWING_QUARTZ
-        {
-                gint i;
-
-                for (i = 0; i < argc; i++) {
-                        if (g_str_has_prefix (argv[i], "-psn_")) {
-                                for (; i < argc-1; i++) {
-                                        argv[i] = argv[i+1];
-                                }
-                                argc--;
-                                break;
-                        }
-                }
-        }
-#endif
-
         setlocale (LC_ALL, "");
         bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
diff --git a/src/dh-util.c b/src/dh-util.c
index c24480b..639ed8a 100644
--- a/src/dh-util.c
+++ b/src/dh-util.c
@@ -24,9 +24,6 @@
 #include <stdlib.h>
 #include <gtk/gtk.h>
 #include <math.h>
-#ifdef GDK_WINDOWING_QUARTZ
-#include <gtkosxapplication.h>
-#endif
 #include "dh-util.h"
 
 
@@ -120,32 +117,6 @@ dh_util_builder_connect (GtkBuilder *builder,
         va_end (args);
 }
 
-#ifdef GDK_WINDOWING_QUARTZ
-static gchar *
-util_get_mac_data_dir (void)
-{
-        const gchar *env, *ret;
-        gchar       *tmp;
-
-        /* The environment variable overrides all. */
-        env = g_getenv ("DEVHELP_DATADIR");
-        if (env) {
-                return g_strdup (env);
-        }
-
-        /* If we are not in a bundle, then follow the normal rules. */
-        if (quartz_application_get_bundle_id () == NULL) {
-                return NULL;
-        }
-
-        ret = quartz_application_get_resource_path ();
-        tmp = g_strdup (ret);
-        g_printerr("ret: %s\n", tmp);
-
-        return tmp;
-}
-#endif
-
 gchar *
 dh_util_build_data_filename (const gchar *first_part,
                              ...)
@@ -159,10 +130,6 @@ dh_util_build_data_filename (const gchar *first_part,
 
         va_start (args, first_part);
 
-#ifdef GDK_WINDOWING_QUARTZ
-        datadir = util_get_mac_data_dir ();
-#endif
-
         if (datadir == NULL) {
                 datadir = g_strdup (DATADIR);
         }
diff --git a/src/dh-window.c b/src/dh-window.c
index 3f1d035..8440781 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -32,10 +32,6 @@
 #include <webkit/webkit.h>
 #endif
 
-#ifdef GDK_WINDOWING_QUARTZ
-#include <gtkosxapplication.h>
-#endif
-
 #include <libgd/gd.h>
 
 #include "dh-book-manager.h"
@@ -1293,7 +1289,6 @@ window_open_new_tab (DhWindow    *window,
         return num;
 }
 
-#ifndef GDK_WINDOWING_QUARTZ
 static void
 close_button_clicked_cb (GtkButton *button,
                          DhWindow  *window)
@@ -1340,18 +1335,13 @@ tab_label_style_set_cb (GtkWidget *hbox,
 	button = g_object_get_data (G_OBJECT (hbox), "close-button");
 	gtk_widget_set_size_request (button, w + 2, h + 2);
 }
-#endif
 
-/* Don't create a close button on quartz, it looks very much out of
- * place.
- */
 static GtkWidget*
 window_new_tab_label (DhWindow        *window,
                       const gchar     *str,
                       const GtkWidget *parent)
 {
         GtkWidget *label;
-#ifndef GDK_WINDOWING_QUARTZ
         GtkWidget *hbox;
         GtkWidget *close_button;
         GtkWidget *image;
@@ -1386,12 +1376,6 @@ window_new_tab_label (DhWindow        *window,
         g_object_set_data (G_OBJECT (hbox), "close-button", close_button);
 
         return hbox;
-#else
-        label = gtk_label_new (str);
-        g_object_set_data (G_OBJECT (label), "label", label);
-
-        return label;
-#endif
 }
 
 static WebKitWebView *



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