author | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
commit | e16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (unidiff) | |
tree | 9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/apps/tableviewer/ui/tvbrowseview.cpp | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps/tableviewer/ui/tvbrowseview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/ui/tvbrowseview.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp index f5f2555..22bac55 100644 --- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp +++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp | |||
@@ -14,24 +14,25 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "tvbrowseview.h" | 20 | #include "tvbrowseview.h" |
21 | #include "browsekeyentry.h" | 21 | #include "browsekeyentry.h" |
22 | #include <qtoolbutton.h> | 22 | #include <qtoolbutton.h> |
23 | #include <qtextview.h> | 23 | #include <qtextview.h> |
24 | #include <qtextbrowser.h> | 24 | #include <qtextbrowser.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include "../xmlencodeattr.h" | ||
26 | 27 | ||
27 | /*! | 28 | /*! |
28 | \class TVBrowseView | 29 | \class TVBrowseView |
29 | \brief The widget describing how to draw the browse view user interface | 30 | \brief The widget describing how to draw the browse view user interface |
30 | 31 | ||
31 | This widget allows for the user to browse through the table, one element | 32 | This widget allows for the user to browse through the table, one element |
32 | at a time, or search on a single key. Its main goal is to show a | 33 | at a time, or search on a single key. Its main goal is to show a |
33 | single element in a readable format and make it easy for the user to | 34 | single element in a readable format and make it easy for the user to |
34 | rapidly find specific elements in the table. | 35 | rapidly find specific elements in the table. |
35 | */ | 36 | */ |
36 | 37 | ||
37 | /*! | 38 | /*! |
@@ -93,30 +94,30 @@ void TVBrowseView::reset() | |||
93 | sets the data element to be displayed to element | 94 | sets the data element to be displayed to element |
94 | */ | 95 | */ |
95 | void TVBrowseView::setDisplayText(const DataElem *element) | 96 | void TVBrowseView::setDisplayText(const DataElem *element) |
96 | { | 97 | { |
97 | QString rep = ""; | 98 | QString rep = ""; |
98 | 99 | ||
99 | KeyListIterator it(*ts->kRep); | 100 | KeyListIterator it(*ts->kRep); |
100 | 101 | ||
101 | while (it.current()) { | 102 | while (it.current()) { |
102 | if (element->hasValidValue(it.currentKey())) { | 103 | if (element->hasValidValue(it.currentKey())) { |
103 | if(it.currentKey() == ts->current_column) { | 104 | if(it.currentKey() == ts->current_column) { |
104 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" | 105 | rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" |
105 | + it.current()->name() | 106 | + encodeAttr(it.current()->name()) |
106 | + ":</FONT></B> "; | 107 | + ":</FONT></B> "; |
107 | } else { | 108 | } else { |
108 | rep += "<B>" + it.current()->name() + ":</B> "; | 109 | rep += "<B>" + encodeAttr(it.current()->name()) + ":</B> "; |
109 | } | 110 | } |
110 | rep += element->toQString(it.currentKey()) + "<BR>"; | 111 | rep += encodeAttr(element->toQString(it.currentKey())) + "<BR>"; |
111 | } | 112 | } |
112 | ++it; | 113 | ++it; |
113 | } | 114 | } |
114 | 115 | ||
115 | textViewDisplay->setText(rep); | 116 | textViewDisplay->setText(rep); |
116 | textViewDisplay->scrollToAnchor("ckey"); | 117 | textViewDisplay->scrollToAnchor("ckey"); |
117 | } | 118 | } |
118 | 119 | ||
119 | void TVBrowseView::rebuildKeys() | 120 | void TVBrowseView::rebuildKeys() |
120 | { | 121 | { |
121 | keyEntry->rebuildKeys(); | 122 | keyEntry->rebuildKeys(); |
122 | } | 123 | } |