summaryrefslogtreecommitdiff
path: root/noncore/apps
authorkergoth <kergoth>2003-08-09 16:24:58 (UTC)
committer kergoth <kergoth>2003-08-09 16:24:58 (UTC)
commite16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (unidiff)
tree9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/apps
parent1c58d1407f9584fedcdae390a04e2b37e5853361 (diff)
downloadopie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz
opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/configdlg.cpp22
-rw-r--r--noncore/apps/odict/configdlg.h2
-rw-r--r--noncore/apps/odict/odict.cpp12
-rw-r--r--noncore/apps/odict/odict.h2
-rw-r--r--noncore/apps/odict/odict.pro2
-rw-r--r--noncore/apps/odict/opie-odict.control2
-rw-r--r--noncore/apps/tableviewer/db/xmlsource.cpp6
-rw-r--r--noncore/apps/tableviewer/tableviewer.pro2
-rw-r--r--noncore/apps/tableviewer/ui/tvbrowseview.cpp7
-rw-r--r--noncore/apps/tableviewer/xmlencodeattr.cpp48
-rw-r--r--noncore/apps/tableviewer/xmlencodeattr.h26
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
@@ -31,4 +31,2 @@
31 31
32#include <opie/otabwidget.h>
33
34ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal) 32ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(parent, name, modal)
@@ -37,10 +35,3 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa
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" );
@@ -53,5 +44,5 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa
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() ) );
@@ -62,5 +53,4 @@ ConfigDlg::ConfigDlg(QWidget *parent, const char *name, bool modal) : QDialog(pa
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();
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
@@ -10,3 +10,2 @@
10class QWidget; 10class QWidget;
11class OTabWidget;
12class QListView; 11class QListView;
@@ -24,3 +23,2 @@ class ConfigDlg : public QDialog
24 private: 23 private:
25 OTabWidget *tab;
26 QWidget *settings_tab, *search_tab; 24 QWidget *settings_tab, *search_tab;
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
@@ -43,3 +43,3 @@ ODict::ODict() : QMainWindow()
43 vbox = new QVBox( this ); 43 vbox = new QVBox( this );
44 setCaption( tr( "OPIE-Dictionary" ) ); 44 setCaption( tr( "Opie-Dictionary" ) );
45 setupMenus(); 45 setupMenus();
@@ -78,3 +78,2 @@ void ODict::loadConfig()
78 casesens = cfg.readEntry( "casesens" ).toInt(); 78 casesens = cfg.readEntry( "casesens" ).toInt();
79 regexp = cfg.readEntry( "regexp" ).toInt();
80 79
@@ -129,3 +128,2 @@ void ODict::saveConfig()
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() );
@@ -187,9 +185,2 @@ void ODict::slotSetParameter( int count )
187 185
188 if ( count == 1 )
189 {
190 if ( regexp )
191 regexp = false;
192 else
193 regexp = true;
194 }
195 saveConfig(); 186 saveConfig();
@@ -224,3 +215,2 @@ void ODict::setupMenus()
224 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); 215 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 );
225 parameter->insertItem( tr( "Allow &reg. expressions" ), 2 );
226 parameter->insertSeparator(); 216 parameter->insertSeparator();
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
@@ -51,3 +51,3 @@ class ODict : public QMainWindow
51 51
52 bool casesens, completewords, regexp; 52 bool casesens, completewords;
53 53
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
@@ -6,3 +6,3 @@ HEADERS = odict.h \
6 configdlg.h \ 6 configdlg.h \
7 dingwidget.h \ 7 dingwidget.h
8 8
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
@@ -6,3 +6,2 @@ Maintainer: Carsten Niehaus <cniehaus@handhelds.org>
6Architecture: arm 6Architecture: arm
7Version: $QPE_VERSION-$SUB_VERSION
8Depends: task-opie-minimal 7Depends: task-opie-minimal
@@ -10 +9,2 @@ Description: Dictionarylookupprogram
10 Look up words :) 9 Look up words :)
10Version: $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
@@ -23,2 +23,4 @@
23#include <qtextstream.h> 23#include <qtextstream.h>
24#include "../xmlencodeattr.h"
25
24 26
@@ -70,3 +72,3 @@ bool DBXml::saveSource(QIODevice *outDev)
70 << "\">"; 72 << "\">";
71 outstream << it.current()->name() << "</key>" << endl; 73 outstream << encodeAttr(it.current()->name()) << "</key>" << endl;
72 } 74 }
@@ -96,3 +98,3 @@ bool DBXml::saveSource(QIODevice *outDev)
96 } else { 98 } else {
97 outstream << elem->toQString(i); 99 outstream << encodeAttr(elem->toQString(i));
98 } 100 }
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
@@ -5,2 +5,3 @@ SUBDIRS = db ui
5 HEADERS = tableviewer.h \ 5 HEADERS = tableviewer.h \
6 xmlencodeattr.h \
6 ui/commonwidgets.h \ 7 ui/commonwidgets.h \
@@ -19,2 +20,3 @@ SOURCES = main.cpp \
19 tableviewer.cpp \ 20 tableviewer.cpp \
21 xmlencodeattr.cpp \
20 ui/commonwidgets.cpp \ 22 ui/commonwidgets.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
@@ -25,2 +25,3 @@
25#include <qlayout.h> 25#include <qlayout.h>
26#include "../xmlencodeattr.h"
26 27
@@ -104,8 +105,8 @@ void TVBrowseView::setDisplayText(const DataElem *element)
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 }
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"
19QString 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, "&lt;" );
27 len += 3;
28 i += 4;
29 } else if ( tmp[(int)i] == '"' ) {
30 tmp.replace( i, 1, "&quot;" );
31 len += 5;
32 i += 6;
33 } else if ( tmp[(int)i] == '&' ) {
34 tmp.replace( i, 1, "&amp;" );
35 len += 4;
36 i += 5;
37 } else if ( tmp[(int)i] == '>' ) {
38 tmp.replace( i, 1, "&gt;" );
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
23QString encodeAttr( const QString& str );
24
25#endif
26