summaryrefslogtreecommitdiff
path: root/noncore/styles/theme/othemebase.cpp
Unidiff
Diffstat (limited to 'noncore/styles/theme/othemebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/othemebase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/styles/theme/othemebase.cpp b/noncore/styles/theme/othemebase.cpp
index d2226e6..4275dd6 100644
--- a/noncore/styles/theme/othemebase.cpp
+++ b/noncore/styles/theme/othemebase.cpp
@@ -261,97 +261,97 @@ void OThemeBase::readConfig( Qt::GUIStyle /*style*/ )
261 cfg. setGroup ( "Appearance" ); 261 cfg. setGroup ( "Appearance" );
262 262
263 configFileName = cfg. readEntry ( "Theme", "default" ); 263 configFileName = cfg. readEntry ( "Theme", "default" );
264 } 264 }
265 Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File ); 265 Config config( configFilePath + "/themes/" + configFileName + ".themerc" , Config::File );
266 266
267 // Are we initalized? 267 // Are we initalized?
268 applyMiscResourceGroup( &config ); 268 applyMiscResourceGroup( &config );
269 for ( i = 0; i < INHERIT_ITEMS; ++i ) { 269 for ( i = 0; i < INHERIT_ITEMS; ++i ) {
270 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 270 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
271 } 271 }
272 for ( ; i < INHERIT_ITEMS*2; ++i ) { 272 for ( ; i < INHERIT_ITEMS*2; ++i ) {
273 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) { 273 if ( config.hasGroup( QString( widgetEntries[ i ] ) ) ) {
274 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 274 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
275 } 275 }
276 else { 276 else {
277 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ]; 277 copyfrom [ i ] = widgetEntries[ i - INHERIT_ITEMS ];
278 } 278 }
279 } 279 }
280 for ( ; i < WIDGETS; ++i ) { 280 for ( ; i < WIDGETS; ++i ) {
281 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames ); 281 applyResourceGroup( &config, i, copyfrom, pixnames, brdnames );
282 } 282 }
283 283
284 // initalize defaults that may not be read 284 // initalize defaults that may not be read
285 for ( i = 0; i < WIDGETS; ++i ) 285 for ( i = 0; i < WIDGETS; ++i )
286 loaded[ i ] = false; 286 loaded[ i ] = false;
287 btnXShift = btnYShift = focus3DOffset = 0; 287 btnXShift = btnYShift = focus3DOffset = 0;
288 aTabLine = iTabLine = true; 288 aTabLine = iTabLine = true;
289 roundedButton = roundedCombo = roundedSlider = focus3D = false; 289 roundedButton = roundedCombo = roundedSlider = focus3D = false;
290 splitterWidth = 10; 290 splitterWidth = 10;
291 291
292 for ( i = 0; i < WIDGETS; ++i ) { 292 for ( i = 0; i < WIDGETS; ++i ) {
293 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded ); 293 readResourceGroup( i, copyfrom, pixnames, brdnames, loaded );
294 } 294 }
295 295
296 // misc items 296 // misc items
297 readMiscResourceGroup(); 297 readMiscResourceGroup();
298 298
299 // Handle preblend items 299 // Handle preblend items
300 for ( i = 0; i < PREBLEND_ITEMS; ++i ) { 300 for ( i = 0; i < PREBLEND_ITEMS; ++i ) {
301 if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 ) 301 if ( pixmaps[ preBlend[ i ] ] != NULL && blends[ preBlend[ i ] ] != 0.0 )
302 blend( preBlend[ i ] ); 302 blend( preBlend[ i ] );
303 } 303 }
304} 304}
305 305
306OThemeBase::OThemeBase( const QString & configFile ) 306OThemeBase::OThemeBase( const QString & configFile )
307 : QWindowsStyle() 307 : QWindowsStyle()
308{ 308{
309 configFilePath = QPEApplication::qpeDir ( ) + "/plugins/styles/"; 309 configFilePath = QPEApplication::qpeDir ( ) + "plugins/styles/";
310 configFileName = configFile; 310 configFileName = configFile;
311 311
312 readConfig( Qt::WindowsStyle ); 312 readConfig( Qt::WindowsStyle );
313 cache = new OThemeCache( cacheSize ); 313 cache = new OThemeCache( cacheSize );
314} 314}
315 315
316void OThemeBase::applyConfigFile( const QString &/*file*/ ) 316void OThemeBase::applyConfigFile( const QString &/*file*/ )
317{ 317{
318#if 0 318#if 0
319 // handle std color scheme 319 // handle std color scheme
320 Config inConfig( file, Config::File ); 320 Config inConfig( file, Config::File );
321 Config globalConfig ( "qpe" ); 321 Config globalConfig ( "qpe" );
322 322
323 globalConfig. setGroup ( "Apperance" ); 323 globalConfig. setGroup ( "Apperance" );
324 inConfig. setGroup( "General" ); 324 inConfig. setGroup( "General" );
325 325
326 if ( inConfig.hasKey( "foreground" ) ) 326 if ( inConfig.hasKey( "foreground" ) )
327 globalConfig.writeEntry( "Text", inConfig.readEntry( "foreground", " " ) ); 327 globalConfig.writeEntry( "Text", inConfig.readEntry( "foreground", " " ) );
328 if ( inConfig.hasKey( "background" ) ) 328 if ( inConfig.hasKey( "background" ) )
329 globalConfig.writeEntry( "Background", inConfig.readEntry( "background", " " ) ); 329 globalConfig.writeEntry( "Background", inConfig.readEntry( "background", " " ) );
330 if ( inConfig.hasKey( "selectForeground" ) ) 330 if ( inConfig.hasKey( "selectForeground" ) )
331 globalConfig.writeEntry( "HighlightedText", inConfig.readEntry( "selectForeground", " " ) ); 331 globalConfig.writeEntry( "HighlightedText", inConfig.readEntry( "selectForeground", " " ) );
332 if ( inConfig.hasKey( "selectBackground" ) ) 332 if ( inConfig.hasKey( "selectBackground" ) )
333 globalConfig.writeEntry( "Highlight", inConfig.readEntry( "selectBackground", " " ) ); 333 globalConfig.writeEntry( "Highlight", inConfig.readEntry( "selectBackground", " " ) );
334 if ( inConfig.hasKey( "windowForeground" ) ) 334 if ( inConfig.hasKey( "windowForeground" ) )
335 globalConfig.writeEntry( "Text", inConfig.readEntry( "windowForeground", " " ) ); 335 globalConfig.writeEntry( "Text", inConfig.readEntry( "windowForeground", " " ) );
336 if ( inConfig.hasKey( "windowBackground" ) ) 336 if ( inConfig.hasKey( "windowBackground" ) )
337 globalConfig.writeEntry( "Base", inConfig.readEntry( "windowBackground", " " ) ); 337 globalConfig.writeEntry( "Base", inConfig.readEntry( "windowBackground", " " ) );
338 338
339 // Keep track of the current theme so that we can select the right one 339 // Keep track of the current theme so that we can select the right one
340 // in the KControl module. 340 // in the KControl module.
341 globalConfig.writeEntry ( "CurrentTheme", file ); 341 globalConfig.writeEntry ( "CurrentTheme", file );
342 342
343 globalConfig.write(); 343 globalConfig.write();
344#endif 344#endif
345} 345}
346 346
347OThemeBase::~OThemeBase() 347OThemeBase::~OThemeBase()
348{ 348{
349 int i; 349 int i;
350 for ( i = 0; i < WIDGETS; ++i ) { 350 for ( i = 0; i < WIDGETS; ++i ) {
351 if ( !duplicate[ i ] ) { 351 if ( !duplicate[ i ] ) {
352 if ( images[ i ] ) 352 if ( images[ i ] )
353 delete images[ i ]; 353 delete images[ i ];
354 if ( pixmaps[ i ] ) 354 if ( pixmaps[ i ] )
355 delete pixmaps[ i ]; 355 delete pixmaps[ i ];
356 } 356 }
357 if ( !pbDuplicate[ i ] && pbPixmaps[ i ] ) 357 if ( !pbDuplicate[ i ] && pbPixmaps[ i ] )