96 """ |
96 """ |
97 assert idx.isValid() |
97 assert idx.isValid() |
98 |
98 |
99 if self._keyboardModifiers & Qt.ControlModifier: |
99 if self._keyboardModifiers & Qt.ControlModifier: |
100 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
100 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
101 idx.data(BookmarksModel.UrlRole).toUrl(), |
101 idx.data(BookmarksModel.UrlRole), |
102 idx.data(Qt.DisplayRole).toString()) |
102 idx.data(Qt.DisplayRole)) |
103 else: |
103 else: |
104 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
104 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
105 idx.data(BookmarksModel.UrlRole).toUrl(), |
105 idx.data(BookmarksModel.UrlRole), |
106 idx.data(Qt.DisplayRole).toString()) |
106 idx.data(Qt.DisplayRole)) |
107 |
107 |
108 def __openToolBarBookmark(self): |
108 def __openToolBarBookmark(self): |
109 """ |
109 """ |
110 Private slot to open a bookmark in the current browser tab. |
110 Private slot to open a bookmark in the current browser tab. |
111 """ |
111 """ |
112 idx = self.index(self.sender()) |
112 idx = self.index(self.sender()) |
113 |
113 |
114 if self._keyboardModifiers & Qt.ControlModifier: |
114 if self._keyboardModifiers & Qt.ControlModifier: |
115 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
115 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
116 idx.data(BookmarksModel.UrlRole).toUrl(), |
116 idx.data(BookmarksModel.UrlRole), |
117 idx.data(Qt.DisplayRole).toString()) |
117 idx.data(Qt.DisplayRole)) |
118 else: |
118 else: |
119 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
119 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
120 idx.data(BookmarksModel.UrlRole).toUrl(), |
120 idx.data(BookmarksModel.UrlRole), |
121 idx.data(Qt.DisplayRole).toString()) |
121 idx.data(Qt.DisplayRole)) |
122 self.resetFlags() |
122 self.resetFlags() |
123 |
123 |
124 def __openBookmark(self): |
124 def __openBookmark(self): |
125 """ |
125 """ |
126 Private slot to open a bookmark in the current browser tab. |
126 Private slot to open a bookmark in the current browser tab. |
127 """ |
127 """ |
128 idx = self.index(self.sender()) |
128 idx = self.index(self.sender()) |
129 |
129 |
130 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
130 self.emit(SIGNAL("openUrl(const QUrl&, const QString&)"), |
131 idx.data(BookmarksModel.UrlRole).toUrl(), |
131 idx.data(BookmarksModel.UrlRole), |
132 idx.data(Qt.DisplayRole).toString()) |
132 idx.data(Qt.DisplayRole)) |
133 |
133 |
134 def __openBookmarkInNewTab(self): |
134 def __openBookmarkInNewTab(self): |
135 """ |
135 """ |
136 Private slot to open a bookmark in a new browser tab. |
136 Private slot to open a bookmark in a new browser tab. |
137 """ |
137 """ |
138 idx = self.index(self.sender()) |
138 idx = self.index(self.sender()) |
139 |
139 |
140 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
140 self.emit(SIGNAL("newUrl(const QUrl&, const QString&)"), |
141 idx.data(BookmarksModel.UrlRole).toUrl(), |
141 idx.data(BookmarksModel.UrlRole), |
142 idx.data(Qt.DisplayRole).toString()) |
142 idx.data(Qt.DisplayRole)) |
143 |
143 |
144 def __removeBookmark(self): |
144 def __removeBookmark(self): |
145 """ |
145 """ |
146 Private slot to remove a bookmark. |
146 Private slot to remove a bookmark. |
147 """ |
147 """ |