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 | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
-rw-r--r-- | noncore/apps/odict/configdlg.cpp | 22 | ||||
-rw-r--r-- | noncore/apps/odict/configdlg.h | 2 | ||||
-rw-r--r-- | noncore/apps/odict/odict.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/odict/odict.h | 2 | ||||
-rw-r--r-- | noncore/apps/odict/odict.pro | 2 | ||||
-rw-r--r-- | noncore/apps/odict/opie-odict.control | 2 | ||||
-rw-r--r-- | noncore/apps/tableviewer/db/xmlsource.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/tableviewer/tableviewer.pro | 2 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvbrowseview.cpp | 7 | ||||
-rw-r--r-- | noncore/apps/tableviewer/xmlencodeattr.cpp | 48 | ||||
-rw-r--r-- | noncore/apps/tableviewer/xmlencodeattr.h | 26 |
11 files changed, 94 insertions, 37 deletions
diff --git a/noncore/apps/odict/configdlg.cpp b/noncore/apps/odict/configdlg.cpp index 400298d..2103df9 100644 --- a/noncore/apps/odict/configdlg.cpp +++ b/noncore/apps/odict/configdlg.cpp | |||
@@ -26,46 +26,36 @@ | |||
26 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlistview.h> | 27 | #include <qlistview.h> |
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
30 | #include <qstringlist.h> | 30 | #include <qstringlist.h> |
31 | 31 | ||
32 | #include <opie/otabwidget.h> | ||
33 | |||
34 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) | 32 | ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) |
35 | { | 33 | { |
36 | setCaption( tr( "Options" ) ); | 34 | setCaption( tr( "Options" ) ); |
37 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); | 35 | QVBoxLayout *vbox_layout = new QVBoxLayout( this ); |
38 | tab = new OTabWidget( this, "OTabWidget_tab", OTabWidget::Global, OTabWidget::Bottom ); | 36 | search_tab = new QWidget( this , "search_tab" ); |
39 | vbox_layout->addWidget( tab ); | ||
40 | |||
41 | /*general settings*/ | ||
42 | settings_tab = new QWidget( tab , "settings_tab" ); | ||
43 | |||
44 | /*searchmethods*/ | ||
45 | search_tab = new QWidget( tab , "search_tab" ); | ||
46 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); | 37 | QVBoxLayout *vbox_layout_searchtab = new QVBoxLayout( search_tab, 4 , 4 ,"blah" ); |
47 | 38 | ||
48 | QHBox *hbox = new QHBox( search_tab ); | 39 | QHBox *hbox = new QHBox( search_tab ); |
49 | list = new QListView( hbox ); | 40 | list = new QListView( hbox ); |
50 | list->addColumn( tr( "Searchmethod" ) ); | 41 | list->addColumn( tr( "Searchmethod" ) ); |
51 | loadSearchMethodNames(); | 42 | loadSearchMethodNames(); |
52 | 43 | ||
53 | QVBox *vbox = new QVBox( hbox ); | 44 | QVBox *vbox = new QVBox( hbox ); |
54 | new_button = new QPushButton( "New" , vbox ); | 45 | new_button = new QPushButton( tr( "New" ) , vbox ); |
55 | change_button = new QPushButton( "Change" , vbox ); | 46 | change_button = new QPushButton( tr( "Change" ) , vbox ); |
56 | delete_button = new QPushButton( "Delete" , vbox ); | 47 | delete_button = new QPushButton( tr( "Delete" ) , vbox ); |
57 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); | 48 | connect( new_button, SIGNAL( clicked() ), this, SLOT( slotNewMethod() ) ); |
58 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); | 49 | connect( change_button, SIGNAL( clicked() ), this, SLOT( slotChangeMethod() )); |
59 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); | 50 | connect( delete_button, SIGNAL( clicked() ), this, SLOT( slotDeleteMethod() )); |
60 | 51 | ||
61 | vbox_layout_searchtab->addWidget( hbox ); | 52 | vbox_layout_searchtab->addWidget( hbox ); |
62 | 53 | ||
63 | /*add the tabs and maximize*/ | 54 | vbox_layout->addWidget( search_tab ); |
64 | tab->addTab( settings_tab, "pass", tr( "General Settings" ) ); | 55 | |
65 | tab->addTab( search_tab, "zoom", tr( "Searchmethods" ) ); | ||
66 | showMaximized(); | 56 | showMaximized(); |
67 | } | 57 | } |
68 | 58 | ||
69 | void ConfigDlg::slotNewMethod() | 59 | void ConfigDlg::slotNewMethod() |
70 | { | 60 | { |
71 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); | 61 | SearchMethodDlg dlg( this, "SearchMethodDlg", true ); |
diff --git a/noncore/apps/odict/configdlg.h b/noncore/apps/odict/configdlg.h index e3ef3ce..6c85989 100644 --- a/noncore/apps/odict/configdlg.h +++ b/noncore/apps/odict/configdlg.h | |||
@@ -5,13 +5,12 @@ | |||
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 6 | * ( at your option ) any later version. * |
7 | * * | 7 | * * |
8 | **************************************************************************/ | 8 | **************************************************************************/ |
9 | 9 | ||
10 | class QWidget; | 10 | class QWidget; |
11 | class OTabWidget; | ||
12 | class QListView; | 11 | class QListView; |
13 | class QPushButton; | 12 | class QPushButton; |
14 | 13 | ||
15 | #include <qdialog.h> | 14 | #include <qdialog.h> |
16 | 15 | ||
17 | class ConfigDlg : public QDialog | 16 | class ConfigDlg : public QDialog |
@@ -19,13 +18,12 @@ class ConfigDlg : public QDialog | |||
19 | Q_OBJECT | 18 | Q_OBJECT |
20 | 19 | ||
21 | public: | 20 | public: |
22 | ConfigDlg(QWidget *parent, const char *name, bool modal=FALSE ); | 21 | ConfigDlg(QWidget *parent, const char *name, bool modal=FALSE ); |
23 | 22 | ||
24 | private: | 23 | private: |
25 | OTabWidget *tab; | ||
26 | QWidget *settings_tab, *search_tab; | 24 | QWidget *settings_tab, *search_tab; |
27 | QListView *list; | 25 | QListView *list; |
28 | QPushButton *new_button, *change_button, *delete_button; | 26 | QPushButton *new_button, *change_button, *delete_button; |
29 | 27 | ||
30 | void loadSearchMethodNames(); | 28 | void loadSearchMethodNames(); |
31 | 29 | ||
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp index 2028701..010545e 100644 --- a/noncore/apps/odict/odict.cpp +++ b/noncore/apps/odict/odict.cpp | |||
@@ -38,13 +38,13 @@ | |||
38 | 38 | ||
39 | ODict::ODict() : QMainWindow() | 39 | ODict::ODict() : QMainWindow() |
40 | { | 40 | { |
41 | activated_name = QString::null; | 41 | activated_name = QString::null; |
42 | 42 | ||
43 | vbox = new QVBox( this ); | 43 | vbox = new QVBox( this ); |
44 | setCaption( tr( "OPIE-Dictionary" ) ); | 44 | setCaption( tr( "Opie-Dictionary" ) ); |
45 | setupMenus(); | 45 | setupMenus(); |
46 | 46 | ||
47 | QHBox *hbox = new QHBox( vbox ); | 47 | QHBox *hbox = new QHBox( vbox ); |
48 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); | 48 | QLabel* query_label = new QLabel( tr( "Query:" ) , hbox ); |
49 | query_label->show(); | 49 | query_label->show(); |
50 | query_le = new QLineEdit( hbox ); | 50 | query_le = new QLineEdit( hbox ); |
@@ -73,13 +73,12 @@ void ODict::loadConfig() | |||
73 | */ | 73 | */ |
74 | QString lastname; | 74 | QString lastname; |
75 | 75 | ||
76 | Config cfg ( "odict" ); | 76 | Config cfg ( "odict" ); |
77 | cfg.setGroup( "generalsettings" ); | 77 | cfg.setGroup( "generalsettings" ); |
78 | casesens = cfg.readEntry( "casesens" ).toInt(); | 78 | casesens = cfg.readEntry( "casesens" ).toInt(); |
79 | regexp = cfg.readEntry( "regexp" ).toInt(); | ||
80 | 79 | ||
81 | QString lastDict = cfg.readEntry( "lastdict" ); | 80 | QString lastDict = cfg.readEntry( "lastdict" ); |
82 | int i = 0, e = 0; | 81 | int i = 0, e = 0; |
83 | 82 | ||
84 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); | 83 | QStringList groupListCfg = cfg.groupList().grep( "Method_" ); |
85 | query_co->clear(); | 84 | query_co->clear(); |
@@ -124,13 +123,12 @@ void ODict::lookupLanguageNames( QString dictname ) | |||
124 | 123 | ||
125 | void ODict::saveConfig() | 124 | void ODict::saveConfig() |
126 | { | 125 | { |
127 | Config cfg ( "odict" ); | 126 | Config cfg ( "odict" ); |
128 | cfg.setGroup( "generalsettings" ); | 127 | cfg.setGroup( "generalsettings" ); |
129 | cfg.writeEntry( "casesens" , casesens ); | 128 | cfg.writeEntry( "casesens" , casesens ); |
130 | cfg.writeEntry( "regexp" , regexp ); | ||
131 | cfg.writeEntry( "lastdict" , query_co->currentText() ); | 129 | cfg.writeEntry( "lastdict" , query_co->currentText() ); |
132 | } | 130 | } |
133 | 131 | ||
134 | void ODict::slotStartQuery() | 132 | void ODict::slotStartQuery() |
135 | { | 133 | { |
136 | QString querystring = query_le->text(); | 134 | QString querystring = query_le->text(); |
@@ -182,19 +180,12 @@ void ODict::slotSetParameter( int count ) | |||
182 | if ( casesens ) | 180 | if ( casesens ) |
183 | casesens = false; | 181 | casesens = false; |
184 | else | 182 | else |
185 | casesens = true; | 183 | casesens = true; |
186 | } | 184 | } |
187 | 185 | ||
188 | if ( count == 1 ) | ||
189 | { | ||
190 | if ( regexp ) | ||
191 | regexp = false; | ||
192 | else | ||
193 | regexp = true; | ||
194 | } | ||
195 | saveConfig(); | 186 | saveConfig(); |
196 | } | 187 | } |
197 | 188 | ||
198 | void ODict::slotMethodChanged( const QString& methodnumber ) | 189 | void ODict::slotMethodChanged( const QString& methodnumber ) |
199 | { | 190 | { |
200 | activated_name = methodnumber; | 191 | activated_name = methodnumber; |
@@ -219,12 +210,11 @@ void ODict::setupMenus() | |||
219 | setting_a->addTo( settings ); | 210 | setting_a->addTo( settings ); |
220 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); | 211 | setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); |
221 | 212 | ||
222 | parameter = new QPopupMenu( menu ); | 213 | parameter = new QPopupMenu( menu ); |
223 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); | 214 | connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); |
224 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); | 215 | parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); |
225 | parameter->insertItem( tr( "Allow ®. expressions" ), 2 ); | ||
226 | parameter->insertSeparator(); | 216 | parameter->insertSeparator(); |
227 | 217 | ||
228 | menu->insertItem( tr( "Settings" ) , settings ); | 218 | menu->insertItem( tr( "Settings" ) , settings ); |
229 | menu->insertItem( tr( "Parameter" ) , parameter ); | 219 | menu->insertItem( tr( "Parameter" ) , parameter ); |
230 | } | 220 | } |
diff --git a/noncore/apps/odict/odict.h b/noncore/apps/odict/odict.h index 9c037ea..be2a532 100644 --- a/noncore/apps/odict/odict.h +++ b/noncore/apps/odict/odict.h | |||
@@ -46,13 +46,13 @@ class ODict : public QMainWindow | |||
46 | QVBoxLayout *vbox_layout; | 46 | QVBoxLayout *vbox_layout; |
47 | 47 | ||
48 | QAction *setting_a, *setting_b; | 48 | QAction *setting_a, *setting_b; |
49 | 49 | ||
50 | void setupMenus(); | 50 | void setupMenus(); |
51 | 51 | ||
52 | bool casesens, completewords, regexp; | 52 | bool casesens, completewords; |
53 | 53 | ||
54 | void loadConfig(); | 54 | void loadConfig(); |
55 | void saveConfig(); | 55 | void saveConfig(); |
56 | 56 | ||
57 | QString activated_name; | 57 | QString activated_name; |
58 | QLabel *bottom_name, | 58 | QLabel *bottom_name, |
diff --git a/noncore/apps/odict/odict.pro b/noncore/apps/odict/odict.pro index 427a5c6..82f6a41 100644 --- a/noncore/apps/odict/odict.pro +++ b/noncore/apps/odict/odict.pro | |||
@@ -1,13 +1,13 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | HEADERS = odict.h \ | 4 | HEADERS = odict.h \ |
5 | searchmethoddlg.h \ | 5 | searchmethoddlg.h \ |
6 | configdlg.h \ | 6 | configdlg.h \ |
7 | dingwidget.h \ | 7 | dingwidget.h |
8 | 8 | ||
9 | SOURCES = main.cpp \ | 9 | SOURCES = main.cpp \ |
10 | odict.cpp \ | 10 | odict.cpp \ |
11 | searchmethoddlg.cpp \ | 11 | searchmethoddlg.cpp \ |
12 | configdlg.cpp \ | 12 | configdlg.cpp \ |
13 | dingwidget.cpp | 13 | dingwidget.cpp |
diff --git a/noncore/apps/odict/opie-odict.control b/noncore/apps/odict/opie-odict.control index 2fa731f..f684716 100644 --- a/noncore/apps/odict/opie-odict.control +++ b/noncore/apps/odict/opie-odict.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-odict | 1 | Package: opie-odict |
2 | Files: bin/odict apps/Applications/odict.desktop pics/odict/odict.png | 2 | Files: bin/odict apps/Applications/odict.desktop pics/odict/odict.png |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: applications | 4 | Section: applications |
5 | Maintainer: Carsten Niehaus <cniehaus@handhelds.org> | 5 | Maintainer: Carsten Niehaus <cniehaus@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Version: $QPE_VERSION-$SUB_VERSION | ||
8 | Depends: task-opie-minimal | 7 | Depends: task-opie-minimal |
9 | Description: Dictionarylookupprogram | 8 | Description: Dictionarylookupprogram |
10 | Look up words :) | 9 | Look up words :) |
10 | Version: $QPE_VERSION$EXTRAVERSION | ||
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp index 7418a85..94fec36 100644 --- a/noncore/apps/tableviewer/db/xmlsource.cpp +++ b/noncore/apps/tableviewer/db/xmlsource.cpp | |||
@@ -18,12 +18,14 @@ | |||
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "xmlsource.h" | 20 | #include "xmlsource.h" |
21 | #include <qdict.h> | 21 | #include <qdict.h> |
22 | #include <stdlib.h> | 22 | #include <stdlib.h> |
23 | #include <qtextstream.h> | 23 | #include <qtextstream.h> |
24 | #include "../xmlencodeattr.h" | ||
25 | |||
24 | 26 | ||
25 | 27 | ||
26 | DBXml::DBXml(DBStore *d) | 28 | DBXml::DBXml(DBStore *d) |
27 | { | 29 | { |
28 | dstore = d; | 30 | dstore = d; |
29 | } | 31 | } |
@@ -65,13 +67,13 @@ bool DBXml::saveSource(QIODevice *outDev) | |||
65 | while(it.current()) { | 67 | while(it.current()) { |
66 | if (!it.current()->delFlag()) { | 68 | if (!it.current()->delFlag()) { |
67 | outstream << "<key name=\"KEYID" << it.currentKey() << "\" "; | 69 | outstream << "<key name=\"KEYID" << it.currentKey() << "\" "; |
68 | outstream << "type=\"" | 70 | outstream << "type=\"" |
69 | << TVVariant::typeToName(it.current()->type()) | 71 | << TVVariant::typeToName(it.current()->type()) |
70 | << "\">"; | 72 | << "\">"; |
71 | outstream << it.current()->name() << "</key>" << endl; | 73 | outstream << encodeAttr(it.current()->name()) << "</key>" << endl; |
72 | } | 74 | } |
73 | ++it; | 75 | ++it; |
74 | } | 76 | } |
75 | 77 | ||
76 | outstream << "</header>" << endl; | 78 | outstream << "</header>" << endl; |
77 | 79 | ||
@@ -91,13 +93,13 @@ bool DBXml::saveSource(QIODevice *outDev) | |||
91 | // dates in files are different from displayed dates | 93 | // dates in files are different from displayed dates |
92 | QDate date = elem->getField(i).toDate(); | 94 | QDate date = elem->getField(i).toDate(); |
93 | outstream << date.day() << "/" | 95 | outstream << date.day() << "/" |
94 | << date.month() << "/" | 96 | << date.month() << "/" |
95 | << date.year(); | 97 | << date.year(); |
96 | } else { | 98 | } else { |
97 | outstream << elem->toQString(i); | 99 | outstream << encodeAttr(elem->toQString(i)); |
98 | } | 100 | } |
99 | outstream << "</KEYID" << i << ">" << endl; | 101 | outstream << "</KEYID" << i << ">" << endl; |
100 | } | 102 | } |
101 | ++it; | 103 | ++it; |
102 | } | 104 | } |
103 | outstream << "</record>" << endl; | 105 | outstream << "</record>" << endl; |
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro index 6f73400..f047e0b 100644 --- a/noncore/apps/tableviewer/tableviewer.pro +++ b/noncore/apps/tableviewer/tableviewer.pro | |||
@@ -1,11 +1,12 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | SUBDIRS = db ui | 4 | SUBDIRS = db ui |
5 | HEADERS = tableviewer.h \ | 5 | HEADERS = tableviewer.h \ |
6 | xmlencodeattr.h \ | ||
6 | ui/commonwidgets.h \ | 7 | ui/commonwidgets.h \ |
7 | ui/tvbrowseview.h \ | 8 | ui/tvbrowseview.h \ |
8 | ui/tvlistview.h \ | 9 | ui/tvlistview.h \ |
9 | ui/tvfilterview.h \ | 10 | ui/tvfilterview.h \ |
10 | ui/tveditview.h \ | 11 | ui/tveditview.h \ |
11 | ui/browsekeyentry.h \ | 12 | ui/browsekeyentry.h \ |
@@ -14,12 +15,13 @@ HEADERS = tableviewer.h \ | |||
14 | db/datacache.h \ | 15 | db/datacache.h \ |
15 | db/common.h \ | 16 | db/common.h \ |
16 | db/xmlsource.h \ | 17 | db/xmlsource.h \ |
17 | db/csvsource.h | 18 | db/csvsource.h |
18 | SOURCES = main.cpp \ | 19 | SOURCES = main.cpp \ |
19 | tableviewer.cpp \ | 20 | tableviewer.cpp \ |
21 | xmlencodeattr.cpp \ | ||
20 | ui/commonwidgets.cpp \ | 22 | ui/commonwidgets.cpp \ |
21 | ui/tvbrowseview.cpp \ | 23 | ui/tvbrowseview.cpp \ |
22 | ui/tvfilterview.cpp \ | 24 | ui/tvfilterview.cpp \ |
23 | ui/browsekeyentry.cpp \ | 25 | ui/browsekeyentry.cpp \ |
24 | ui/filterkeyentry.cpp \ | 26 | ui/filterkeyentry.cpp \ |
25 | ui/tvlistview.cpp \ | 27 | ui/tvlistview.cpp \ |
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 | |||
@@ -20,12 +20,13 @@ | |||
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 |
@@ -99,18 +100,18 @@ void TVBrowseView::setDisplayText(const DataElem *element) | |||
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"); |
diff --git a/noncore/apps/tableviewer/xmlencodeattr.cpp b/noncore/apps/tableviewer/xmlencodeattr.cpp new file mode 100644 index 0000000..de264f7 --- a/dev/null +++ b/noncore/apps/tableviewer/xmlencodeattr.cpp | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * xmlencodeattr.h | ||
3 | * | ||
4 | * copyright : (c) 2003 by Joseph Wenninger | ||
5 | * except for a small modification it's identical to qdom.cpp:encodeAttr | ||
6 | * email : jowenn@handhelds.org | ||
7 | * | ||
8 | */ | ||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #include "xmlencodeattr.h" | ||
19 | QString encodeAttr( const QString& str ) | ||
20 | { | ||
21 | QString tmp( str ); | ||
22 | uint len = tmp.length(); | ||
23 | uint i = 0; | ||
24 | while ( i < len ) { | ||
25 | if ( tmp[(int)i] == '<' ) { | ||
26 | tmp.replace( i, 1, "<" ); | ||
27 | len += 3; | ||
28 | i += 4; | ||
29 | } else if ( tmp[(int)i] == '"' ) { | ||
30 | tmp.replace( i, 1, """ ); | ||
31 | len += 5; | ||
32 | i += 6; | ||
33 | } else if ( tmp[(int)i] == '&' ) { | ||
34 | tmp.replace( i, 1, "&" ); | ||
35 | len += 4; | ||
36 | i += 5; | ||
37 | } else if ( tmp[(int)i] == '>' ) { | ||
38 | tmp.replace( i, 1, ">" ); | ||
39 | len += 3; | ||
40 | i += 4; | ||
41 | } else { | ||
42 | ++i; | ||
43 | } | ||
44 | } | ||
45 | |||
46 | return tmp; | ||
47 | } | ||
48 | |||
diff --git a/noncore/apps/tableviewer/xmlencodeattr.h b/noncore/apps/tableviewer/xmlencodeattr.h new file mode 100644 index 0000000..5fd3b95 --- a/dev/null +++ b/noncore/apps/tableviewer/xmlencodeattr.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* | ||
2 | * xmlencodeattr.h | ||
3 | * | ||
4 | * copyright : (c) 2003 by Joseph Wenninger | ||
5 | * except for a small modification it's identical to qdom.cpp:encodeAttr | ||
6 | * email : jowenn@handhelds.org | ||
7 | * | ||
8 | */ | ||
9 | /*************************************************************************** | ||
10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | ||
15 | * * | ||
16 | ***************************************************************************/ | ||
17 | |||
18 | #ifndef _XML_ENCODE_ATTR_ | ||
19 | #define _XML_ENCODE_ATTR_ | ||
20 | |||
21 | #include <qstring.h> | ||
22 | |||
23 | QString encodeAttr( const QString& str ); | ||
24 | |||
25 | #endif | ||
26 | |||