Re: qgit shows wrong popup

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: qgit shows wrong popup

From: Marco Costalba <hidden>
Date: 2016-06-15 22:42:16

quoted
I found this comment in mainimpl.cpp:
 // call an async context popup, DO NOT filter out event
 // we append the event to main event loop queue so Qt can send
 // currentChanged() signal to listViewLog before our popup is
populated

I guess the code doesn't work the way the comment says.
Hi Pavel,

please test the following an let me know if it is ok for you.
@@ -1378,9 +1378,21 @@ void MainImpl::customEvent(QCustomEvent*
  	if (e->type() == STATS_EV) // archive loading complete
  		loadComplete(((ThreadStatsEvent*)e)->data());

-	if (e->type() == POPUP_EV) // deferred popup
-		doContexPopup(listViewLog->currentItem());
-
+	if (e->type() == POPUP_EV) { // deferred popup
+		QListViewItem* item = listViewLog->currentItem();
+		if (item) {
+			// if mainview is already updated pop-up
+			// context menu, otherwise it means dispatch()
+			// has not been called til now, so resend the event,
+			// it will be queued up after dispatch.
+			if (item->text(COMMIT_COL) == mainViewSha)
+				doContexPopup(listViewLog->currentItem());
+			else {
+				DeferredPopupEvent* e = new DeferredPopupEvent();
+				QApplication::postEvent(this, e);
+			}
+		}
+	}
  	if (e->type() == POPUP_TREE_EV) // deferred tree popup
  		doTreeContexPopup(treeView->currentItem());


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it

Re: qgit shows wrong popup

From: Pavel Roskin <hidden>
Date: 2016-06-15 22:42:16

Hi, Marco!

On Fri, 2006-01-13 at 18:41 +0100, Marco Costalba wrote:
please test the following an let me know if it is ok for you.
It works, but not the first time.  Suppose I have two unapplied patches
and one applied.  qgit focuses on the top unapplied patch on startup.
Right-click on the applied patch shows disabled "Push Patch".  Then I
select the top line again, right-click on the applied patch, and I see
enabled "Pop Patch".

-- 
Regards,
Pavel Roskin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help