• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libkonq
 

libkonq

  • libkonq
konq_propsview.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 1998, 1999 Faure David <faure@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "konq_propsview.h"
21 #include "konq_settings.h"
22 
23 #include <kdebug.h>
24 #include <kstandarddirs.h>
25 #include <kpixmap.h>
26 #include <tqpixmapcache.h>
27 #include <tqiconview.h>
28 #include <unistd.h>
29 #include <tqfile.h>
30 #include <iostream>
31 #include <ktrader.h>
32 #include <kinstance.h>
33 #include <assert.h>
34 
35 #include <ksimpleconfig.h>
36 
37 #include "konq_sort_constants.h"
38 
39 static TQPixmap wallpaperPixmap( const TQString & _wallpaper )
40 {
41  TQString key = "wallpapers/";
42  key += _wallpaper;
43  KPixmap pix;
44 
45  if ( TQPixmapCache::find( key, pix ) )
46  return pix;
47 
48  TQString path = locate("tiles", _wallpaper);
49  if (path.isEmpty())
50  path = locate("wallpaper", _wallpaper);
51  if (!path.isEmpty())
52  {
53  // This looks really ugly, especially on an 8bit display.
54  // I'm not sure what it's good for.
55  // Anyway, if you change it here, keep konq_bgnddlg in sync (David)
56  // pix.load( path, 0, KPixmap::LowColor );
57  pix.load( path );
58  if ( pix.isNull() )
59  kdWarning(1203) << "Could not load wallpaper " << path << endl;
60  else
61  TQPixmapCache::insert( key, pix );
62  return pix;
63  } else kdWarning(1203) << "Couldn't locate wallpaper " << _wallpaper << endl;
64  return TQPixmap();
65 }
66 
67 struct KonqPropsView::Private
68 {
69  TQStringList* previewsToShow;
70  TextSortOrder textSortOrder;
71  bool previewsEnabled:1;
72  bool caseInsensitiveSort:1;
73  bool dirsfirst:1;
74  bool hiddenfirst:1;
75  bool descending:1;
76  TQString sortcriterion;
77 };
78 
79 KonqPropsView::KonqPropsView( TDEInstance * instance, KonqPropsView * defaultProps )
80  : m_bSaveViewPropertiesLocally( false ), // will be overridden by setSave... anyway
81  // if this is the default properties instance, then keep config object for saving
82  m_dotDirExists( true ), // HACK so that enterDir returns true initially
83  m_currentConfig( defaultProps ? 0L : instance->config() ),
84  m_defaultProps( defaultProps )
85 {
86 
87  TDEConfig *config = instance->config();
88  TDEConfigGroupSaver cgs(config, "Settings");
89 
90  d = new Private;
91  d->previewsToShow = 0;
92  d->caseInsensitiveSort=config->readBoolEntry( "CaseInsensitiveSort", true );
93 
94  m_iIconSize = config->readNumEntry( "IconSize", 0 );
95  m_iItemTextPos = config->readNumEntry( "ItemTextPos", TQIconView::Bottom );
96  d->sortcriterion = config->readEntry( "SortingCriterion", "sort_nci" );
97  d->textSortOrder = (TextSortOrder) config->readNumEntry( "TextSortOrder", 1 );
98  d->dirsfirst = config->readBoolEntry( "SortDirsFirst", true );
99  d->hiddenfirst = config->readBoolEntry( "SortHiddenFirst", true );
100  d->descending = config->readBoolEntry( "SortDescending", false );
101  m_bShowDot = config->readBoolEntry( "ShowDotFiles", false );
102  m_bShowDirectoryOverlays = config->readBoolEntry( "ShowDirectoryOverlays", false );
103  m_bShowFreeSpaceOverlays = config->readBoolEntry( "ShowFreeSpaceOverlays", true );
104 
105  m_dontPreview = config->readListEntry( "DontPreview" );
106  m_dontPreview.remove("audio/"); //Use the separate setting.
107  //We default to this off anyway, so it's no harm to remove this
108 
109  //The setting for sound previews is stored separately, so we can force
110  //the default-to-off bias to propagate up.
111  if (!config->readBoolEntry("EnableSoundPreviews", false))
112  {
113  if (!m_dontPreview.contains("audio/"))
114  m_dontPreview.append("audio/");
115  }
116 
117  d->previewsEnabled = config->readBoolEntry( "PreviewsEnabled", true );
118 
119  TQColor tc = KonqFMSettings::settings()->normalTextColor();
120  m_textColor = config->readColorEntry( "TextColor", &tc );
121  m_bgColor = config->readColorEntry( "BgColor" ); // will be set to TQColor() if not found
122  m_bgPixmapFile = config->readPathEntry( "BgImage" );
123  //kdDebug(1203) << "KonqPropsView::KonqPropsView from \"config\" : BgImage=" << m_bgPixmapFile << endl;
124 
125  // colorsConfig is either the local file (.directory) or the application global file
126  // (we want the same colors for all types of view)
127  // The code above reads from the view's config file, for compatibility only.
128  // So now we read the settings from the app global file, if this is the default props
129  if (!defaultProps)
130  {
131  TDEConfigGroupSaver cgs2(TDEGlobal::config(), "Settings");
132  m_textColor = TDEGlobal::config()->readColorEntry( "TextColor", &m_textColor );
133  m_bgColor = TDEGlobal::config()->readColorEntry( "BgColor", &m_bgColor );
134  m_bgPixmapFile = TDEGlobal::config()->readPathEntry( "BgImage", m_bgPixmapFile );
135  //kdDebug(1203) << "KonqPropsView::KonqPropsView from TDEGlobal : BgImage=" << m_bgPixmapFile << endl;
136  }
137 
138  TDEGlobal::dirs()->addResourceType("tiles",
139  TDEGlobal::dirs()->kde_default("data") + "konqueror/tiles/");
140 }
141 
142 bool KonqPropsView::isCaseInsensitiveSort() const
143 {
144  return d->caseInsensitiveSort;
145 }
146 
147 TextSortOrder KonqPropsView::getSortOrder() const
148 {
149  return d->textSortOrder;
150 }
151 
152 bool KonqPropsView::isDirsFirst() const
153 {
154  return d->dirsfirst;
155 }
156 
157 bool KonqPropsView::isHiddenFirst() const
158 {
159  return d->hiddenfirst;
160 }
161 
162 bool KonqPropsView::isDescending() const
163 {
164  return d->descending;
165 }
166 
167 TDEConfigBase * KonqPropsView::currentConfig()
168 {
169  if ( !m_currentConfig )
170  {
171  // 0L ? This has to be a non-default save-locally instance...
172  assert ( m_bSaveViewPropertiesLocally );
173  assert ( !isDefaultProperties() );
174 
175  if (!dotDirectory.isEmpty())
176  m_currentConfig = new KSimpleConfig( dotDirectory );
177  // the "else" is when we want to save locally but this is a remote URL -> no save
178  }
179  return m_currentConfig;
180 }
181 
182 TDEConfigBase * KonqPropsView::currentColorConfig()
183 {
184  // Saving locally ?
185  if ( m_bSaveViewPropertiesLocally && !isDefaultProperties() )
186  return currentConfig(); // Will create it if necessary
187  else
188  // Save color settings in app's file, not in view's file
189  return TDEGlobal::config();
190 }
191 
192 KonqPropsView::~KonqPropsView()
193 {
194  delete d->previewsToShow;
195  delete d;
196  d=0;
197 }
198 
199 bool KonqPropsView::enterDir( const KURL & dir )
200 {
201  //kdDebug(1203) << "enterDir " << dir.prettyURL() << endl;
202  // Can't do that with default properties
203  assert( !isDefaultProperties() );
204 
205  // Check for .directory
206  KURL u ( dir );
207  u.addPath(".directory");
208  bool dotDirExists = u.isLocalFile() && TQFile::exists( u.path() );
209  dotDirectory = u.isLocalFile() ? u.path() : TQString::null;
210 
211  // Revert to default setting first - unless there is no .directory
212  // in the previous dir nor in this one (then we can keep the current settings)
213  if (dotDirExists || m_dotDirExists)
214  {
215  m_iIconSize = m_defaultProps->iconSize();
216  m_iItemTextPos = m_defaultProps->itemTextPos();
217  d->sortcriterion = m_defaultProps->sortCriterion();
218  d->textSortOrder = m_defaultProps->getSortOrder();
219  d->dirsfirst = m_defaultProps->isDirsFirst();
220  d->hiddenfirst = m_defaultProps->isHiddenFirst();
221  d->descending = m_defaultProps->isDescending();
222  m_bShowDot = m_defaultProps->isShowingDotFiles();
223  d->caseInsensitiveSort=m_defaultProps->isCaseInsensitiveSort();
224  m_dontPreview = m_defaultProps->m_dontPreview;
225  m_textColor = m_defaultProps->m_textColor;
226  m_bgColor = m_defaultProps->m_bgColor;
227  m_bgPixmapFile = m_defaultProps->bgPixmapFile();
228  }
229 
230  if (dotDirExists)
231  {
232  //kdDebug(1203) << "Found .directory file" << endl;
233  KSimpleConfig * config = new KSimpleConfig( dotDirectory, true );
234  config->setGroup("URL properties");
235 
236  m_iIconSize = config->readNumEntry( "IconSize", m_iIconSize );
237  m_iItemTextPos = config->readNumEntry( "ItemTextPos", m_iItemTextPos );
238  d->sortcriterion = config->readEntry( "SortingCriterion" , d->sortcriterion );
239  d->textSortOrder = (TextSortOrder) config->readNumEntry( "TextSortOrder", d->textSortOrder );
240  d->dirsfirst = config->readBoolEntry( "SortDirsFirst", d->dirsfirst );
241  d->hiddenfirst = config->readBoolEntry( "SortHiddenFirst", d->hiddenfirst );
242  d->descending = config->readBoolEntry( "SortDescending", d->descending );
243  m_bShowDot = config->readBoolEntry( "ShowDotFiles", m_bShowDot );
244  d->caseInsensitiveSort=config->readBoolEntry("CaseInsensitiveSort",d->caseInsensitiveSort);
245  m_bShowDirectoryOverlays = config->readBoolEntry( "ShowDirectoryOverlays", m_bShowDirectoryOverlays );
246  m_bShowFreeSpaceOverlays = config->readBoolEntry( "ShowFreeSpaceOverlays", m_bShowFreeSpaceOverlays );
247  if (config->hasKey( "DontPreview" ))
248  {
249  m_dontPreview = config->readListEntry( "DontPreview" );
250 
251  //If the .directory file says something about sound previews,
252  //obey it, otherwise propagate the setting up from the defaults
253  //All this really should be split into a per-thumbnail setting,
254  //but that's too invasive at this point
255  if (config->hasKey("EnableSoundPreviews"))
256  {
257 
258  if (!config->readBoolEntry("EnableSoundPreviews", false))
259  if (!m_dontPreview.contains("audio/"))
260  m_dontPreview.append("audio/");
261  }
262  else
263  {
264  if (m_defaultProps->m_dontPreview.contains("audio/"))
265  if (!m_dontPreview.contains("audio/"))
266  m_dontPreview.append("audio/");
267  }
268  }
269 
270 
271 
272  m_textColor = config->readColorEntry( "TextColor", &m_textColor );
273  m_bgColor = config->readColorEntry( "BgColor", &m_bgColor );
274  m_bgPixmapFile = config->readPathEntry( "BgImage", m_bgPixmapFile );
275  //kdDebug(1203) << "KonqPropsView::enterDir m_bgPixmapFile=" << m_bgPixmapFile << endl;
276  d->previewsEnabled = config->readBoolEntry( "PreviewsEnabled", d->previewsEnabled );
277  delete config;
278  }
279  //if there is or was a .directory then the settings probably have changed
280  bool configChanged=(m_dotDirExists|| dotDirExists);
281  m_dotDirExists = dotDirExists;
282  m_currentConfig = 0L; // new dir, not current config for saving yet
283  //kdDebug(1203) << "KonqPropsView::enterDir returning " << configChanged << endl;
284  return configChanged;
285 }
286 
287 void KonqPropsView::setSaveViewPropertiesLocally( bool value )
288 {
289  assert( !isDefaultProperties() );
290  //kdDebug(1203) << "KonqPropsView::setSaveViewPropertiesLocally " << value << endl;
291 
292  if ( m_bSaveViewPropertiesLocally )
293  delete m_currentConfig; // points to a KSimpleConfig
294 
295  m_bSaveViewPropertiesLocally = value;
296  m_currentConfig = 0L; // mark as dirty
297 }
298 
299 void KonqPropsView::setIconSize( int size )
300 {
301  m_iIconSize = size;
302  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
303  m_defaultProps->setIconSize( size );
304  else if (currentConfig())
305  {
306  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
307  currentConfig()->writeEntry( "IconSize", m_iIconSize );
308  currentConfig()->sync();
309  }
310 }
311 
312 void KonqPropsView::setItemTextPos( int pos )
313 {
314  m_iItemTextPos = pos;
315  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
316  m_defaultProps->setItemTextPos( pos );
317  else if (currentConfig())
318  {
319  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
320  currentConfig()->writeEntry( "ItemTextPos", m_iItemTextPos );
321  currentConfig()->sync();
322  }
323 }
324 
325 void KonqPropsView::setSortCriterion( const TQString &criterion )
326 {
327  d->sortcriterion = criterion;
328  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
329  m_defaultProps->setSortCriterion( criterion );
330  else if (currentConfig())
331  {
332  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
333  currentConfig()->writeEntry( "SortingCriterion", d->sortcriterion );
334  currentConfig()->sync();
335  }
336 }
337 
338 void KonqPropsView::setSortOrder( TextSortOrder order)
339 {
340  d->textSortOrder = order;
341  if ( m_defaultProps && !m_bSaveViewPropertiesLocally ) {
342  m_defaultProps->setSortOrder( order );
343  }
344  else if (currentConfig())
345  {
346  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
347  currentConfig()->writeEntry( "TextSortOrder", d->textSortOrder );
348  currentConfig()->sync();
349  }
350 }
351 
352 void KonqPropsView::setDirsFirst( bool first)
353 {
354  d->dirsfirst = first;
355  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
356  m_defaultProps->setDirsFirst( first );
357  else if (currentConfig())
358  {
359  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
360  currentConfig()->writeEntry( "SortDirsFirst", d->dirsfirst );
361  currentConfig()->sync();
362  }
363 }
364 
365 void KonqPropsView::setHiddenFirst(bool first)
366 {
367  d->hiddenfirst = first;
368  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
369  m_defaultProps->setHiddenFirst( first );
370  else if (currentConfig())
371  {
372  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
373  currentConfig()->writeEntry( "SortHiddenFirst", d->hiddenfirst );
374  currentConfig()->sync();
375  }
376 }
377 
378 void KonqPropsView::setDescending( bool descend)
379 {
380  d->descending = descend;
381  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
382  m_defaultProps->setDescending( descend );
383  else if (currentConfig())
384  {
385  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
386  currentConfig()->writeEntry( "SortDescending", d->descending );
387  currentConfig()->sync();
388  }
389 }
390 
391 void KonqPropsView::setShowingDotFiles( bool show )
392 {
393  kdDebug(1203) << "KonqPropsView::setShowingDotFiles " << show << endl;
394  m_bShowDot = show;
395  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
396  {
397  kdDebug(1203) << "Saving in default properties" << endl;
398  m_defaultProps->setShowingDotFiles( show );
399  }
400  else if (currentConfig())
401  {
402  kdDebug(1203) << "Saving in current config" << endl;
403  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
404  currentConfig()->writeEntry( "ShowDotFiles", m_bShowDot );
405  currentConfig()->sync();
406  }
407 }
408 
409 void KonqPropsView::setCaseInsensitiveSort( bool on )
410 {
411  kdDebug(1203) << "KonqPropsView::setCaseInsensitiveSort " << on << endl;
412  d->caseInsensitiveSort = on;
413  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
414  {
415  kdDebug(1203) << "Saving in default properties" << endl;
416  m_defaultProps->setCaseInsensitiveSort( on );
417  }
418  else if (currentConfig())
419  {
420  kdDebug(1203) << "Saving in current config" << endl;
421  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
422  currentConfig()->writeEntry( "CaseInsensitiveSort", d->caseInsensitiveSort );
423  currentConfig()->sync();
424  }
425 }
426 
427 void KonqPropsView::setShowingDirectoryOverlays( bool show )
428 {
429  kdDebug(1203) << "KonqPropsView::setShowingDirectoryOverlays " << show << endl;
430  m_bShowDirectoryOverlays = show;
431  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
432  {
433  kdDebug(1203) << "Saving in default properties" << endl;
434  m_defaultProps->setShowingDirectoryOverlays( show );
435  }
436  else if (currentConfig())
437  {
438  kdDebug(1203) << "Saving in current config" << endl;
439  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
440  currentConfig()->writeEntry( "ShowDirectoryOverlays", m_bShowDirectoryOverlays );
441  currentConfig()->sync();
442  }
443 }
444 
445 void KonqPropsView::setShowingFreeSpaceOverlays( bool show )
446 {
447  kdDebug(1203) << "KonqPropsView::setShowingFreeSpaceOverlays " << show << endl;
448  m_bShowFreeSpaceOverlays = show;
449  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
450  {
451  kdDebug(1203) << "Saving in default properties" << endl;
452  m_defaultProps->setShowingFreeSpaceOverlays( show );
453  }
454  else if (currentConfig())
455  {
456  kdDebug(1203) << "Saving in current config" << endl;
457  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
458  currentConfig()->writeEntry( "ShowFreeSpaceOverlays", m_bShowFreeSpaceOverlays );
459  currentConfig()->sync();
460  }
461 }
462 
463 void KonqPropsView::setShowingPreview( const TQString &preview, bool show )
464 {
465  if ( m_dontPreview.contains( preview ) != show )
466  return;
467  else if ( show )
468  m_dontPreview.remove( preview );
469  else
470  m_dontPreview.append( preview );
471  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
472  m_defaultProps->setShowingPreview( preview, show );
473  else if (currentConfig())
474  {
475  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
476 
477  //Audio is special-cased, as we use a binary setting
478  //for it to get it to follow the defaults right.
479  bool audioEnabled = !m_dontPreview.contains("audio/");
480 
481  //Don't write it out into the DontPreview line
482  if (!audioEnabled)
483  m_dontPreview.remove("audio/");
484  currentConfig()->writeEntry( "DontPreview", m_dontPreview );
485  currentConfig()->writeEntry( "EnableSoundPreviews", audioEnabled );
486  currentConfig()->sync();
487  if (!audioEnabled)
488  m_dontPreview.append("audio/");
489 
490  }
491 
492  delete d->previewsToShow;
493  d->previewsToShow = 0;
494 }
495 
496 void KonqPropsView::setShowingPreview( bool show )
497 {
498  d->previewsEnabled = show;
499 
500  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
501  {
502  kdDebug(1203) << "Saving in default properties" << endl;
503  m_defaultProps-> setShowingPreview( show );
504  }
505  else if (currentConfig())
506  {
507  kdDebug(1203) << "Saving in current config" << endl;
508  TDEConfigGroupSaver cgs(currentConfig(), currentGroup());
509  currentConfig()->writeEntry( "PreviewsEnabled", d->previewsEnabled );
510  currentConfig()->sync();
511  }
512 
513  delete d->previewsToShow;
514  d->previewsToShow = 0;
515 }
516 
517 bool KonqPropsView::isShowingPreview()
518 {
519  return d->previewsEnabled;
520 }
521 
522 void KonqPropsView::setBgColor( const TQColor & color )
523 {
524  m_bgColor = color;
525  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
526  {
527  m_defaultProps->setBgColor( color );
528  }
529  else
530  {
531  TDEConfigBase * colorConfig = currentColorConfig();
532  if (colorConfig) // 0L when saving locally but remote URL
533  {
534  TDEConfigGroupSaver cgs(colorConfig, currentGroup());
535  colorConfig->writeEntry( "BgColor", m_bgColor );
536  colorConfig->sync();
537  }
538  }
539 }
540 
541 const TQColor & KonqPropsView::bgColor( TQWidget * widget ) const
542 {
543  if ( !m_bgColor.isValid() )
544  return widget->colorGroup().base();
545  else
546  return m_bgColor;
547 }
548 
549 void KonqPropsView::setTextColor( const TQColor & color )
550 {
551  m_textColor = color;
552  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
553  {
554  m_defaultProps->setTextColor( color );
555  }
556  else
557  {
558  TDEConfigBase * colorConfig = currentColorConfig();
559  if (colorConfig) // 0L when saving locally but remote URL
560  {
561  TDEConfigGroupSaver cgs(colorConfig, currentGroup());
562  colorConfig->writeEntry( "TextColor", m_textColor );
563  colorConfig->sync();
564  }
565  }
566 }
567 
568 const TQColor & KonqPropsView::textColor( TQWidget * widget ) const
569 {
570  if ( !m_textColor.isValid() )
571  return widget->colorGroup().text();
572  else
573  return m_textColor;
574 }
575 
576 void KonqPropsView::setBgPixmapFile( const TQString & file )
577 {
578  m_bgPixmapFile = file;
579 
580  if ( m_defaultProps && !m_bSaveViewPropertiesLocally )
581  {
582  m_defaultProps->setBgPixmapFile( file );
583  }
584  else
585  {
586  TDEConfigBase * colorConfig = currentColorConfig();
587  if (colorConfig) // 0L when saving locally but remote URL
588  {
589  TDEConfigGroupSaver cgs(colorConfig, currentGroup());
590  colorConfig->writePathEntry( "BgImage", file );
591  colorConfig->sync();
592  }
593  }
594 }
595 
596 TQPixmap KonqPropsView::loadPixmap() const
597 {
598  //kdDebug(1203) << "KonqPropsView::loadPixmap " << m_bgPixmapFile << endl;
599  TQPixmap bgPixmap;
600  if ( !m_bgPixmapFile.isEmpty() )
601  bgPixmap = wallpaperPixmap( m_bgPixmapFile );
602  return bgPixmap;
603 }
604 
605 void KonqPropsView::applyColors(TQWidget * widget) const
606 {
607  if ( m_bgPixmapFile.isEmpty() )
608  widget->setPaletteBackgroundColor( bgColor( widget ) );
609  else
610  {
611  TQPixmap pix = loadPixmap();
612  // don't set an null pixmap, as this leads to
613  // undefined results with regards to the background of widgets
614  // that have the iconview as a parent and on the iconview itself
615  // e.g. the rename textedit widget when renaming a QIconViewItem
616  // Qt-issue: N64698
617  if ( ! pix.isNull() )
618  widget->setBackgroundPixmap( pix );
619  // setPaletteBackgroundPixmap leads to flicker on window activation(!)
620  }
621 
622  if ( m_textColor.isValid() )
623  widget->setPaletteForegroundColor( m_textColor );
624 }
625 
626 const TQStringList& KonqPropsView::previewSettings()
627 {
628  if ( ! d->previewsToShow )
629  {
630  d->previewsToShow = new TQStringList;
631 
632  if (d->previewsEnabled) {
633  TDETrader::OfferList plugins = TDETrader::self()->query( "ThumbCreator" );
634  for ( TDETrader::OfferList::ConstIterator it = plugins.begin(); it != plugins.end(); ++it )
635  {
636  TQString name = (*it)->desktopEntryName();
637  if ( ! m_dontPreview.contains(name) )
638  d->previewsToShow->append( name );
639  }
640  if ( ! m_dontPreview.contains( "audio/" ) )
641  d->previewsToShow->append( "audio/" );
642  }
643  }
644 
645  return *(d->previewsToShow);
646 }
647 
648 const TQString& KonqPropsView::sortCriterion() const {
649  return d->sortcriterion;
650 }
651 
KonqFMSettings::settings
static KonqFMSettings * settings()
The static instance of KonqFMSettings.
Definition: konq_settings.cpp:47
KonqPropsView
The class KonqPropsView holds the properties for a Konqueror View.
Definition: konq_propsview.h:47
KonqPropsView::enterDir
bool enterDir(const KURL &dir)
Called when entering a directory Checks for a .directory, read it.
Definition: konq_propsview.cpp:199
KonqPropsView::KonqPropsView
KonqPropsView(TDEInstance *instance, KonqPropsView *defaultProps)
Constructs a KonqPropsView instance from an instance config file.
Definition: konq_propsview.cpp:79
KonqPropsView::isDefaultProperties
bool isDefaultProperties() const
Is this the instance representing default properties ?
Definition: konq_propsview.h:64
KonqPropsView::~KonqPropsView
virtual ~KonqPropsView()
Destructor.
Definition: konq_propsview.cpp:192
KonqPropsView::setSaveViewPropertiesLocally
void setSaveViewPropertiesLocally(bool value)
Turn on/off saving properties locally Don't do this on the default properties instance.
Definition: konq_propsview.cpp:287

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

Skip menu "libkonq"
  • kate
  • libkonq
  • twin
  •   lib
Generated for libkonq by doxygen 1.9.1
This website is maintained by Timothy Pearson.