konq_propsview.cc
00001 /* This file is part of the KDE project 00002 Copyright (C) 1998, 1999 Faure David <faure@kde.org> 00003 00004 This program is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU General Public 00006 License as published by the Free Software Foundation; either 00007 version 2 of the License, or (at your option) any later version. 00008 00009 This program is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 General Public License for more details. 00013 00014 You should have received a copy of the GNU General Public License 00015 along with this program; see the file COPYING. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #include "konq_propsview.h" 00021 #include "konq_settings.h" 00022 00023 #include <kdebug.h> 00024 #include <kstandarddirs.h> 00025 #include <kpixmap.h> 00026 #include <tqpixmapcache.h> 00027 #include <tqiconview.h> 00028 #include <unistd.h> 00029 #include <tqfile.h> 00030 #include <iostream> 00031 #include <ktrader.h> 00032 #include <kinstance.h> 00033 #include <assert.h> 00034 00035 #include <ksimpleconfig.h> 00036 00037 static TQPixmap wallpaperPixmap( const TQString & _wallpaper ) 00038 { 00039 TQString key = "wallpapers/"; 00040 key += _wallpaper; 00041 KPixmap pix; 00042 00043 if ( TQPixmapCache::find( key, pix ) ) 00044 return pix; 00045 00046 TQString path = locate("tiles", _wallpaper); 00047 if (path.isEmpty()) 00048 path = locate("wallpaper", _wallpaper); 00049 if (!path.isEmpty()) 00050 { 00051 // This looks really ugly, especially on an 8bit display. 00052 // I'm not sure what it's good for. 00053 // Anyway, if you change it here, keep konq_bgnddlg in sync (David) 00054 // pix.load( path, 0, KPixmap::LowColor ); 00055 pix.load( path ); 00056 if ( pix.isNull() ) 00057 kdWarning(1203) << "Could not load wallpaper " << path << endl; 00058 else 00059 TQPixmapCache::insert( key, pix ); 00060 return pix; 00061 } else kdWarning(1203) << "Couldn't locate wallpaper " << _wallpaper << endl; 00062 return TQPixmap(); 00063 } 00064 00065 struct KonqPropsView::Private 00066 { 00067 TQStringList* previewsToShow; 00068 bool previewsEnabled:1; 00069 bool caseInsensitiveSort:1; 00070 bool dirsfirst:1; 00071 bool descending:1; 00072 TQString sortcriterion; 00073 }; 00074 00075 KonqPropsView::KonqPropsView( TDEInstance * instance, KonqPropsView * defaultProps ) 00076 : m_bSaveViewPropertiesLocally( false ), // will be overridden by setSave... anyway 00077 // if this is the default properties instance, then keep config object for saving 00078 m_dotDirExists( true ), // HACK so that enterDir returns true initially 00079 m_currentConfig( defaultProps ? 0L : instance->config() ), 00080 m_defaultProps( defaultProps ) 00081 { 00082 00083 TDEConfig *config = instance->config(); 00084 TDEConfigGroupSaver cgs(config, "Settings"); 00085 00086 d = new Private; 00087 d->previewsToShow = 0; 00088 d->caseInsensitiveSort=config->readBoolEntry( "CaseInsensitiveSort", true ); 00089 00090 m_iIconSize = config->readNumEntry( "IconSize", 0 ); 00091 m_iItemTextPos = config->readNumEntry( "ItemTextPos", TQIconView::Bottom ); 00092 d->sortcriterion = config->readEntry( "SortingCriterion", "sort_nci" ); 00093 d->dirsfirst = config->readBoolEntry( "SortDirsFirst", true ); 00094 d->descending = config->readBoolEntry( "SortDescending", false ); 00095 m_bShowDot = config->readBoolEntry( "ShowDotFiles", false ); 00096 m_bShowDirectoryOverlays = config->readBoolEntry( "ShowDirectoryOverlays", false ); 00097 m_bShowFreeSpaceOverlays = config->readBoolEntry( "ShowFreeSpaceOverlays", true ); 00098 00099 m_dontPreview = config->readListEntry( "DontPreview" ); 00100 m_dontPreview.remove("audio/"); //Use the separate setting. 00101 //We default to this off anyway, so it's no harm to remove this 00102 00103 //The setting for sound previews is stored separately, so we can force 00104 //the default-to-off bias to propagate up. 00105 if (!config->readBoolEntry("EnableSoundPreviews", false)) 00106 { 00107 if (!m_dontPreview.contains("audio/")) 00108 m_dontPreview.append("audio/"); 00109 } 00110 00111 d->previewsEnabled = config->readBoolEntry( "PreviewsEnabled", true ); 00112 00113 TQColor tc = KonqFMSettings::settings()->normalTextColor(); 00114 m_textColor = config->readColorEntry( "TextColor", &tc ); 00115 m_bgColor = config->readColorEntry( "BgColor" ); // will be set to TQColor() if not found 00116 m_bgPixmapFile = config->readPathEntry( "BgImage" ); 00117 //kdDebug(1203) << "KonqPropsView::KonqPropsView from \"config\" : BgImage=" << m_bgPixmapFile << endl; 00118 00119 // colorsConfig is either the local file (.directory) or the application global file 00120 // (we want the same colors for all types of view) 00121 // The code above reads from the view's config file, for compatibility only. 00122 // So now we read the settings from the app global file, if this is the default props 00123 if (!defaultProps) 00124 { 00125 TDEConfigGroupSaver cgs2(TDEGlobal::config(), "Settings"); 00126 m_textColor = TDEGlobal::config()->readColorEntry( "TextColor", &m_textColor ); 00127 m_bgColor = TDEGlobal::config()->readColorEntry( "BgColor", &m_bgColor ); 00128 m_bgPixmapFile = TDEGlobal::config()->readPathEntry( "BgImage", m_bgPixmapFile ); 00129 //kdDebug(1203) << "KonqPropsView::KonqPropsView from TDEGlobal : BgImage=" << m_bgPixmapFile << endl; 00130 } 00131 00132 TDEGlobal::dirs()->addResourceType("tiles", 00133 TDEGlobal::dirs()->kde_default("data") + "konqueror/tiles/"); 00134 } 00135 00136 bool KonqPropsView::isCaseInsensitiveSort() const 00137 { 00138 return d->caseInsensitiveSort; 00139 } 00140 00141 bool KonqPropsView::isDirsFirst() const 00142 { 00143 return d->dirsfirst; 00144 } 00145 00146 bool KonqPropsView::isDescending() const 00147 { 00148 return d->descending; 00149 } 00150 00151 TDEConfigBase * KonqPropsView::currentConfig() 00152 { 00153 if ( !m_currentConfig ) 00154 { 00155 // 0L ? This has to be a non-default save-locally instance... 00156 assert ( m_bSaveViewPropertiesLocally ); 00157 assert ( !isDefaultProperties() ); 00158 00159 if (!dotDirectory.isEmpty()) 00160 m_currentConfig = new KSimpleConfig( dotDirectory ); 00161 // the "else" is when we want to save locally but this is a remote URL -> no save 00162 } 00163 return m_currentConfig; 00164 } 00165 00166 TDEConfigBase * KonqPropsView::currentColorConfig() 00167 { 00168 // Saving locally ? 00169 if ( m_bSaveViewPropertiesLocally && !isDefaultProperties() ) 00170 return currentConfig(); // Will create it if necessary 00171 else 00172 // Save color settings in app's file, not in view's file 00173 return TDEGlobal::config(); 00174 } 00175 00176 KonqPropsView::~KonqPropsView() 00177 { 00178 delete d->previewsToShow; 00179 delete d; 00180 d=0; 00181 } 00182 00183 bool KonqPropsView::enterDir( const KURL & dir ) 00184 { 00185 //kdDebug(1203) << "enterDir " << dir.prettyURL() << endl; 00186 // Can't do that with default properties 00187 assert( !isDefaultProperties() ); 00188 00189 // Check for .directory 00190 KURL u ( dir ); 00191 u.addPath(".directory"); 00192 bool dotDirExists = u.isLocalFile() && TQFile::exists( u.path() ); 00193 dotDirectory = u.isLocalFile() ? u.path() : TQString::null; 00194 00195 // Revert to default setting first - unless there is no .directory 00196 // in the previous dir nor in this one (then we can keep the current settings) 00197 if (dotDirExists || m_dotDirExists) 00198 { 00199 m_iIconSize = m_defaultProps->iconSize(); 00200 m_iItemTextPos = m_defaultProps->itemTextPos(); 00201 d->sortcriterion = m_defaultProps->sortCriterion(); 00202 d->dirsfirst = m_defaultProps->isDirsFirst(); 00203 d->descending = m_defaultProps->isDescending(); 00204 m_bShowDot = m_defaultProps->isShowingDotFiles(); 00205 d->caseInsensitiveSort=m_defaultProps->isCaseInsensitiveSort(); 00206 m_dontPreview = m_defaultProps->m_dontPreview; 00207 m_textColor = m_defaultProps->m_textColor; 00208 m_bgColor = m_defaultProps->m_bgColor; 00209 m_bgPixmapFile = m_defaultProps->bgPixmapFile(); 00210 } 00211 00212 if (dotDirExists) 00213 { 00214 //kdDebug(1203) << "Found .directory file" << endl; 00215 KSimpleConfig * config = new KSimpleConfig( dotDirectory, true ); 00216 config->setGroup("URL properties"); 00217 00218 m_iIconSize = config->readNumEntry( "IconSize", m_iIconSize ); 00219 m_iItemTextPos = config->readNumEntry( "ItemTextPos", m_iItemTextPos ); 00220 d->sortcriterion = config->readEntry( "SortingCriterion" , d->sortcriterion ); 00221 d->dirsfirst = config->readBoolEntry( "SortDirsFirst", d->dirsfirst ); 00222 d->descending = config->readBoolEntry( "SortDescending", d->descending ); 00223 m_bShowDot = config->readBoolEntry( "ShowDotFiles", m_bShowDot ); 00224 d->caseInsensitiveSort=config->readBoolEntry("CaseInsensitiveSort",d->caseInsensitiveSort); 00225 m_bShowDirectoryOverlays = config->readBoolEntry( "ShowDirectoryOverlays", m_bShowDirectoryOverlays ); 00226 m_bShowFreeSpaceOverlays = config->readBoolEntry( "ShowFreeSpaceOverlays", m_bShowFreeSpaceOverlays ); 00227 if (config->hasKey( "DontPreview" )) 00228 { 00229 m_dontPreview = config->readListEntry( "DontPreview" ); 00230 00231 //If the .directory file says something about sound previews, 00232 //obey it, otherwise propagate the setting up from the defaults 00233 //All this really should be split into a per-thumbnail setting, 00234 //but that's too invasive at this point 00235 if (config->hasKey("EnableSoundPreviews")) 00236 { 00237 00238 if (!config->readBoolEntry("EnableSoundPreviews", false)) 00239 if (!m_dontPreview.contains("audio/")) 00240 m_dontPreview.append("audio/"); 00241 } 00242 else 00243 { 00244 if (m_defaultProps->m_dontPreview.contains("audio/")) 00245 if (!m_dontPreview.contains("audio/")) 00246 m_dontPreview.append("audio/"); 00247 } 00248 } 00249 00250 00251 00252 m_textColor = config->readColorEntry( "TextColor", &m_textColor ); 00253 m_bgColor = config->readColorEntry( "BgColor", &m_bgColor ); 00254 m_bgPixmapFile = config->readPathEntry( "BgImage", m_bgPixmapFile ); 00255 //kdDebug(1203) << "KonqPropsView::enterDir m_bgPixmapFile=" << m_bgPixmapFile << endl; 00256 d->previewsEnabled = config->readBoolEntry( "PreviewsEnabled", d->previewsEnabled ); 00257 delete config; 00258 } 00259 //if there is or was a .directory then the settings probably have changed 00260 bool configChanged=(m_dotDirExists|| dotDirExists); 00261 m_dotDirExists = dotDirExists; 00262 m_currentConfig = 0L; // new dir, not current config for saving yet 00263 //kdDebug(1203) << "KonqPropsView::enterDir returning " << configChanged << endl; 00264 return configChanged; 00265 } 00266 00267 void KonqPropsView::setSaveViewPropertiesLocally( bool value ) 00268 { 00269 assert( !isDefaultProperties() ); 00270 //kdDebug(1203) << "KonqPropsView::setSaveViewPropertiesLocally " << value << endl; 00271 00272 if ( m_bSaveViewPropertiesLocally ) 00273 delete m_currentConfig; // points to a KSimpleConfig 00274 00275 m_bSaveViewPropertiesLocally = value; 00276 m_currentConfig = 0L; // mark as dirty 00277 } 00278 00279 void KonqPropsView::setIconSize( int size ) 00280 { 00281 m_iIconSize = size; 00282 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00283 m_defaultProps->setIconSize( size ); 00284 else if (currentConfig()) 00285 { 00286 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00287 currentConfig()->writeEntry( "IconSize", m_iIconSize ); 00288 currentConfig()->sync(); 00289 } 00290 } 00291 00292 void KonqPropsView::setItemTextPos( int pos ) 00293 { 00294 m_iItemTextPos = pos; 00295 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00296 m_defaultProps->setItemTextPos( pos ); 00297 else if (currentConfig()) 00298 { 00299 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00300 currentConfig()->writeEntry( "ItemTextPos", m_iItemTextPos ); 00301 currentConfig()->sync(); 00302 } 00303 } 00304 00305 void KonqPropsView::setSortCriterion( const TQString &criterion ) 00306 { 00307 d->sortcriterion = criterion; 00308 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00309 m_defaultProps->setSortCriterion( criterion ); 00310 else if (currentConfig()) 00311 { 00312 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00313 currentConfig()->writeEntry( "SortingCriterion", d->sortcriterion ); 00314 currentConfig()->sync(); 00315 } 00316 } 00317 00318 void KonqPropsView::setDirsFirst( bool first) 00319 { 00320 d->dirsfirst = first; 00321 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00322 m_defaultProps->setDirsFirst( first ); 00323 else if (currentConfig()) 00324 { 00325 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00326 currentConfig()->writeEntry( "SortDirsFirst", d->dirsfirst ); 00327 currentConfig()->sync(); 00328 } 00329 } 00330 00331 void KonqPropsView::setDescending( bool descend) 00332 { 00333 d->descending = descend; 00334 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00335 m_defaultProps->setDescending( descend ); 00336 else if (currentConfig()) 00337 { 00338 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00339 currentConfig()->writeEntry( "SortDescending", d->descending ); 00340 currentConfig()->sync(); 00341 } 00342 } 00343 00344 void KonqPropsView::setShowingDotFiles( bool show ) 00345 { 00346 kdDebug(1203) << "KonqPropsView::setShowingDotFiles " << show << endl; 00347 m_bShowDot = show; 00348 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00349 { 00350 kdDebug(1203) << "Saving in default properties" << endl; 00351 m_defaultProps->setShowingDotFiles( show ); 00352 } 00353 else if (currentConfig()) 00354 { 00355 kdDebug(1203) << "Saving in current config" << endl; 00356 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00357 currentConfig()->writeEntry( "ShowDotFiles", m_bShowDot ); 00358 currentConfig()->sync(); 00359 } 00360 } 00361 00362 void KonqPropsView::setCaseInsensitiveSort( bool on ) 00363 { 00364 kdDebug(1203) << "KonqPropsView::setCaseInsensitiveSort " << on << endl; 00365 d->caseInsensitiveSort = on; 00366 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00367 { 00368 kdDebug(1203) << "Saving in default properties" << endl; 00369 m_defaultProps->setCaseInsensitiveSort( on ); 00370 } 00371 else if (currentConfig()) 00372 { 00373 kdDebug(1203) << "Saving in current config" << endl; 00374 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00375 currentConfig()->writeEntry( "CaseInsensitiveSort", d->caseInsensitiveSort ); 00376 currentConfig()->sync(); 00377 } 00378 } 00379 00380 void KonqPropsView::setShowingDirectoryOverlays( bool show ) 00381 { 00382 kdDebug(1203) << "KonqPropsView::setShowingDirectoryOverlays " << show << endl; 00383 m_bShowDirectoryOverlays = show; 00384 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00385 { 00386 kdDebug(1203) << "Saving in default properties" << endl; 00387 m_defaultProps->setShowingDirectoryOverlays( show ); 00388 } 00389 else if (currentConfig()) 00390 { 00391 kdDebug(1203) << "Saving in current config" << endl; 00392 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00393 currentConfig()->writeEntry( "ShowDirectoryOverlays", m_bShowDirectoryOverlays ); 00394 currentConfig()->sync(); 00395 } 00396 } 00397 00398 void KonqPropsView::setShowingFreeSpaceOverlays( bool show ) 00399 { 00400 kdDebug(1203) << "KonqPropsView::setShowingFreeSpaceOverlays " << show << endl; 00401 m_bShowFreeSpaceOverlays = show; 00402 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00403 { 00404 kdDebug(1203) << "Saving in default properties" << endl; 00405 m_defaultProps->setShowingFreeSpaceOverlays( show ); 00406 } 00407 else if (currentConfig()) 00408 { 00409 kdDebug(1203) << "Saving in current config" << endl; 00410 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00411 currentConfig()->writeEntry( "ShowFreeSpaceOverlays", m_bShowFreeSpaceOverlays ); 00412 currentConfig()->sync(); 00413 } 00414 } 00415 00416 void KonqPropsView::setShowingPreview( const TQString &preview, bool show ) 00417 { 00418 if ( m_dontPreview.contains( preview ) != show ) 00419 return; 00420 else if ( show ) 00421 m_dontPreview.remove( preview ); 00422 else 00423 m_dontPreview.append( preview ); 00424 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00425 m_defaultProps->setShowingPreview( preview, show ); 00426 else if (currentConfig()) 00427 { 00428 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00429 00430 //Audio is special-cased, as we use a binary setting 00431 //for it to get it to follow the defaults right. 00432 bool audioEnabled = !m_dontPreview.contains("audio/"); 00433 00434 //Don't write it out into the DontPreview line 00435 if (!audioEnabled) 00436 m_dontPreview.remove("audio/"); 00437 currentConfig()->writeEntry( "DontPreview", m_dontPreview ); 00438 currentConfig()->writeEntry( "EnableSoundPreviews", audioEnabled ); 00439 currentConfig()->sync(); 00440 if (!audioEnabled) 00441 m_dontPreview.append("audio/"); 00442 00443 } 00444 00445 delete d->previewsToShow; 00446 d->previewsToShow = 0; 00447 } 00448 00449 void KonqPropsView::setShowingPreview( bool show ) 00450 { 00451 d->previewsEnabled = show; 00452 00453 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00454 { 00455 kdDebug(1203) << "Saving in default properties" << endl; 00456 m_defaultProps-> setShowingPreview( show ); 00457 } 00458 else if (currentConfig()) 00459 { 00460 kdDebug(1203) << "Saving in current config" << endl; 00461 TDEConfigGroupSaver cgs(currentConfig(), currentGroup()); 00462 currentConfig()->writeEntry( "PreviewsEnabled", d->previewsEnabled ); 00463 currentConfig()->sync(); 00464 } 00465 00466 delete d->previewsToShow; 00467 d->previewsToShow = 0; 00468 } 00469 00470 bool KonqPropsView::isShowingPreview() 00471 { 00472 return d->previewsEnabled; 00473 } 00474 00475 void KonqPropsView::setBgColor( const TQColor & color ) 00476 { 00477 m_bgColor = color; 00478 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00479 { 00480 m_defaultProps->setBgColor( color ); 00481 } 00482 else 00483 { 00484 TDEConfigBase * colorConfig = currentColorConfig(); 00485 if (colorConfig) // 0L when saving locally but remote URL 00486 { 00487 TDEConfigGroupSaver cgs(colorConfig, currentGroup()); 00488 colorConfig->writeEntry( "BgColor", m_bgColor ); 00489 colorConfig->sync(); 00490 } 00491 } 00492 } 00493 00494 const TQColor & KonqPropsView::bgColor( TQWidget * widget ) const 00495 { 00496 if ( !m_bgColor.isValid() ) 00497 return widget->colorGroup().base(); 00498 else 00499 return m_bgColor; 00500 } 00501 00502 void KonqPropsView::setTextColor( const TQColor & color ) 00503 { 00504 m_textColor = color; 00505 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00506 { 00507 m_defaultProps->setTextColor( color ); 00508 } 00509 else 00510 { 00511 TDEConfigBase * colorConfig = currentColorConfig(); 00512 if (colorConfig) // 0L when saving locally but remote URL 00513 { 00514 TDEConfigGroupSaver cgs(colorConfig, currentGroup()); 00515 colorConfig->writeEntry( "TextColor", m_textColor ); 00516 colorConfig->sync(); 00517 } 00518 } 00519 } 00520 00521 const TQColor & KonqPropsView::textColor( TQWidget * widget ) const 00522 { 00523 if ( !m_textColor.isValid() ) 00524 return widget->colorGroup().text(); 00525 else 00526 return m_textColor; 00527 } 00528 00529 void KonqPropsView::setBgPixmapFile( const TQString & file ) 00530 { 00531 m_bgPixmapFile = file; 00532 00533 if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) 00534 { 00535 m_defaultProps->setBgPixmapFile( file ); 00536 } 00537 else 00538 { 00539 TDEConfigBase * colorConfig = currentColorConfig(); 00540 if (colorConfig) // 0L when saving locally but remote URL 00541 { 00542 TDEConfigGroupSaver cgs(colorConfig, currentGroup()); 00543 colorConfig->writePathEntry( "BgImage", file ); 00544 colorConfig->sync(); 00545 } 00546 } 00547 } 00548 00549 TQPixmap KonqPropsView::loadPixmap() const 00550 { 00551 //kdDebug(1203) << "KonqPropsView::loadPixmap " << m_bgPixmapFile << endl; 00552 TQPixmap bgPixmap; 00553 if ( !m_bgPixmapFile.isEmpty() ) 00554 bgPixmap = wallpaperPixmap( m_bgPixmapFile ); 00555 return bgPixmap; 00556 } 00557 00558 void KonqPropsView::applyColors(TQWidget * widget) const 00559 { 00560 if ( m_bgPixmapFile.isEmpty() ) 00561 widget->setPaletteBackgroundColor( bgColor( widget ) ); 00562 else 00563 { 00564 TQPixmap pix = loadPixmap(); 00565 // don't set an null pixmap, as this leads to 00566 // undefined results with regards to the background of widgets 00567 // that have the iconview as a parent and on the iconview itself 00568 // e.g. the rename textedit widget when renaming a QIconViewItem 00569 // Qt-issue: N64698 00570 if ( ! pix.isNull() ) 00571 widget->setBackgroundPixmap( pix ); 00572 // setPaletteBackgroundPixmap leads to flicker on window activation(!) 00573 } 00574 00575 if ( m_textColor.isValid() ) 00576 widget->setPaletteForegroundColor( m_textColor ); 00577 } 00578 00579 const TQStringList& KonqPropsView::previewSettings() 00580 { 00581 if ( ! d->previewsToShow ) 00582 { 00583 d->previewsToShow = new TQStringList; 00584 00585 if (d->previewsEnabled) { 00586 TDETrader::OfferList plugins = TDETrader::self()->query( "ThumbCreator" ); 00587 for ( TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it ) 00588 { 00589 TQString name = (*it)->desktopEntryName(); 00590 if ( ! m_dontPreview.contains(name) ) 00591 d->previewsToShow->append( name ); 00592 } 00593 if ( ! m_dontPreview.contains( "audio/" ) ) 00594 d->previewsToShow->append( "audio/" ); 00595 } 00596 } 00597 00598 return *(d->previewsToShow); 00599 } 00600 00601 const TQString& KonqPropsView::sortCriterion() const { 00602 return d->sortcriterion; 00603 } 00604