Helpviewer/Bookmarks/BookmarksMenu.py

changeset 7
c679fb30c8f3
parent 0
de9c2efb9d02
child 12
1d8dd9706f46
--- a/Helpviewer/Bookmarks/BookmarksMenu.py	Mon Dec 28 18:31:37 2009 +0000
+++ b/Helpviewer/Bookmarks/BookmarksMenu.py	Wed Dec 30 15:40:33 2009 +0000
@@ -62,12 +62,12 @@
         """
         if self._keyboardModifiers & Qt.ControlModifier:
             self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), 
-                      idx.data(BookmarksModel.UrlRole).toUrl(), 
-                      idx.data(Qt.DisplayRole).toString())
+                      idx.data(BookmarksModel.UrlRole), 
+                      idx.data(Qt.DisplayRole))
         else:
             self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), 
-                      idx.data(BookmarksModel.UrlRole).toUrl(), 
-                      idx.data(Qt.DisplayRole).toString())
+                      idx.data(BookmarksModel.UrlRole), 
+                      idx.data(Qt.DisplayRole))
         self.resetFlags()
     
     def postPopulated(self):
@@ -84,7 +84,7 @@
         for i in range(parent.model().rowCount(parent)):
             child = parent.model().index(i, 0, parent)
             
-            if child.data(BookmarksModel.TypeRole).toInt()[0] == BookmarkNode.Bookmark:
+            if child.data(BookmarksModel.TypeRole) == BookmarkNode.Bookmark:
                 hasBookmarks = True
                 break
         
@@ -110,17 +110,17 @@
         for i in range(parent.model().rowCount(parent)):
             child = parent.model().index(i, 0, parent)
             
-            if child.data(BookmarksModel.TypeRole).toInt()[0] != BookmarkNode.Bookmark:
+            if child.data(BookmarksModel.TypeRole) != BookmarkNode.Bookmark:
                 continue
             
             if i == 0:
                 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"),
-                          child.data(BookmarksModel.UrlRole).toUrl(), 
-                          child.data(Qt.DisplayRole).toString())
+                          child.data(BookmarksModel.UrlRole), 
+                          child.data(Qt.DisplayRole))
             else:
                 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"),
-                          child.data(BookmarksModel.UrlRole).toUrl(), 
-                          child.data(Qt.DisplayRole).toString())
+                          child.data(BookmarksModel.UrlRole), 
+                          child.data(Qt.DisplayRole))
     
     def __contextMenuRequested(self, pos):
         """
@@ -161,8 +161,8 @@
         idx = self.index(self.sender())
         
         self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), 
-                  idx.data(BookmarksModel.UrlRole).toUrl(), 
-                  idx.data(Qt.DisplayRole).toString())
+                  idx.data(BookmarksModel.UrlRole), 
+                  idx.data(Qt.DisplayRole))
     
     def __openBookmarkInNewTab(self):
         """
@@ -171,8 +171,8 @@
         idx = self.index(self.sender())
         
         self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), 
-                  idx.data(BookmarksModel.UrlRole).toUrl(), 
-                  idx.data(Qt.DisplayRole).toString())
+                  idx.data(BookmarksModel.UrlRole), 
+                  idx.data(Qt.DisplayRole))
     
     def __removeBookmark(self):
         """

eric ide

mercurial