[nautilus/ensure-starred-directory-type: 2/3] files-view: ensure starred directory type is registered
- From: Ernestas Kulik <ernestask src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/ensure-starred-directory-type: 2/3] files-view: ensure starred directory type is registered
- Date: Sat, 3 Mar 2018 17:35:59 +0000 (UTC)
commit 02e8011c3d189357d619d87b7d0675bfcbe11f40
Author: Ernestas Kulik <ernestask gnome org>
Date: Fri Mar 2 15:01:58 2018 +0200
files-view: ensure starred directory type is registered
Since 9ec2be563527a6821625b33a896c2478728a0a3c removed the only call to
nautilus_starred_directory_get_type(), the extension isn’t registered
and starred:/// does not load.
src/nautilus-file-utilities.c | 6 ++++++
src/nautilus-files-view.c | 1 -
src/nautilus-search-directory.c | 6 ++++++
src/nautilus-starred-directory.c | 6 ++++++
4 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index a642f38e0..5fcc40668 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -29,6 +29,7 @@
#include "nautilus-file.h"
#include "nautilus-file-operations.h"
#include "nautilus-search-directory.h"
+#include "nautilus-starred-directory.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@@ -1419,7 +1420,12 @@ nautilus_self_check_file_utilities (void)
void
nautilus_ensure_extension_builtins (void)
{
+ /* Please add new extension types here, even if you can guarantee
+ * that they will be registered by the time the extension point
+ * is iterating over its extensions.
+ */
g_type_ensure (NAUTILUS_TYPE_SEARCH_DIRECTORY);
+ g_type_ensure (NAUTILUS_TYPE_STARRED_DIRECTORY);
}
void
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index d3595a476..55d0aeb4e 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -65,7 +65,6 @@
#include <nautilus-extension.h>
#include "nautilus-clipboard.h"
#include "nautilus-search-directory.h"
-#include "nautilus-starred-directory.h"
#include "nautilus-directory.h"
#include "nautilus-dnd.h"
#include "nautilus-file-attributes.h"
diff --git a/src/nautilus-search-directory.c b/src/nautilus-search-directory.c
index 1d91b0329..c70915d53 100644
--- a/src/nautilus-search-directory.c
+++ b/src/nautilus-search-directory.c
@@ -103,6 +103,12 @@ enum
G_DEFINE_TYPE_WITH_CODE (NautilusSearchDirectory, nautilus_search_directory, NAUTILUS_TYPE_DIRECTORY,
nautilus_ensure_extension_points ();
+ /* It looks like you’re implementing an extension point.
+ * Did you modify nautilus_ensure_extension_builtins() accordingly?
+ *
+ * • Yes
+ * • Doing it right now
+ */
g_io_extension_point_implement (NAUTILUS_DIRECTORY_PROVIDER_EXTENSION_POINT_NAME,
g_define_type_id,
NAUTILUS_SEARCH_DIRECTORY_PROVIDER_NAME,
diff --git a/src/nautilus-starred-directory.c b/src/nautilus-starred-directory.c
index 8068ad5dc..da00a579b 100644
--- a/src/nautilus-starred-directory.c
+++ b/src/nautilus-starred-directory.c
@@ -56,6 +56,12 @@ typedef struct
G_DEFINE_TYPE_WITH_CODE (NautilusFavoriteDirectory, nautilus_starred_directory, NAUTILUS_TYPE_DIRECTORY,
nautilus_ensure_extension_points ();
+ /* It looks like you’re implementing an extension point.
+ * Did you modify nautilus_ensure_extension_builtins() accordingly?
+ *
+ * • Yes
+ * • Doing it right now
+ */
g_io_extension_point_implement (NAUTILUS_DIRECTORY_PROVIDER_EXTENSION_POINT_NAME,
g_define_type_id,
NAUTILUS_STARRED_DIRECTORY_PROVIDER_NAME,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]