diff options
Diffstat (limited to 'konq-plugins/dirfilter')
-rw-r--r-- | konq-plugins/dirfilter/dirfilterplugin.cpp | 128 | ||||
-rw-r--r-- | konq-plugins/dirfilter/dirfilterplugin.h | 42 |
2 files changed, 85 insertions, 85 deletions
diff --git a/konq-plugins/dirfilter/dirfilterplugin.cpp b/konq-plugins/dirfilter/dirfilterplugin.cpp index 8401238..ff2eecd 100644 --- a/konq-plugins/dirfilter/dirfilterplugin.cpp +++ b/konq-plugins/dirfilter/dirfilterplugin.cpp @@ -19,13 +19,13 @@ #include <unistd.h> #include <sys/types.h> -#include <qtimer.h> -#include <qapplication.h> -#include <qlabel.h> -#include <qpushbutton.h> -#include <qhbox.h> -#include <qwhatsthis.h> -#include <qiconview.h> +#include <tqtimer.h> +#include <tqapplication.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqhbox.h> +#include <tqwhatsthis.h> +#include <tqiconview.h> #include <klistview.h> #include <kdebug.h> @@ -71,9 +71,9 @@ SessionManager::~SessionManager() m_self = 0; } -QString SessionManager::generateKey (const KURL& url) const +TQString SessionManager::generateKey (const KURL& url) const { - QString key; + TQString key; key = url.protocol (); key += ':'; @@ -86,32 +86,32 @@ QString SessionManager::generateKey (const KURL& url) const key += url.path (); key += ':'; - key += QString::number (m_pid); + key += TQString::number (m_pid); return key; } -QStringList SessionManager::restoreMimeFilters (const KURL& url) const +TQStringList SessionManager::restoreMimeFilters (const KURL& url) const { - QString key(generateKey(url)); + TQString key(generateKey(url)); return m_filters[key]; } -QString SessionManager::restoreTypedFilter (const KURL& url) const +TQString SessionManager::restoreTypedFilter (const KURL& url) const { - QString key(generateKey(url)); + TQString key(generateKey(url)); return m_typedFilter[key]; } -void SessionManager::save (const KURL& url, const QStringList& filters) +void SessionManager::save (const KURL& url, const TQStringList& filters) { - QString key = generateKey(url); + TQString key = generateKey(url); m_filters[key] = filters; } -void SessionManager::save (const KURL& url, const QString& typedFilter) +void SessionManager::save (const KURL& url, const TQString& typedFilter) { - QString key = generateKey(url); + TQString key = generateKey(url); m_typedFilter[key] = typedFilter; } @@ -141,8 +141,8 @@ void SessionManager::loadSettings() -DirFilterPlugin::DirFilterPlugin (QObject* parent, const char* name, - const QStringList&) +DirFilterPlugin::DirFilterPlugin (TQObject* parent, const char* name, + const TQStringList&) :KParts::Plugin (parent, name), m_pFilterMenu(0), m_searchWidget(0), @@ -158,23 +158,23 @@ DirFilterPlugin::DirFilterPlugin (QObject* parent, const char* name, m_pFilterMenu->setDelayed (false); m_pFilterMenu->setWhatsThis(i18n("Allow to filter the currently displayed items by filetype.")); - connect (m_pFilterMenu->popupMenu(), SIGNAL (aboutToShow()), - SLOT (slotShowPopup())); + connect (m_pFilterMenu->popupMenu(), TQT_SIGNAL (aboutToShow()), + TQT_SLOT (slotShowPopup())); - connect (m_part, SIGNAL (itemRemoved(const KFileItem*)), - SLOT( slotItemRemoved (const KFileItem*))); - connect (m_part, SIGNAL (itemsAdded(const KFileItemList&)), - SLOT (slotItemsAdded(const KFileItemList&))); - connect (m_part, SIGNAL (itemsFilteredByMime(const KFileItemList&)), - SLOT (slotItemsAdded(const KFileItemList&))); - connect (m_part, SIGNAL(aboutToOpenURL()), SLOT(slotOpenURL())); + connect (m_part, TQT_SIGNAL (itemRemoved(const KFileItem*)), + TQT_SLOT( slotItemRemoved (const KFileItem*))); + connect (m_part, TQT_SIGNAL (itemsAdded(const KFileItemList&)), + TQT_SLOT (slotItemsAdded(const KFileItemList&))); + connect (m_part, TQT_SIGNAL (itemsFilteredByMime(const KFileItemList&)), + TQT_SLOT (slotItemsAdded(const KFileItemList&))); + connect (m_part, TQT_SIGNAL(aboutToOpenURL()), TQT_SLOT(slotOpenURL())); // add a searchline filter for konqis icons/list views - QHBox *hbox = new QHBox(m_part->widget()); + TQHBox *hbox = new TQHBox(m_part->widget()); hbox->hide(); KAction *clear = new KAction(i18n("Clear Filter Field"), - QApplication::reverseLayout() ? "clear_left" : "locationbar_erase", + TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, 0, 0, actionCollection(), "clear_filter"); clear->setWhatsThis(i18n("Clear filter field<p>Clears the content of the filter field.")); @@ -184,18 +184,18 @@ DirFilterPlugin::DirFilterPlugin (QObject* parent, const char* name, m_searchWidget = new KListViewSearchLine(hbox); static_cast<KListViewSearchLine*>(m_searchWidget)->setListView(static_cast<KListView*>(m_part->scrollWidget())); } - else if ( ::qt_cast<QIconView*>(m_part->scrollWidget()) ) + else if ( ::qt_cast<TQIconView*>(m_part->scrollWidget()) ) { m_searchWidget = new KIconViewSearchLine(hbox); - static_cast<KIconViewSearchLine*>(m_searchWidget)->setIconView(static_cast<QIconView*>(m_part->scrollWidget())); + static_cast<KIconViewSearchLine*>(m_searchWidget)->setIconView(static_cast<TQIconView*>(m_part->scrollWidget())); } if ( m_searchWidget ) { - QWhatsThis::add(m_searchWidget, i18n("Enter here a text which an item in the view must contain anywhere to be shown.")); - connect(clear, SIGNAL(activated()), m_searchWidget, SLOT(clear())); - connect(m_searchWidget, SIGNAL(textChanged(const QString&)), this, SLOT(searchTextChanged(const QString&))); + TQWhatsThis::add(m_searchWidget, i18n("Enter here a text which an item in the view must contain anywhere to be shown.")); + connect(clear, TQT_SIGNAL(activated()), m_searchWidget, TQT_SLOT(clear())); + connect(m_searchWidget, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(searchTextChanged(const TQString&))); } KWidgetAction *filterAction = new KWidgetAction(hbox, i18n("Filter Field"), @@ -205,11 +205,11 @@ DirFilterPlugin::DirFilterPlugin (QObject* parent, const char* name, // FIXME: This causes crashes for an unknown reason on certain systems // Probably the iconview onchange event handler should tempoarily stop this timer before doing anything else // Really the broken Qt3 iconview should just be modified to include a hidden list; it would make things *so* much easier! - m_refreshTimer = new QTimer( this ); - m_reactivateRefreshTimer = new QTimer( this ); - connect( m_refreshTimer, SIGNAL(timeout()), this, SLOT(activateSearch()) ); + m_refreshTimer = new TQTimer( this ); + m_reactivateRefreshTimer = new TQTimer( this ); + connect( m_refreshTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(activateSearch()) ); m_refreshTimer->start( 200, FALSE ); // 200 millisecond continuous timer - connect( m_reactivateRefreshTimer, SIGNAL(timeout()), this, SLOT(reactivateRefreshTimer()) ); + connect( m_reactivateRefreshTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(reactivateRefreshTimer()) ); } @@ -222,7 +222,7 @@ DirFilterPlugin::~DirFilterPlugin() delete m_reactivateRefreshTimer; } -void DirFilterPlugin::searchTextChanged(const QString& newtext) +void DirFilterPlugin::searchTextChanged(const TQString& newtext) { m_refreshTimer->stop(); m_reactivateRefreshTimer->stop(); @@ -249,7 +249,7 @@ void DirFilterPlugin::slotOpenURL () SessionManager::self()->save(m_pURL, m_searchWidget->text()); m_searchWidget->clear(); - QString typedFilter(SessionManager::self()->restoreTypedFilter(url)); + TQString typedFilter(SessionManager::self()->restoreTypedFilter(url)); m_searchWidget->completionObject()->addItem(typedFilter); m_searchWidget->setText(typedFilter); } @@ -271,8 +271,8 @@ void DirFilterPlugin::slotShowPopup() int id = 0; uint enableReset = 0; - QString label; - QStringList inodes; + TQString label; + TQStringList inodes; m_pFilterMenu->popupMenu()->clear(); m_pFilterMenu->popupMenu()->insertTitle (i18n("Only Show Items of Type")); @@ -293,13 +293,13 @@ void DirFilterPlugin::slotShowPopup() { label = it.data().mimeComment; label += " ("; - label += QString::number (it.data().filenames.size ()); + label += TQString::number (it.data().filenames.size ()); label += ")"; } m_pMimeInfo[it.key()].id = m_pFilterMenu->popupMenu()->insertItem ( SmallIconSet(it.data().iconName), label, - this, SLOT(slotItemSelected(int)), 0, ++id); + this, TQT_SLOT(slotItemSelected(int)), 0, ++id); if (it.data().useAsFilter) { @@ -313,8 +313,8 @@ void DirFilterPlugin::slotShowPopup() { m_pFilterMenu->popupMenu()->insertSeparator (); - QStringList::Iterator it = inodes.begin(); - QStringList::Iterator end = inodes.end(); + TQStringList::Iterator it = inodes.begin(); + TQStringList::Iterator end = inodes.end(); for (; it != end; ++it) { @@ -324,13 +324,13 @@ void DirFilterPlugin::slotShowPopup() { label = m_pMimeInfo[(*it)].mimeComment; label += " ("; - label += QString::number (m_pMimeInfo[(*it)].filenames.size ()); + label += TQString::number (m_pMimeInfo[(*it)].filenames.size ()); label += ")"; } m_pMimeInfo[(*it)].id = m_pFilterMenu->popupMenu()->insertItem ( SmallIconSet(m_pMimeInfo[(*it)].iconName), label, - this, SLOT(slotItemSelected(int)), 0, ++id); + this, TQT_SLOT(slotItemSelected(int)), 0, ++id); if (m_pMimeInfo[(*it)].useAsFilter) { @@ -342,16 +342,16 @@ void DirFilterPlugin::slotShowPopup() m_pFilterMenu->popupMenu()->insertSeparator (); id = m_pFilterMenu->popupMenu()->insertItem (i18n("Use Multiple Filters"), - this, SLOT(slotMultipleFilters())); + this, TQT_SLOT(slotMultipleFilters())); m_pFilterMenu->popupMenu()->setItemEnabled (id, enableReset <= 1); m_pFilterMenu->popupMenu()->setItemChecked (id, SessionManager::self()->useMultipleFilters); id = m_pFilterMenu->popupMenu()->insertItem (i18n("Show Count"), this, - SLOT(slotShowCount())); + TQT_SLOT(slotShowCount())); m_pFilterMenu->popupMenu()->setItemChecked (id, SessionManager::self()->showCount); id = m_pFilterMenu->popupMenu()->insertItem (i18n("Reset"), this, - SLOT(slotReset())); + TQT_SLOT(slotReset())); m_pFilterMenu->popupMenu()->setItemEnabled (id, enableReset); } @@ -367,7 +367,7 @@ void DirFilterPlugin::slotItemSelected (int id) if (it != m_pMimeInfo.end()) { - QStringList filters; + TQStringList filters; if (it.data().useAsFilter) { @@ -420,7 +420,7 @@ void DirFilterPlugin::slotItemsAdded (const KFileItemList& list) { static_cast<KListViewSearchLine*>(m_searchWidget)->updateSearch(); } - else if ( ::qt_cast<QIconView*>(m_part->scrollWidget()) ) + else if ( ::qt_cast<TQIconView*>(m_part->scrollWidget()) ) { static_cast<KIconViewSearchLine*>(m_searchWidget)->updateSearch(); } @@ -432,16 +432,16 @@ void DirFilterPlugin::slotItemsAdded (const KFileItemList& list) for (KFileItemListIterator it (list); it.current (); ++it) { - QString name = it.current()->name(); + TQString name = it.current()->name(); KMimeType::Ptr mime = it.current()->mimeTypePtr(); // don't resolve mimetype if unknown if (!mime) continue; - QString mimeType = mime->name(); + TQString mimeType = mime->name(); if (!m_pMimeInfo.contains (mimeType)) { MimeInfo& mimeInfo = m_pMimeInfo[mimeType]; - QStringList filters = m_part->mimeFilter (); + TQStringList filters = m_part->mimeFilter (); mimeInfo.useAsFilter = (!filters.isEmpty () && filters.contains (mimeType)); mimeInfo.mimeComment = mime->comment(); mimeInfo.iconName = mime->icon(KURL(), false); @@ -468,11 +468,11 @@ void DirFilterPlugin::slotItemRemoved (const KFileItem* item) // NOTE: This bug is NOT present in qlistviewitem // HACK around it here... - if ( ::qt_cast<QIconView*>(m_part->scrollWidget()) ) { + if ( ::qt_cast<TQIconView*>(m_part->scrollWidget()) ) { static_cast<KIconViewSearchLine*>(m_searchWidget)->iconDeleted(item->name()); } - QString mimeType = item->mimetype().stripWhiteSpace(); + TQString mimeType = item->mimetype().stripWhiteSpace(); if (m_pMimeInfo.contains (mimeType)) { MimeInfo info = m_pMimeInfo [mimeType]; @@ -481,11 +481,11 @@ void DirFilterPlugin::slotItemRemoved (const KFileItem* item) m_pMimeInfo [mimeType].filenames.remove (item->name ()); else { if (info.useAsFilter) { - QStringList filters = m_part->mimeFilter (); + TQStringList filters = m_part->mimeFilter (); filters.remove (mimeType); m_part->setMimeFilter (filters); SessionManager::self()->save (m_part->url(), filters); - QTimer::singleShot( 0, this, SLOT(slotTimeout()) ); + TQTimer::singleShot( 0, this, TQT_SLOT(slotTimeout()) ); } m_pMimeInfo.remove (mimeType); } @@ -509,7 +509,7 @@ void DirFilterPlugin::activateSearch() if ( ::qt_cast<KListView*>(m_part->scrollWidget()) ) { static_cast<KListViewSearchLine*>(m_searchWidget)->updateSearch(); } - else if ( ::qt_cast<QIconView*>(m_part->scrollWidget()) ) { + else if ( ::qt_cast<TQIconView*>(m_part->scrollWidget()) ) { static_cast<KIconViewSearchLine*>(m_searchWidget)->updateSearch(); } } @@ -523,7 +523,7 @@ void DirFilterPlugin::slotReset() for (; it != m_pMimeInfo.end(); ++it) it.data().useAsFilter = false; - QStringList filters; + TQStringList filters; KURL url = m_part->url(); m_part->setMimeFilter (filters); diff --git a/konq-plugins/dirfilter/dirfilterplugin.h b/konq-plugins/dirfilter/dirfilterplugin.h index c1313be..ff3497e 100644 --- a/konq-plugins/dirfilter/dirfilterplugin.h +++ b/konq-plugins/dirfilter/dirfilterplugin.h @@ -19,9 +19,9 @@ #ifndef __DIR_FILTER_PLUGIN_H #define __DIR_FILTER_PLUGIN_H -#include <qmap.h> -#include <qtimer.h> -#include <qstringlist.h> +#include <tqmap.h> +#include <tqtimer.h> +#include <tqstringlist.h> #include <kurl.h> @@ -50,17 +50,17 @@ public: ~SessionManager (); static SessionManager* self (); - QStringList restoreMimeFilters (const KURL& url) const; - QString restoreTypedFilter(const KURL& url) const; - void save (const KURL& url, const QStringList& filters); - void save (const KURL& url, const QString& typedFilter); + TQStringList restoreMimeFilters (const KURL& url) const; + TQString restoreTypedFilter(const KURL& url) const; + void save (const KURL& url, const TQStringList& filters); + void save (const KURL& url, const TQString& typedFilter); bool showCount; bool useMultipleFilters; protected: - QString generateKey (const KURL& url) const; + TQString generateKey (const KURL& url) const; void loadSettings (); void saveSettings (); @@ -73,8 +73,8 @@ private: int m_pid; bool m_bSettingsLoaded; static SessionManager* m_self; - QMap<QString,QStringList> m_filters; - QMap<QString,QString> m_typedFilter; + TQMap<TQString,TQStringList> m_filters; + TQMap<TQString,TQString> m_typedFilter; }; @@ -84,7 +84,7 @@ class DirFilterPlugin : public KParts::Plugin public: - DirFilterPlugin (QObject* parent, const char* name, const QStringList &); + DirFilterPlugin (TQObject* parent, const char* name, const TQStringList &); ~DirFilterPlugin (); protected: @@ -100,11 +100,11 @@ protected: int id; bool useAsFilter; - QString mimeType; - QString iconName; - QString mimeComment; + TQString mimeType; + TQString iconName; + TQString mimeComment; - QMap<QString, bool> filenames; + TQMap<TQString, bool> filenames; }; void loadSettings(); @@ -121,19 +121,19 @@ private slots: void slotItemRemoved(const KFileItem *); void slotItemsAdded(const KFileItemList &); void activateSearch(); - void searchTextChanged(const QString& newtext); + void searchTextChanged(const TQString& newtext); void reactivateRefreshTimer(); private: KURL m_pURL; KonqDirPart* m_part; - QTimer *m_refreshTimer; - QTimer *m_reactivateRefreshTimer; + TQTimer *m_refreshTimer; + TQTimer *m_reactivateRefreshTimer; KActionMenu* m_pFilterMenu; - QString m_oldFilterString; + TQString m_oldFilterString; KLineEdit *m_searchWidget; - QMap<QString,MimeInfo> m_pMimeInfo; - typedef QMap<QString,MimeInfo>::Iterator MimeInfoIterator; + TQMap<TQString,MimeInfo> m_pMimeInfo; + typedef TQMap<TQString,MimeInfo>::Iterator MimeInfoIterator; }; #endif |