From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id E03D013864A for ; Thu, 24 Jan 2013 10:15:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EAA7BE0746; Thu, 24 Jan 2013 10:15:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 55354E0743 for ; Thu, 24 Jan 2013 10:15:10 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 53E4833DA0B for ; Thu, 24 Jan 2013 10:15:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EE64EE4089 for ; Thu, 24 Jan 2013 10:15:07 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1359022566.d1a02e6e159fedf7519b6b5a18c5d922aa6c9533.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: ufed-curses.c X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: d1a02e6e159fedf7519b6b5a18c5d922aa6c9533 X-VCS-Branch: master Date: Thu, 24 Jan 2013 10:15:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 0ac27ec5-920c-4058-a901-468071424cfc X-Archives-Hash: b320e92406c1c783c90119163f0a289a commit: d1a02e6e159fedf7519b6b5a18c5d922aa6c9533 Author: Sven Eden gmx de> AuthorDate: Thu Jan 24 10:16:06 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Thu Jan 24 10:16:06 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=d1a02e6e Set sane filters on every maineventloop start. --- ufed-curses.c | 28 +++++++++++++++++----------- 1 files changed, 17 insertions(+), 11 deletions(-) diff --git a/ufed-curses.c b/ufed-curses.c index e4934ae..8b1b53a 100644 --- a/ufed-curses.c +++ b/ufed-curses.c @@ -42,11 +42,11 @@ extern int lineCountMasked; /* internal prototypes */ int (*callback)(struct item **, int); int (*drawitem)(struct item *, bool); -void checktermsize(); -void draw(); -void drawscrollbar(); -int getListHeight(); -void resetDisplay(); +void checktermsize(void); +void draw(void); +void drawscrollbar(void); +int getListHeight(void); +void resetDisplay(void); void setNextItem(int count, bool strict); void setPrevItem(int count, bool strict); @@ -416,6 +416,12 @@ int maineventloop( const struct key *_keys) { int result; + // Always reset the Filters on start and revert on exit + enum mask oldMask = showMasked; + enum scope oldScope = showScope; + showMasked = show_unmasked; + showScope = show_all; + { const char *temp = subtitle; subtitle=_subtitle; _subtitle=temp; } @@ -672,11 +678,12 @@ exit: items = _items; keys = _keys; - if(items!=NULL) { - currentitem = items; - topline = 0; - draw(); - } + // revert filters + showMasked = oldMask; + showScope = oldScope; + + if(items!=NULL) + resetDisplay(); return result; } @@ -686,7 +693,6 @@ exit: */ void resetDisplay() { - drawitem(currentitem, FALSE); currentitem = items; while (!isLegalItem(currentitem)) currentitem = currentitem->next;