summaryrefslogtreecommitdiffstats
path: root/konqueror/iconview
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-12-27 19:29:38 -0600
committerTimothy Pearson <[email protected]>2013-12-27 19:29:38 -0600
commitb876907e650eaf996aa3c2bcfac9a526cf900c5b (patch)
tree513671ea3db58c11b28de8ee74f51ff35be6b9c8 /konqueror/iconview
parentee68bc1fd3d2e5edc1527bdfcacfb330b7670a86 (diff)
downloadtdebase-b876907e650eaf996aa3c2bcfac9a526cf900c5b.tar.gz
tdebase-b876907e650eaf996aa3c2bcfac9a526cf900c5b.zip
Fix free space overlay not disappearing on unmount
Fix devices disappearing on unmount Automatically close notification popup on associated media device removal
Diffstat (limited to 'konqueror/iconview')
-rw-r--r--konqueror/iconview/konq_iconview.cc49
-rw-r--r--konqueror/iconview/konq_iconview.h2
2 files changed, 31 insertions, 20 deletions
diff --git a/konqueror/iconview/konq_iconview.cc b/konqueror/iconview/konq_iconview.cc
index 6e6a6fb4a..7ff2db6e9 100644
--- a/konqueror/iconview/konq_iconview.cc
+++ b/konqueror/iconview/konq_iconview.cc
@@ -170,6 +170,7 @@ KonqKfmIconView::KonqKfmIconView( TQWidget *parentWidget, TQObject *parent, cons
, m_bNeedSetCurrentItem( false )
, m_pEnsureVisible( 0 )
, m_paOutstandingOverlaysTimer( 0 )
+ , m_paOutstandingFreeSpaceOverlaysTimer( 0 )
, m_pTimeoutRefreshTimer( 0 )
, m_itemDict( 43 )
{
@@ -1083,8 +1084,11 @@ void KonqKfmIconView::slotDeleteItem( KFileItem * _fileitem )
m_itemDict.remove( _fileitem );
if (m_paOutstandingOverlays.first() == ivi) // Being processed?
m_paOutstandingOverlaysTimer->start(20, true); // Restart processing...
-
m_paOutstandingOverlays.remove(ivi);
+ if (m_paOutstandingFreeSpaceOverlays.first() == ivi) // Being processed?
+ m_paOutstandingFreeSpaceOverlaysTimer->start(20, true); // Restart processing...
+ m_paOutstandingFreeSpaceOverlays.remove(ivi);
+
delete ivi;
}
}
@@ -1112,18 +1116,16 @@ void KonqKfmIconView::showFreeSpaceOverlay(KFileIVI* item)
{
KFileItem* fileItem = item->item();
- if ( TDEGlobalSettings::showFilePreview( fileItem->url() ) ) {
- m_paOutstandingOverlays.append(item);
- if (m_paOutstandingOverlays.count() == 1)
- {
- if (!m_paOutstandingOverlaysTimer)
- {
- m_paOutstandingOverlaysTimer = new TQTimer(this);
- connect(m_paOutstandingOverlaysTimer, TQT_SIGNAL(timeout()),
- TQT_SLOT(slotFreeSpaceOverlayStart()));
- }
- m_paOutstandingOverlaysTimer->start(20, true);
- }
+ m_paOutstandingFreeSpaceOverlays.append(item);
+ if (m_paOutstandingFreeSpaceOverlays.count() == 1)
+ {
+ if (!m_paOutstandingFreeSpaceOverlaysTimer)
+ {
+ m_paOutstandingFreeSpaceOverlaysTimer = new TQTimer(this);
+ connect(m_paOutstandingFreeSpaceOverlaysTimer, TQT_SIGNAL(timeout()),
+ TQT_SLOT(slotFreeSpaceOverlayStart()));
+ }
+ m_paOutstandingFreeSpaceOverlaysTimer->start(20, true);
}
}
@@ -1151,7 +1153,7 @@ void KonqKfmIconView::slotFreeSpaceOverlayStart()
{
do
{
- KFileIVI* item = m_paOutstandingOverlays.first();
+ KFileIVI* item = m_paOutstandingFreeSpaceOverlays.first();
if (!item)
return; // Nothing to do
@@ -1163,7 +1165,7 @@ void KonqKfmIconView::slotFreeSpaceOverlayStart()
overlay->start(); // Watch out, may emit finished() immediately!!
return; // Let it run....
}
- m_paOutstandingOverlays.removeFirst();
+ m_paOutstandingFreeSpaceOverlays.removeFirst();
} while (true);
}
@@ -1177,10 +1179,10 @@ void KonqKfmIconView::slotDirectoryOverlayFinished()
void KonqKfmIconView::slotFreeSpaceOverlayFinished()
{
- m_paOutstandingOverlays.removeFirst();
+ m_paOutstandingFreeSpaceOverlays.removeFirst();
- if (m_paOutstandingOverlays.count() > 0)
- m_paOutstandingOverlaysTimer->start(0, true); // Don't call directly to prevent deep recursion.
+ if (m_paOutstandingFreeSpaceOverlays.count() > 0)
+ m_paOutstandingFreeSpaceOverlaysTimer->start(0, true); // Don't call directly to prevent deep recursion.
}
// see also KDesktop::slotRefreshItems
@@ -1211,8 +1213,14 @@ void KonqKfmIconView::slotRefreshItems( const KFileItemList& entries )
if ( !bNeedRepaint && oldSize != ivi->pixmap()->size() ) {
bNeedRepaint = true;
}
- if ( (*rit)->mimetype().startsWith("media/") && (*rit)->mimetype().contains("_mounted") && m_pProps->isShowingFreeSpaceOverlays() ) {
- showFreeSpaceOverlay(ivi);
+ if ( (*rit)->mimetype().startsWith("media/") && m_pProps->isShowingFreeSpaceOverlays() ) {
+ if ((*rit)->mimetype().contains("_mounted")) {
+ showFreeSpaceOverlay(ivi);
+ }
+ else {
+ // If not mounted, hide free space overlay
+ ivi->setShowFreeSpaceOverlay(false);
+ }
}
}
}
@@ -1380,6 +1388,7 @@ bool KonqKfmIconView::doOpenURL( const KURL & url )
m_bUpdateContentsPosAfterListing = true;
m_paOutstandingOverlays.clear();
+ m_paOutstandingFreeSpaceOverlays.clear();
// Start the directory lister !
m_dirLister->openURL( url, false, args.reload );
diff --git a/konqueror/iconview/konq_iconview.h b/konqueror/iconview/konq_iconview.h
index d66cc4cc8..5a5f0a1ac 100644
--- a/konqueror/iconview/konq_iconview.h
+++ b/konqueror/iconview/konq_iconview.h
@@ -202,7 +202,9 @@ protected:
TDEToggleAction *m_paFreeSpaceOverlays;
TDEToggleAction *m_paEnablePreviews;
TQPtrList<KFileIVI> m_paOutstandingOverlays;
+ TQPtrList<KFileIVI> m_paOutstandingFreeSpaceOverlays;
TQTimer *m_paOutstandingOverlaysTimer;
+ TQTimer *m_paOutstandingFreeSpaceOverlaysTimer;
/* TDEToggleAction *m_paImagePreview;
TDEToggleAction *m_paTextPreview;
TDEToggleAction *m_paHTMLPreview;*/