summaryrefslogtreecommitdiffstats
path: root/src/directorylist.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:30:17 +0200
committerMavridis Philippe <mavridisf@gmail.com>2021-01-13 19:30:17 +0200
commit357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (patch)
treedc3ef0e6fedd64f5fb177c114f72e1515a07cd1b /src/directorylist.cpp
parentc6cbd71bc169ac0e927e52325dbbbcb506abbc73 (diff)
downloadklamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.tar.gz
klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.zip
Conversion Qt3->TQt
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/directorylist.cpp')
-rw-r--r--src/directorylist.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/directorylist.cpp b/src/directorylist.cpp
index 66f80d9..f830ecd 100644
--- a/src/directorylist.cpp
+++ b/src/directorylist.cpp
@@ -16,15 +16,15 @@
* *
***************************************************************************/
-#include <qlabel.h>
-#include <qtooltip.h>
-#include <qdir.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
+#include <tqdir.h>
#include <kfileitem.h>
#include <klocale.h>
#include <kdebug.h>
#include <kdeversion.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <kiconloader.h>
#include <kapplication.h>
#include <dcopref.h>
@@ -39,23 +39,23 @@ using Collection::DeviceItem;
CollectionSetup* CollectionSetup::s_instance;
-CollectionSetup::CollectionSetup( QWidget *parent, bool recursive )
- : QVBox( parent )
+CollectionSetup::CollectionSetup( TQWidget *parent, bool recursive )
+ : TQVBox( parent )
{
s_instance = this;
-// (new QLabel( i18n(
-// "Select the folder(s) to scan. "), this ))->setAlignment( Qt::WordBreak );
+// (new TQLabel( i18n(
+// "Select the folder(s) to scan. "), this ))->setAlignment( TQt::WordBreak );
- m_view = new QListView( this );
-/* m_recursive = new QCheckBox( i18n("&Scan folders recursively"), this );*/
+ m_view = new TQListView( this );
+/* m_recursive = new TQCheckBox( i18n("&Scan folders recursively"), this );*/
m_recursive = recursive;
-// m_monitor = new QCheckBox( i18n("&Watch folders for changes"), this );
-// m_playlists = new QCheckBox( i18n("&Import playlists"), this );
+// m_monitor = new TQCheckBox( i18n("&Watch folders for changes"), this );
+// m_playlists = new TQCheckBox( i18n("&Import playlists"), this );
//
-// QToolTip::add( m_recursive, i18n( "If selected, amaroK reads all folders recursively." ) );
-// QToolTip::add( m_monitor, i18n( "If selected, folders will automatically get rescanned when the content is modified, e.g. when a new file was added." ) );
-// QToolTip::add( m_playlists, i18n( "If selected, playlist files (.m3u) will automatically be added to the Playlist-Browser." ) );
+// TQToolTip::add( m_recursive, i18n( "If selected, amaroK reads all folders recursively." ) );
+// TQToolTip::add( m_monitor, i18n( "If selected, folders will automatically get rescanned when the content is modified, e.g. when a new file was added." ) );
+// TQToolTip::add( m_playlists, i18n( "If selected, playlist files (.m3u) will automatically be added to the Playlist-Browser." ) );
// Read config values
// m_dirs = AmarokConfig::collectionFolders();
@@ -63,11 +63,11 @@ CollectionSetup::CollectionSetup( QWidget *parent, bool recursive )
// m_monitor->setChecked( AmarokConfig::monitorChanges() );
// m_playlists->setChecked( AmarokConfig::importPlaylists() );
- m_view->addColumn( QString::null );
+ m_view->addColumn( TQString::null );
m_view->setRootIsDecorated( true );
- reinterpret_cast<QWidget*>(m_view->header())->hide();
+ reinterpret_cast<TQWidget*>(m_view->header())->hide();
new Item( m_view, i18n( "System Folder" ), "/", "folder_red" );
- new Item( m_view, i18n( "Home Folder" ), QDir::homeDirPath(), "folder_home" );
+ new Item( m_view, i18n( "Home Folder" ), TQDir::homeDirPath(), "folder_home" );
new DeviceItem( m_view );
setSpacing( 6 );
@@ -82,8 +82,8 @@ void CollectionSetup::slotRecursiveToggled(bool on)
//////////////////////////////////////////////////////////////////////////////////////////
// CLASS Item
//////////////////////////////////////////////////////////////////////////////////////////
-Item::Item( QListView *parent , const QString &name, const QString &path, const QString &icon )
- : QCheckListItem( parent, name, QCheckListItem::CheckBox )
+Item::Item( TQListView *parent , const TQString &name, const TQString &path, const TQString &icon )
+ : TQCheckListItem( parent, name, TQCheckListItem::CheckBox )
, m_lister( true )
, m_url( "file:" + path )
, m_listed( false )
@@ -101,8 +101,8 @@ Item::Item( QListView *parent , const QString &name, const QString &path, const
}
-Item::Item( QListViewItem *parent, const KURL &url )
- : QCheckListItem( parent, url.fileName(), QCheckListItem::CheckBox )
+Item::Item( TQListViewItem *parent, const KURL &url )
+ : TQCheckListItem( parent, url.fileName(), TQCheckListItem::CheckBox )
, m_lister( true )
, m_url( url )
, m_listed( false )
@@ -117,12 +117,12 @@ Item::Item( QListViewItem *parent, const KURL &url )
}
-QString
+TQString
Item::fullPath() const
{
- QString path;
+ TQString path;
- for ( const QListViewItem *item = this; dynamic_cast<const QListViewItem*>( item ); item = item->parent() )
+ for ( const TQListViewItem *item = this; dynamic_cast<const TQListViewItem*>( item ); item = item->parent() )
{
path.prepend( '/' );
path.prepend( item->text( 1 ) );
@@ -140,7 +140,7 @@ Item::setOpen( bool b )
m_listed = true;
}
- QListViewItem::setOpen( b );
+ TQListViewItem::setOpen( b );
}
@@ -148,11 +148,11 @@ void
Item::stateChange( bool b )
{
if( CollectionSetup::instance()->recursive() )
- for( QListViewItem *item = firstChild(); item; item = item->nextSibling() )
- static_cast<QCheckListItem*>(item)->QCheckListItem::setOn( b );
+ for( TQListViewItem *item = firstChild(); item; item = item->nextSibling() )
+ static_cast<TQCheckListItem*>(item)->TQCheckListItem::setOn( b );
// Update folder list
- QStringList::Iterator it = CollectionSetup::instance()->m_dirs.find( m_url.path() );
+ TQStringList::Iterator it = CollectionSetup::instance()->m_dirs.find( m_url.path() );
if ( isOn() ) {
if ( it == CollectionSetup::instance()->m_dirs.end() )
{
@@ -180,7 +180,7 @@ void
Item::activate()
{
if( !isDisabled() )
- QCheckListItem::activate();
+ TQCheckListItem::activate();
}
@@ -200,7 +200,7 @@ Item::newItems( const KFileItemList &list ) //SLOT
void
-Item::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+Item::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
bool dirty = false;
@@ -216,10 +216,10 @@ Item::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, in
}
// Use a different color if this folder has an activated child folder
- QColorGroup _cg = cg;
- if ( dirty ) _cg.setColor( QColorGroup::Text, Qt::blue );
+ TQColorGroup _cg = cg;
+ if ( dirty ) _cg.setColor( TQColorGroup::Text, TQt::blue );
- QCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align );
+ TQCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align );
if (!dirty)
setOn(false);
}
@@ -228,8 +228,8 @@ Item::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, in
// CLASS DeviceItem
//////////////////////////////////////////////////////////////////////////////////////////
-DeviceItem::DeviceItem( QListView *parent )
- : QCheckListItem( parent, i18n("Devices"), QCheckListItem::CheckBox )
+DeviceItem::DeviceItem( TQListView *parent )
+ : TQCheckListItem( parent, i18n("Devices"), TQCheckListItem::CheckBox )
, m_lister( true )
, m_listed( false )
{
@@ -250,8 +250,8 @@ DeviceItem::DeviceItem( QListView *parent )
}
-DeviceItem::DeviceItem( QListViewItem *parent, const QString &name, const KURL &url )
- : QCheckListItem( parent, name, QCheckListItem::CheckBox )
+DeviceItem::DeviceItem( TQListViewItem *parent, const TQString &name, const KURL &url )
+ : TQCheckListItem( parent, name, TQCheckListItem::CheckBox )
, m_lister( true )
, m_url( url )
, m_listed( false )
@@ -262,14 +262,14 @@ DeviceItem::DeviceItem( QListViewItem *parent, const QString &name, const KURL &
else
////kdDebug() << "attached" << endl;
- QByteArray data;
- QByteArray param;
- QCString retType;
- QStringList retVal;
- QDataStream streamout(param,IO_WriteOnly);
+ TQByteArray data;
+ TQByteArray param;
+ TQCString retType;
+ TQStringList retVal;
+ TQDataStream streamout(param,IO_WriteOnly);
streamout<< url.fileName();
- QCString mediacall="mediamanager";
- QCString devicecall="properties";
+ TQCString mediacall="mediamanager";
+ TQCString devicecall="properties";
if ( KDE::versionMajor() == 3 && KDE::versionMinor() < 4 )
{
mediacall="mountwatcher";
@@ -299,10 +299,10 @@ DeviceItem::DeviceItem( QListViewItem *parent, const QString &name, const KURL &
}
-QString
+TQString
DeviceItem::fullPath() const
{
- QString path = text(1);
+ TQString path = text(1);
if (path != "devices")
return path;
return "";
@@ -318,7 +318,7 @@ DeviceItem::setOpen( bool b )
}
m_listed = true;
- QListViewItem::setOpen( b );
+ TQListViewItem::setOpen( b );
}
@@ -326,13 +326,13 @@ void
DeviceItem::stateChange( bool b )
{
if( CollectionSetup::instance()->recursive() )
- for( QListViewItem *item = firstChild(); item; item = item->nextSibling() )
- static_cast<QCheckListItem*>(item)->QCheckListItem::setOn( b );
+ for( TQListViewItem *item = firstChild(); item; item = item->nextSibling() )
+ static_cast<TQCheckListItem*>(item)->TQCheckListItem::setOn( b );
if (text(1) != "devices")
{
// Update folder list
- QStringList::Iterator it = CollectionSetup::instance()->m_dirs.find( text(1) );
+ TQStringList::Iterator it = CollectionSetup::instance()->m_dirs.find( text(1) );
if ( isOn() ) {
if ( it == CollectionSetup::instance()->m_dirs.end() )
{
@@ -363,7 +363,7 @@ void
DeviceItem::activate()
{
if( !isDisabled() )
- QCheckListItem::activate();
+ TQCheckListItem::activate();
}
@@ -386,11 +386,11 @@ DeviceItem::newItems( const KFileItemList &list ) //SLOT
void
-DeviceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align )
+DeviceItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align )
{
bool dirty = false;
- QColorGroup _cg = cg;
+ TQColorGroup _cg = cg;
////kdDebug() << text(1) << endl;
if (text(1) != "devices")
@@ -409,7 +409,7 @@ DeviceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int wid
}
else
{
- for( QListViewItem *item = firstChild(); item; item = item->nextSibling() )
+ for( TQListViewItem *item = firstChild(); item; item = item->nextSibling() )
{
DeviceItem *itm = dynamic_cast<DeviceItem*>(item);
for ( uint i = 0; i < CollectionSetup::instance()->m_dirs.count(); i++ )
@@ -428,12 +428,12 @@ DeviceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int wid
}
}
// Use a different color if this folder has an activated child folder
- if ( dirty ) _cg.setColor( QColorGroup::Text, Qt::blue );
- QCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align );
+ if ( dirty ) _cg.setColor( TQColorGroup::Text, TQt::blue );
+ TQCheckListItem::paintCell( p, isDisabled() ? listView()->palette().disabled() : _cg, column, width, align );
}
void
-DeviceItem::mountDevice( const QString & device)
+DeviceItem::mountDevice( const TQString & device)
{
if (!kapp->dcopClient()->isAttached())
@@ -442,9 +442,9 @@ DeviceItem::mountDevice( const QString & device)
//Set Up our DCOP Calls
- QStringList retVal;
- QCString mediacall="mediamanager";
- QCString devicecall="properties";
+ TQStringList retVal;
+ TQCString mediacall="mediamanager";
+ TQCString devicecall="properties";
if ( KDE::versionMajor() == 3 && KDE::versionMinor() < 4 )
{
mediacall="mountwatcher";