[dconf-editor] Move ViewType near BrowserWindow.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Move ViewType near BrowserWindow.
- Date: Fri, 11 Jan 2019 13:01:54 +0000 (UTC)
commit 06cdb88381836545352e28a71c9dfd08cb754f10
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Fri Jan 11 11:00:20 2019 +0100
Move ViewType near BrowserWindow.
This enum is used by the Browser* family.
editor/browser-window.vala | 59 ++++++++++++++++++++++++++++++++++++++++++++++
editor/dconf-window.vala | 59 ----------------------------------------------
2 files changed, 59 insertions(+), 59 deletions(-)
---
diff --git a/editor/browser-window.vala b/editor/browser-window.vala
index 616dfeb..f4dbb68 100644
--- a/editor/browser-window.vala
+++ b/editor/browser-window.vala
@@ -17,6 +17,65 @@
using Gtk;
+internal enum ViewType {
+ OBJECT,
+ FOLDER,
+ SEARCH,
+ CONFIG;
+
+ internal static uint8 to_byte (ViewType type)
+ {
+ switch (type)
+ {
+ case ViewType.OBJECT: return 0;
+ case ViewType.FOLDER: return 1;
+ case ViewType.SEARCH: return 2;
+ case ViewType.CONFIG: return 3;
+ default: assert_not_reached ();
+ }
+ }
+
+ internal static ViewType from_byte (uint8 type)
+ {
+ switch (type)
+ {
+ case 0: return ViewType.OBJECT;
+ case 1: return ViewType.FOLDER;
+ case 2: return ViewType.SEARCH;
+ case 3: return ViewType.CONFIG;
+ default: assert_not_reached ();
+ }
+ }
+
+ internal static bool displays_objects_list (ViewType type)
+ {
+ switch (type)
+ {
+ case ViewType.OBJECT:
+ case ViewType.CONFIG:
+ return false;
+ case ViewType.FOLDER:
+ case ViewType.SEARCH:
+ return true;
+ default: assert_not_reached ();
+ }
+ }
+
+ internal static bool displays_object_infos (ViewType type)
+ {
+ switch (type)
+ {
+ case ViewType.OBJECT:
+ case ViewType.CONFIG:
+ return true;
+ case ViewType.FOLDER:
+ case ViewType.SEARCH:
+ return false;
+ default: assert_not_reached ();
+ }
+ }
+}
+
private abstract class BrowserWindow : BaseWindow
{
protected const string root_path = "/"; // TODO allow changing that
diff --git a/editor/dconf-window.vala b/editor/dconf-window.vala
index 87038d7..48745c5 100644
--- a/editor/dconf-window.vala
+++ b/editor/dconf-window.vala
@@ -26,65 +26,6 @@ internal enum RelocatableSchemasEnabledMappings
STARTUP
}
-internal enum ViewType {
- OBJECT,
- FOLDER,
- SEARCH,
- CONFIG;
-
- internal static uint8 to_byte (ViewType type)
- {
- switch (type)
- {
- case ViewType.OBJECT: return 0;
- case ViewType.FOLDER: return 1;
- case ViewType.SEARCH: return 2;
- case ViewType.CONFIG: return 3;
- default: assert_not_reached ();
- }
- }
-
- internal static ViewType from_byte (uint8 type)
- {
- switch (type)
- {
- case 0: return ViewType.OBJECT;
- case 1: return ViewType.FOLDER;
- case 2: return ViewType.SEARCH;
- case 3: return ViewType.CONFIG;
- default: assert_not_reached ();
- }
- }
-
- internal static bool displays_objects_list (ViewType type)
- {
- switch (type)
- {
- case ViewType.OBJECT:
- case ViewType.CONFIG:
- return false;
- case ViewType.FOLDER:
- case ViewType.SEARCH:
- return true;
- default: assert_not_reached ();
- }
- }
-
- internal static bool displays_object_infos (ViewType type)
- {
- switch (type)
- {
- case ViewType.OBJECT:
- case ViewType.CONFIG:
- return true;
- case ViewType.FOLDER:
- case ViewType.SEARCH:
- return false;
- default: assert_not_reached ();
- }
- }
-}
-
private class DConfWindow : BookmarksWindow
{
private SettingsModel model;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]