summaryrefslogtreecommitdiff
path: root/inputmethods/handwriting/qimpenprofile.cpp
Unidiff
Diffstat (limited to 'inputmethods/handwriting/qimpenprofile.cpp') (more/less context) (show whitespace changes)
-rw-r--r--inputmethods/handwriting/qimpenprofile.cpp25
1 files changed, 24 insertions, 1 deletions
diff --git a/inputmethods/handwriting/qimpenprofile.cpp b/inputmethods/handwriting/qimpenprofile.cpp
index 3b1b5e9..b1a6592 100644
--- a/inputmethods/handwriting/qimpenprofile.cpp
+++ b/inputmethods/handwriting/qimpenprofile.cpp
@@ -39,24 +39,27 @@ QIMPenProfile::QIMPenProfile( const QString &fn )
39 39
40 tstyle = config.readBoolEntry( "CanSelectStyle", false ); 40 tstyle = config.readBoolEntry( "CanSelectStyle", false );
41 41
42 wordMatch = config.readBoolEntry( "MatchWords", true ); 42 wordMatch = config.readBoolEntry( "MatchWords", true );
43 43
44 config.setGroup( "Settings" ); 44 config.setGroup( "Settings" );
45 45
46 pstyle = BothCases; 46 pstyle = BothCases;
47 QString s = config.readEntry( "Style", "BothCases" ); 47 QString s = config.readEntry( "Style", "BothCases" );
48 if ( s == "ToggleCases" ) 48 if ( s == "ToggleCases" )
49 pstyle = ToggleCases; 49 pstyle = ToggleCases;
50 50
51 QString t = config.readEntry( "Mono", "Dual" );
52 pmono = (QString::fromLatin1("Mono") == t );
53
51 msTimeout = config.readNumEntry( "MultiTimeout", 500 ); 54 msTimeout = config.readNumEntry( "MultiTimeout", 500 );
52 55
53 // Read user configuration 56 // Read user configuration
54 Config usrConfig( userConfig() ); 57 Config usrConfig( userConfig() );
55 usrConfig.setGroup( "Settings" ); 58 usrConfig.setGroup( "Settings" );
56 msTimeout = usrConfig.readNumEntry( "MultiTimeout", msTimeout ); 59 msTimeout = usrConfig.readNumEntry( "MultiTimeout", msTimeout );
57 60
58 if ( tstyle && usrConfig.hasKey( "Style" ) ) { 61 if ( tstyle && usrConfig.hasKey( "Style" ) ) {
59 pstyle = BothCases; 62 pstyle = BothCases;
60 QString s = usrConfig.readEntry( "Style", "BothCases" ); 63 QString s = usrConfig.readEntry( "Style", "BothCases" );
61 if ( s == "ToggleCases" ) 64 if ( s == "ToggleCases" )
62 pstyle = ToggleCases; 65 pstyle = ToggleCases;
@@ -110,38 +113,58 @@ void QIMPenProfile::loadData()
110 QIMPenCombining *combining = 0; 113 QIMPenCombining *combining = 0;
111 QString s = config.readEntry( "Combining" ); 114 QString s = config.readEntry( "Combining" );
112 if ( !s.isEmpty() ) { 115 if ( !s.isEmpty() ) {
113 combining = new QIMPenCombining( baseDir + "qimpen/" + s ); 116 combining = new QIMPenCombining( baseDir + "qimpen/" + s );
114 if ( combining->isEmpty() ) { 117 if ( combining->isEmpty() ) {
115 delete combining; 118 delete combining;
116 combining = 0; 119 combining = 0;
117 } 120 }
118 } 121 }
119 // uppercase latin1 122 // uppercase latin1
120 QIMPenCharSet *cs = 0; 123 QIMPenCharSet *cs = 0;
121 s = config.readEntry( "Uppercase" ); 124 s = config.readEntry( "Uppercase" );
122 if ( !s.isEmpty() ) { 125 if ( !s.isEmpty() && !mono() ) {
123 cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); 126 cs = new QIMPenCharSet( baseDir + "qimpen/" + s );
124 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); 127 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
125 if ( !cs->isEmpty() ) { 128 if ( !cs->isEmpty() ) {
126 if ( combining ) 129 if ( combining )
127 combining->addCombined( cs ); 130 combining->addCombined( cs );
128 sets.append( cs ); 131 sets.append( cs );
129 } else { 132 } else {
130 delete cs; 133 delete cs;
131 } 134 }
132 } 135 }
133 // lowercase latin1 136 // lowercase latin1
134 s = config.readEntry( "Lowercase" ); 137 s = config.readEntry( "Lowercase" );
135 if ( !s.isEmpty() ) { 138 if ( !s.isEmpty() ) {
139 if ( mono() ) {
140 cs = new QIMPenCharSet ( baseDir + "qimpen/" + s );
141 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
142 if ( !cs->isEmpty() ) {
143 cs->setTitle( cs->title().upper() );
144 cs->setType( QIMPenCharSet::Upper );
145 cs->setHidden ( true );
146 QIMPenCharIterator it( cs->characters() );
147 for ( ; it.current(); ++it ) {
148 uint ch = it.current()->character();
149 if ( ch >= 'a' && ch <= 'z' )
150 it.current()->setCharacter( QChar(ch).upper() );
151 }
152 if ( combining )
153 combining->addCombined( cs );
154 sets.append( cs );
155 } else {
156 delete cs;
157 }
158 }
136 cs = new QIMPenCharSet( baseDir + "qimpen/" + s ); 159 cs = new QIMPenCharSet( baseDir + "qimpen/" + s );
137 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User ); 160 cs->load( Global::applicationFileName("qimpen",s), QIMPenCharSet::User );
138 if ( !cs->isEmpty() ) { 161 if ( !cs->isEmpty() ) {
139 if ( combining ) 162 if ( combining )
140 combining->addCombined( cs ); 163 combining->addCombined( cs );
141 sets.append( cs ); 164 sets.append( cs );
142 } else { 165 } else {
143 delete cs; 166 delete cs;
144 } 167 }
145 } 168 }
146 // numeric (may comtain punctuation and symbols) 169 // numeric (may comtain punctuation and symbols)
147 s = config.readEntry( "Numeric" ); 170 s = config.readEntry( "Numeric" );