src/eric7/WebBrowser/Bookmarks/BookmarkNode.py

branch
eric7
changeset 10482
72d9b5ea39b4
parent 10475
ee41fab001f2
child 11090
f5f5f5803935
--- a/src/eric7/WebBrowser/Bookmarks/BookmarkNode.py	Fri Jan 05 16:04:03 2024 +0100
+++ b/src/eric7/WebBrowser/Bookmarks/BookmarkNode.py	Sat Jan 06 15:21:02 2024 +0100
@@ -7,28 +7,38 @@
 Module implementing the bookmark node.
 """
 
+import enum
+
 from PyQt6.QtCore import QDateTime
 
 
+class BookmarkNodeType(enum.Enum):
+    """
+    Class defining the bookmark node types.
+    """
+
+    Root = 0
+    Folder = 1
+    Bookmark = 2
+    Separator = 3
+
+
+class BookmarkTimestampType(enum.Enum):
+    """
+    Class defining the bookmark timestamp types.
+    """
+
+    Added = 0
+    Modified = 1
+    Visited = 2
+
+
 class BookmarkNode:
     """
     Class implementing the bookmark node type.
     """
 
-    # TODO: change this to an enum
-    # possible bookmark node types
-    Root = 0
-    Folder = 1
-    Bookmark = 2
-    Separator = 3
-
-    # TODO: change this to an enum
-    # possible timestamp types
-    TsAdded = 0
-    TsModified = 1
-    TsVisited = 2
-
-    def __init__(self, type_=Root, parent=None):
+    def __init__(self, type_=BookmarkNodeType.Root, parent=None):
         """
         Constructor
 
@@ -98,7 +108,7 @@
         @param offset position where to insert child (-1 = append)
         @type int
         """
-        if child._type == BookmarkNode.Root:
+        if child._type == BookmarkNodeType.Root:
             return
 
         if child._parent is not None:

eric ide

mercurial