[GTK] Remove unused GSettings stuff
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2012 19:16:25 +0000 (19:16 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 19 Feb 2012 19:16:25 +0000 (19:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78995

Reviewed by Martin Robinson.

.:

* configure.ac: remove gsettings schema file creation.

Source/WebKit/gtk:

* GNUmakefile.am: remove GSettings-related stuff.
* WebCoreSupport/InspectorClientGtk.cpp:
(WebKit): Remove unused code.
* org.webkitgtk.gschema.xml.in: Removed.
* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_execute_script): remove gsettings-related helper.
* webkit/webkitwebinspectorprivate.h: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/GNUmakefile.am
Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
Source/WebKit/gtk/org.webkitgtk.gschema.xml.in [deleted file]
Source/WebKit/gtk/webkit/webkitwebinspector.cpp
Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h
configure.ac

index cfe5657..8b6122a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-02-19  Gustavo Noronha Silva  <gns@gnome.org>
+
+        [GTK] Remove unused GSettings stuff
+        https://bugs.webkit.org/show_bug.cgi?id=78995
+
+        Reviewed by Martin Robinson.
+
+        * configure.ac: remove gsettings schema file creation.
+
 2012-02-19  Ryosuke Niwa  <rniwa@webkit.org>
 
         Perf-o-matic should show both WebKit and Chromium revisions
index 465e540..ec858b9 100644 (file)
@@ -1,3 +1,18 @@
+2012-02-19  Gustavo Noronha Silva  <gns@gnome.org>
+
+        [GTK] Remove unused GSettings stuff
+        https://bugs.webkit.org/show_bug.cgi?id=78995
+
+        Reviewed by Martin Robinson.
+
+        * GNUmakefile.am: remove GSettings-related stuff.
+        * WebCoreSupport/InspectorClientGtk.cpp:
+        (WebKit): Remove unused code.
+        * org.webkitgtk.gschema.xml.in: Removed.
+        * webkit/webkitwebinspector.cpp:
+        (webkit_web_inspector_execute_script): remove gsettings-related helper.
+        * webkit/webkitwebinspectorprivate.h: Ditto.
+
 2012-02-17  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         [GTK] change the way of registering DeviceOrientation clients.
index 567d79b..41cdaf3 100644 (file)
@@ -385,10 +385,6 @@ $(GENSOURCES_WEBKIT)/webkitenumtypes.cpp: $(webkitgtk_h_api) $(WebKit)/GNUmakefi
        && cp xgen-gtc $@ \
        && rm -f xgen-gtc
 
-# GSettings
-gsettings_SCHEMAS = $(top_builddir)/Source/WebKit/gtk/org.webkitgtk-@WEBKITGTK_API_VERSION@.gschema.xml
-@GSETTINGS_RULES@
-
 EXTRA_DIST += \
        $(WebKit)/ChangeLog \
        $(WebKit)/NEWS \
index d4d321d..b74d5e1 100644 (file)
@@ -48,55 +48,16 @@ public:
     virtual ~InspectorFrontendSettingsGtk() { }
 
 private:
-#ifdef HAVE_GSETTINGS
-    static bool shouldIgnoreSetting(const String& key)
-    {
-        // GSettings considers trying to fetch or set a setting that is
-        // not backed by a schema as programmer error, and aborts the
-        // program's execution. We check here to avoid having an unhandled
-        // setting as a fatal error.
-        LOG_VERBOSE(NotYetImplemented, "Unknown key ignored: %s", key.ascii().data());
-        return true;
-    }
-
     virtual String getProperty(const String& name)
     {
-        if (shouldIgnoreSetting(name))
-            return String();
-
-        GSettings* settings = inspectorGSettings();
-        if (!settings)
-            return String();
-
-        GRefPtr<GVariant> variant = adoptGRef(g_settings_get_value(settings, name.utf8().data()));
-        return String(g_variant_get_string(variant.get(), 0));
-    }
-
-    virtual void setProperty(const String& name, const String& value)
-    {
-        // Avoid setting unknown keys to avoid aborting the execution.
-        if (shouldIgnoreSetting(name))
-            return;
-
-        GSettings* settings = inspectorGSettings();
-        if (!settings)
-            return;
-
-        GRefPtr<GVariant> variant = adoptGRef(g_variant_new_string(value.utf8().data()));
-        g_settings_set_value(settings, name.utf8().data(), variant.get());
-    }
-#else
-    virtual String getProperty(const String&)
-    {
         notImplemented();
         return String();
     }
 
-    virtual void setProperty(const String&, const String&)
+    virtual void setProperty(const String& name, const String& value)
     {
         notImplemented();
     }
-#endif // HAVE_GSETTINGS
 };
 
 } // namespace
diff --git a/Source/WebKit/gtk/org.webkitgtk.gschema.xml.in b/Source/WebKit/gtk/org.webkitgtk.gschema.xml.in
deleted file mode 100644 (file)
index 17063f4..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<schemalist>
-  <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@" path="/system/webkitgtk/">
-    <child schema="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" name="inspector"/>
-  </schema>
-  <schema id="org.webkitgtk-@WEBKITGTK_API_VERSION@.inspector" path="/system/webkitgtk/inspector/">
-    <key name="resource-tracking-enabled" type="b">
-      <default>false</default>
-      <summary>Resource Tracking Enabled</summary>
-      <description>Whether the Resource Tracking panel is always enabled.</description>
-    </key>
-    <key name="xhr-monitor-enabled" type="b">
-      <default>false</default>
-      <summary>XHR Monitor Enabled</summary>
-      <description>Whether the XHR monitor is always enabled.</description>
-    </key>
-    <key name="debugger-enabled" type="b">
-      <default>false</default>
-      <summary>Debugger Enabled</summary>
-      <description>Whether the debugger is always enabled.</description>
-    </key>
-    <key name="profiler-enabled" type="b">
-      <default>false</default>
-      <summary>Profiler Enabled</summary>
-      <description>Whether the profiler is always enabled.</description>
-    </key>
-    <key name="frontend-settings" type="s">
-      <default>''</default>
-      <summary>Misc Inspector Frontend Settings</summary>
-      <description>Miscelaneous Settings managed by the Inspector Frontend</description>
-    </key>
-  </schema>
-</schemalist>
index c93c2bd..692079f 100644 (file)
@@ -577,42 +577,3 @@ void webkit_web_inspector_execute_script(WebKitWebInspector* webInspector, long
     WebKitWebInspectorPrivate* priv = webInspector->priv;
     priv->page->inspectorController()->evaluateForTestInFrontend(callId, script);
 }
-
-#ifdef HAVE_GSETTINGS
-static bool isSchemaAvailable(const char* schemaID)
-{
-    const char* const* availableSchemas = g_settings_list_schemas();
-    char* const* iter = const_cast<char* const*>(availableSchemas);
-
-    while (*iter) {
-        if (g_str_equal(schemaID, *iter))
-            return true;
-        iter++;
-    }
-
-    return false;
-}
-
-GSettings* inspectorGSettings()
-{
-    static GSettings* settings = 0;
-    if (settings)
-        return settings;
-
-    // Unfortunately GSettings will abort the process execution if the schema is not
-    // installed, which is the case for when running tests, or even the introspection dump
-    // at build time, so check if we have the schema before trying to initialize it.
-    const gchar* schemaID = "org.webkitgtk-"WEBKITGTK_API_VERSION_STRING".inspector";
-    if (!isSchemaAvailable(schemaID)) {
-
-        // This warning is very common on the build bots, which hides valid warnings.
-        // Skip printing it if we are running inside DumpRenderTree.
-        if (!DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled())
-            g_warning("GSettings schema not found - settings will not be used or saved.");
-        return 0;
-    }
-
-    settings = g_settings_new(schemaID);
-    return settings;
-}
-#endif
index 46d57b0..64ba09a 100644 (file)
 
 extern "C" {
 
-#ifdef HAVE_GSETTINGS
-GSettings* inspectorGSettings();
-#endif
-
 void webkit_web_inspector_set_inspector_client(WebKitWebInspector*, WebCore::Page*);
 
 void webkit_web_inspector_set_web_view(WebKitWebInspector*, WebKitWebView*);
index bf81295..870afb8 100644 (file)
@@ -1389,7 +1389,6 @@ Source/WebKit/gtk/webkit/webkitversion.h
 AC_CONFIG_FILES([
 Source/WebKit/gtk/${WEBKITGTK_PC_NAME}-${WEBKITGTK_API_VERSION}.pc:Source/WebKit/gtk/webkit.pc.in
 Source/WebKit/gtk/JSCore-${WEBKITGTK_API_VERSION}.gir:Source/WebKit/gtk/JSCore.gir.in
-Source/WebKit/gtk/org.webkitgtk-${WEBKITGTK_API_VERSION}.gschema.xml:Source/WebKit/gtk/org.webkitgtk.gschema.xml.in
 Source/JavaScriptCore/javascriptcoregtk-${WEBKITGTK_API_VERSION}.pc:Source/JavaScriptCore/javascriptcoregtk.pc.in
 ]
 ,[WEBKITGTK_API_VERSION=$WEBKITGTK_API_VERSION,WEBKITGTK_PC_NAME=$WEBKITGTK_PC_NAME]