|
|
@ -146,7 +146,7 @@ DirFilterPlugin::DirFilterPlugin (TQObject* parent, const char* name,
|
|
|
|
:KParts::Plugin (parent, name),
|
|
|
|
:KParts::Plugin (parent, name),
|
|
|
|
m_oldFilterString("")
|
|
|
|
m_oldFilterString("")
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_part = ::tqqt_cast<KonqDirPart*>(parent);
|
|
|
|
m_part = ::tqt_cast<KonqDirPart*>(parent);
|
|
|
|
|
|
|
|
|
|
|
|
if ( !m_part || !m_part->scrollWidget() )
|
|
|
|
if ( !m_part || !m_part->scrollWidget() )
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -179,12 +179,12 @@ DirFilterPlugin::DirFilterPlugin (TQObject* parent, const char* name,
|
|
|
|
|
|
|
|
|
|
|
|
clear->setWhatsThis(i18n("Clear filter field<p>Clears the content of the filter field."));
|
|
|
|
clear->setWhatsThis(i18n("Clear filter field<p>Clears the content of the filter field."));
|
|
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<TDEListView*>(m_part->scrollWidget()) )
|
|
|
|
if ( ::tqt_cast<TDEListView*>(m_part->scrollWidget()) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_searchWidget = new TDEListViewSearchLine(hbox);
|
|
|
|
m_searchWidget = new TDEListViewSearchLine(hbox);
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->setListView(static_cast<TDEListView*>(m_part->scrollWidget()));
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->setListView(static_cast<TDEListView*>(m_part->scrollWidget()));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( ::tqqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
else if ( ::tqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_searchWidget = new TDEIconViewSearchLine(hbox);
|
|
|
|
m_searchWidget = new TDEIconViewSearchLine(hbox);
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->setIconView(static_cast<TQIconView*>(m_part->scrollWidget()));
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->setIconView(static_cast<TQIconView*>(m_part->scrollWidget()));
|
|
|
@ -463,7 +463,7 @@ void DirFilterPlugin::slotItemRemoved(const KFileItem* item)
|
|
|
|
// NOTE: This bug is NOT present in qlistviewitem
|
|
|
|
// NOTE: This bug is NOT present in qlistviewitem
|
|
|
|
|
|
|
|
|
|
|
|
// HACK around it here...
|
|
|
|
// HACK around it here...
|
|
|
|
if ( ::tqqt_cast<TQIconView*>(m_part->scrollWidget()) ) {
|
|
|
|
if ( ::tqt_cast<TQIconView*>(m_part->scrollWidget()) ) {
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->iconDeleted(item->name());
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->iconDeleted(item->name());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -495,27 +495,27 @@ void DirFilterPlugin::slotItemsRefresh(const KFileItemList &list)
|
|
|
|
m_pFilterMenu->setEnabled (m_part->nameFilter().isEmpty());
|
|
|
|
m_pFilterMenu->setEnabled (m_part->nameFilter().isEmpty());
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( ::tqqt_cast<TDEListView*>(m_part->scrollWidget()) )
|
|
|
|
if ( ::tqt_cast<TDEListView*>(m_part->scrollWidget()) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( ::tqqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
else if ( ::tqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQMap<TQString,bool> itemsMap;
|
|
|
|
TQMap<TQString,bool> itemsMap;
|
|
|
|
if (::tqqt_cast<TDEListView*>(m_part->scrollWidget()))
|
|
|
|
if (::tqt_cast<TDEListView*>(m_part->scrollWidget()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQListView *listview = ::tqqt_cast<TDEListView*>(m_part->scrollWidget());
|
|
|
|
TQListView *listview = ::tqt_cast<TDEListView*>(m_part->scrollWidget());
|
|
|
|
for (TQListViewItemIterator lv_it(listview); lv_it.current(); ++lv_it)
|
|
|
|
for (TQListViewItemIterator lv_it(listview); lv_it.current(); ++lv_it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
itemsMap.insert(lv_it.current()->text(0), false);
|
|
|
|
itemsMap.insert(lv_it.current()->text(0), false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( ::tqqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
else if ( ::tqt_cast<TQIconView*>(m_part->scrollWidget()) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQIconView *iconview = ::tqqt_cast<TQIconView*>(m_part->scrollWidget());
|
|
|
|
TQIconView *iconview = ::tqt_cast<TQIconView*>(m_part->scrollWidget());
|
|
|
|
for (TQIconViewItem *item = iconview->firstItem(); item; item = item->nextItem())
|
|
|
|
for (TQIconViewItem *item = iconview->firstItem(); item; item = item->nextItem())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
itemsMap.insert(item->text(), false);
|
|
|
|
itemsMap.insert(item->text(), false);
|
|
|
@ -599,10 +599,10 @@ void DirFilterPlugin::activateSearch()
|
|
|
|
|
|
|
|
|
|
|
|
m_oldFilterString = m_searchWidget->text();
|
|
|
|
m_oldFilterString = m_searchWidget->text();
|
|
|
|
|
|
|
|
|
|
|
|
if ( ::tqqt_cast<TDEListView*>(m_part->scrollWidget()) ) {
|
|
|
|
if ( ::tqt_cast<TDEListView*>(m_part->scrollWidget()) ) {
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
static_cast<TDEListViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( ::tqqt_cast<TQIconView*>(m_part->scrollWidget()) ) {
|
|
|
|
else if ( ::tqt_cast<TQIconView*>(m_part->scrollWidget()) ) {
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
static_cast<TDEIconViewSearchLine*>(m_searchWidget)->updateSearch();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|