From 6a3695b2d488dc4a79d02bdf8cda1346e07b838f Mon Sep 17 00:00:00 2001 From: "kov@webkit.org" Date: Sun, 19 Feb 2012 19:16:25 +0000 Subject: [PATCH] [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. 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 | 9 +++++ Source/WebKit/gtk/ChangeLog | 15 ++++++++ Source/WebKit/gtk/GNUmakefile.am | 4 --- .../gtk/WebCoreSupport/InspectorClientGtk.cpp | 41 +--------------------- Source/WebKit/gtk/org.webkitgtk.gschema.xml.in | 32 ----------------- Source/WebKit/gtk/webkit/webkitwebinspector.cpp | 39 -------------------- .../WebKit/gtk/webkit/webkitwebinspectorprivate.h | 4 --- configure.ac | 1 - 8 files changed, 25 insertions(+), 120 deletions(-) delete mode 100644 Source/WebKit/gtk/org.webkitgtk.gschema.xml.in diff --git a/ChangeLog b/ChangeLog index cfe5657..8b6122a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-02-19 Gustavo Noronha Silva + + [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 Perf-o-matic should show both WebKit and Chromium revisions diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog index 465e540..ec858b9 100644 --- a/Source/WebKit/gtk/ChangeLog +++ b/Source/WebKit/gtk/ChangeLog @@ -1,3 +1,18 @@ +2012-02-19 Gustavo Noronha Silva + + [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 [GTK] change the way of registering DeviceOrientation clients. diff --git a/Source/WebKit/gtk/GNUmakefile.am b/Source/WebKit/gtk/GNUmakefile.am index 567d79b..41cdaf3 100644 --- a/Source/WebKit/gtk/GNUmakefile.am +++ b/Source/WebKit/gtk/GNUmakefile.am @@ -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 \ diff --git a/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp index d4d321d..b74d5e1 100644 --- a/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp +++ b/Source/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp @@ -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 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 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 index 17063f4..0000000 --- a/Source/WebKit/gtk/org.webkitgtk.gschema.xml.in +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - false - Resource Tracking Enabled - Whether the Resource Tracking panel is always enabled. - - - false - XHR Monitor Enabled - Whether the XHR monitor is always enabled. - - - false - Debugger Enabled - Whether the debugger is always enabled. - - - false - Profiler Enabled - Whether the profiler is always enabled. - - - '' - Misc Inspector Frontend Settings - Miscelaneous Settings managed by the Inspector Frontend - - - diff --git a/Source/WebKit/gtk/webkit/webkitwebinspector.cpp b/Source/WebKit/gtk/webkit/webkitwebinspector.cpp index c93c2bd..692079f 100644 --- a/Source/WebKit/gtk/webkit/webkitwebinspector.cpp +++ b/Source/WebKit/gtk/webkit/webkitwebinspector.cpp @@ -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(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 diff --git a/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h b/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h index 46d57b0..64ba09a 100644 --- a/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h +++ b/Source/WebKit/gtk/webkit/webkitwebinspectorprivate.h @@ -25,10 +25,6 @@ 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*); diff --git a/configure.ac b/configure.ac index bf81295..870afb8 100644 --- a/configure.ac +++ b/configure.ac @@ -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] -- 2.7.4