TQt4 port Filelight

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/filelight@1233561 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 3098eb9095
commit f0296ef9e1

@ -9,7 +9,7 @@
inline inline
HistoryAction::HistoryAction( const QString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name ) HistoryAction::HistoryAction( const TQString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name )
: KAction( text, icon, cut, 0, 0, ac, name ) : KAction( text, icon, cut, 0, 0, ac, name )
, m_text( text ) , m_text( text )
{ {
@ -18,7 +18,7 @@ HistoryAction::HistoryAction( const QString &text, const char *icon, const KShor
} }
void void
HistoryAction::push( const QString &path ) HistoryAction::push( const TQString &path )
{ {
if( !path.isEmpty() && m_list.last() != path ) if( !path.isEmpty() && m_list.last() != path )
{ {
@ -28,10 +28,10 @@ HistoryAction::push( const QString &path )
} }
} }
QString TQString
HistoryAction::pop() HistoryAction::pop()
{ {
const QString s = m_list.last(); const TQString s = m_list.last();
m_list.pop_back(); m_list.pop_back();
setActionMenuTextOnly( this, m_list.last() ); setActionMenuTextOnly( this, m_list.last() );
setEnabled(); setEnabled();
@ -40,14 +40,14 @@ HistoryAction::pop()
HistoryCollection::HistoryCollection( KActionCollection *ac, QObject *parent, const char *name ) HistoryCollection::HistoryCollection( KActionCollection *ac, TQObject *tqparent, const char *name )
: QObject( parent, name ) : TQObject( tqparent, name )
, m_b( new HistoryAction( i18n( "Back" ), "back", KStdAccel::back(), ac, "go_back" ) ) , m_b( new HistoryAction( i18n( "Back" ), "back", KStdAccel::back(), ac, "go_back" ) )
, m_f( new HistoryAction( i18n( "Forward" ), "forward", KStdAccel::forward(), ac, "go_forward" ) ) , m_f( new HistoryAction( i18n( "Forward" ), "forward", KStdAccel::forward(), ac, "go_forward" ) )
, m_receiver( 0 ) , m_receiver( 0 )
{ {
connect( m_b, SIGNAL(activated()), SLOT(pop()) ); connect( m_b, TQT_SIGNAL(activated()), TQT_SLOT(pop()) );
connect( m_f, SIGNAL(activated()), SLOT(pop()) ); connect( m_f, TQT_SIGNAL(activated()), TQT_SLOT(pop()) );
} }
void void
@ -70,7 +70,7 @@ void
HistoryCollection::pop() //slot HistoryCollection::pop() //slot
{ {
KURL url; KURL url;
const QString path = ((HistoryAction*)sender())->pop(); //FIXME here we remove the constness const TQString path = ((HistoryAction*)sender())->pop(); //FIXME here we remove the constness
url.setPath( path ); url.setPath( path );
m_receiver = (sender() == m_b) ? m_f : m_b; m_receiver = (sender() == m_b) ? m_f : m_b;

@ -6,18 +6,18 @@
#include <kaction.h> #include <kaction.h>
#include <kurl.h> #include <kurl.h>
#include <qstringlist.h> #include <tqstringlist.h>
class KConfig; class KConfig;
/// defined in mainWindow.cpp /// defined in mainWindow.cpp
void setActionMenuTextOnly( KAction *a, QString const &suffix ); void setActionMenuTextOnly( KAction *a, TQString const &suffix );
class HistoryAction : KAction class HistoryAction : KAction
{ {
HistoryAction( const QString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name ); HistoryAction( const TQString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name );
friend class HistoryCollection; friend class HistoryCollection;
@ -29,20 +29,21 @@ public:
private: private:
void setText(); void setText();
void push( const QString &path ); void push( const TQString &path );
QString pop(); TQString pop();
const QString m_text; const TQString m_text;
QStringList m_list; TQStringList m_list;
}; };
class HistoryCollection : public QObject class HistoryCollection : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
HistoryCollection( KActionCollection *ac, QObject *parent, const char *name ); HistoryCollection( KActionCollection *ac, TQObject *tqparent, const char *name );
void save( KConfig *config ); void save( KConfig *config );
void restore( KConfig *config ); void restore( KConfig *config );

@ -22,9 +22,9 @@
#include <ktoolbar.h> #include <ktoolbar.h>
#include <kurl.h> #include <kurl.h>
#include <kurlcompletion.h> //locationbar #include <kurlcompletion.h> //locationbar
#include <qobjectlist.h> #include <tqobjectlist.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <qtooltip.h> #include <tqtooltip.h>
@ -40,10 +40,10 @@ MainWindow::MainWindow()
KMessageBox::error( this, i18n("KDE could not find the Filelight Part, or the Filelight Part could not be started. Did you make install?") ); KMessageBox::error( this, i18n("KDE could not find the Filelight Part, or the Filelight Part could not be started. Did you make install?") );
//exit() seems to not exist inside the std namespace for some users! //exit() seems to not exist inside the std namespace for some users!
using namespace std; using namespace std;
exit( 1 ); //don't use QApplication::exit() - it causes a crash exit( 1 ); //don't use TQApplication::exit() - it causes a crash
} }
m_part = (Part *)factory->create( this, "part", "KParts::ReadOnlyPart" ); m_part = (Part *)factory->create( TQT_TQOBJECT(this), "part", "KParts::ReadOnlyPart" );
setCentralWidget( m_part->widget() ); setCentralWidget( m_part->widget() );
setStandardToolBarMenuEnabled( true ); setStandardToolBarMenuEnabled( true );
@ -52,18 +52,18 @@ MainWindow::MainWindow()
stateChanged( "scan_failed" ); //bah! doesn't affect the parts' actions, should I add them to the actionCollection here? stateChanged( "scan_failed" ); //bah! doesn't affect the parts' actions, should I add them to the actionCollection here?
QObjectList *buttons = toolBar()->queryList( "KToolBarButton" ); TQObjectList *buttons = toolBar()->queryList( "KToolBarButton" );
if (buttons->isEmpty()) if (buttons->isEmpty())
KMessageBox::error( this, i18n("Filelight is not installed properly, consequently its menus and toolbars will appear reduced or even empty") ); KMessageBox::error( this, i18n("Filelight is not installed properly, consequently its menus and toolbars will appear reduced or even empty") );
delete buttons; delete buttons;
connect( m_part, SIGNAL(started( KIO::Job* )), SLOT(scanStarted()) ); connect( m_part, TQT_SIGNAL(started( KIO::Job* )), TQT_SLOT(scanStarted()) );
connect( m_part, SIGNAL(completed()), SLOT(scanCompleted()) ); connect( m_part, TQT_SIGNAL(completed()), TQT_SLOT(scanCompleted()) );
connect( m_part, SIGNAL(canceled( const QString& )), SLOT(scanFailed()) ); connect( m_part, TQT_SIGNAL(canceled( const TQString& )), TQT_SLOT(scanFailed()) );
//TODO test these //TODO test these
connect( m_part, SIGNAL(canceled( const QString& )), m_histories, SLOT(stop()) ); connect( m_part, TQT_SIGNAL(canceled( const TQString& )), m_histories, TQT_SLOT(stop()) );
connect( BrowserExtension::childObject( m_part ), SIGNAL(openURLNotify()), SLOT(urlAboutToChange()) ); connect( BrowserExtension::childObject( m_part ), TQT_SIGNAL(openURLNotify()), TQT_SLOT(urlAboutToChange()) );
KConfig* const config = KGlobal::config(); KConfig* const config = KGlobal::config();
config->setGroup( "general" ); config->setGroup( "general" );
@ -79,39 +79,39 @@ MainWindow::setupActions() //singleton function
m_combo = new KHistoryCombo( this, "history_combo" ); m_combo = new KHistoryCombo( this, "history_combo" );
m_combo->setCompletionObject( new KURLCompletion( KURLCompletion::DirCompletion ) ); m_combo->setCompletionObject( new KURLCompletion( KURLCompletion::DirCompletion ) );
m_combo->setAutoDeleteCompletionObject( true ); m_combo->setAutoDeleteCompletionObject( true );
m_combo->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); m_combo->tqsetSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) );
m_combo->setDuplicatesEnabled( false ); m_combo->setDuplicatesEnabled( false );
KStdAction::open( this, SLOT(slotScanDirectory()), ac, "scan_directory" ); KStdAction::open( TQT_TQOBJECT(this), TQT_SLOT(slotScanDirectory()), ac, "scan_directory" );
KStdAction::quit( this, SLOT(close()), ac ); KStdAction::quit( TQT_TQOBJECT(this), TQT_SLOT(close()), ac );
KStdAction::up( this, SLOT(slotUp()), ac ); KStdAction::up( TQT_TQOBJECT(this), TQT_SLOT(slotUp()), ac );
KStdAction::configureToolbars(this, SLOT(configToolbars()), ac); KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configToolbars()), ac);
KStdAction::keyBindings(this, SLOT(configKeys()), ac); KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configKeys()), ac);
new KAction( i18n( "Scan &Home Directory" ), "folder_home", CTRL+Key_Home, this, SLOT(slotScanHomeDirectory()), ac, "scan_home" ); new KAction( i18n( "Scan &Home Directory" ), "folder_home", CTRL+Key_Home, TQT_TQOBJECT(this), TQT_SLOT(slotScanHomeDirectory()), ac, "scan_home" );
new KAction( i18n( "Scan &Root Directory" ), "folder_red", 0, this, SLOT(slotScanRootDirectory()), ac, "scan_root" ); new KAction( i18n( "Scan &Root Directory" ), "folder_red", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScanRootDirectory()), ac, "scan_root" );
new KAction( i18n( "Rescan" ), "reload", KStdAccel::reload(), m_part, SLOT(rescan()), ac, "scan_rescan" ); new KAction( i18n( "Rescan" ), "reload", KStdAccel::reload(), TQT_TQOBJECT(m_part), TQT_SLOT(rescan()), ac, "scan_rescan" );
new KAction( i18n( "Stop" ), "stop", Qt::Key_Escape, this, SLOT(slotAbortScan()), ac, "scan_stop" ); new KAction( i18n( "Stop" ), "stop", TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(slotAbortScan()), ac, "scan_stop" );
new KAction( i18n( "Clear Location Bar" ), KApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, m_combo, SLOT(clearEdit()), ac, "clear_location" ); new KAction( i18n( "Clear Location Bar" ), KApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, TQT_TQOBJECT(m_combo), TQT_SLOT(clearEdit()), ac, "clear_location" );
new KAction( i18n( "Go" ), "key_enter", 0, m_combo, SIGNAL(returnPressed()), ac, "go" ); new KAction( i18n( "Go" ), "key_enter", 0, TQT_TQOBJECT(m_combo), TQT_SIGNAL(returnPressed()), ac, "go" );
KWidgetAction *combo = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0, 0, 0, ac, "location_bar" ); KWidgetAction *combo = new KWidgetAction( m_combo, i18n( "Location Bar" ), 0, 0, 0, ac, "location_bar" );
m_recentScans = new KRecentFilesAction( i18n( "&Recent Scans" ), 0, ac, "scan_recent", 8 ); m_recentScans = new KRecentFilesAction( i18n( "&Recent Scans" ), 0, ac, "scan_recent", 8 );
m_histories = new HistoryCollection( ac, this, "history_collection" ); m_histories = new HistoryCollection( ac, TQT_TQOBJECT(this), "history_collection" );
ac->action( "scan_directory" )->setText( i18n( "&Scan Directory..." ) ); ac->action( "scan_directory" )->setText( i18n( "&Scan Directory..." ) );
m_recentScans->loadEntries( KGlobal::config() ); m_recentScans->loadEntries( KGlobal::config() );
combo->setAutoSized( true ); //FIXME what does this do? combo->setAutoSized( true ); //FIXME what does this do?
connect( m_recentScans, SIGNAL(urlSelected( const KURL& )), SLOT(slotScanUrl( const KURL& )) ); connect( m_recentScans, TQT_SIGNAL(urlSelected( const KURL& )), TQT_SLOT(slotScanUrl( const KURL& )) );
connect( m_combo, SIGNAL(returnPressed()), SLOT(slotComboScan()) ); connect( m_combo, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotComboScan()) );
connect( m_histories, SIGNAL(activated( const KURL& )), SLOT(slotScanUrl( const KURL& )) ); connect( m_histories, TQT_SIGNAL(activated( const KURL& )), TQT_SLOT(slotScanUrl( const KURL& )) );
} }
bool bool
MainWindow::queryExit() MainWindow::queryExit()
{ {
if( !m_part ) //apparently std::exit() still calls this function, and abort() causes a crash.. if( !m_part ) //aptqparently std::exit() still calls this function, and abort() causes a crash..
return true; return true;
KConfig* const config = KGlobal::config(); KConfig* const config = KGlobal::config();
@ -157,13 +157,13 @@ inline void MainWindow::slotUp() { slotScanUrl( m_part->url().upU
inline void inline void
MainWindow::slotComboScan() MainWindow::slotComboScan()
{ {
const QString path = KShell::tildeExpand(m_combo->lineEdit()->text()); const TQString path = KShell::tildeExpand(m_combo->lineEdit()->text());
if (slotScanPath( path )) if (slotScanPath( path ))
m_combo->addToHistory( path ); m_combo->addToHistory( path );
} }
inline bool inline bool
MainWindow::slotScanPath( const QString &path ) MainWindow::slotScanPath( const TQString &path )
{ {
return slotScanUrl( KURL::fromPathOrURL( path ) ); return slotScanUrl( KURL::fromPathOrURL( path ) );
} }
@ -198,7 +198,7 @@ inline void
MainWindow::scanFailed() MainWindow::scanFailed()
{ {
stateChanged( "scan_failed" ); stateChanged( "scan_failed" );
setActionMenuTextOnly( action( "go_up" ), QString::null ); setActionMenuTextOnly( action( "go_up" ), TQString() );
m_combo->lineEdit()->clear(); m_combo->lineEdit()->clear();
} }
@ -214,7 +214,7 @@ MainWindow::scanCompleted()
if ( url.path( 1 ) == "/") { if ( url.path( 1 ) == "/") {
goUp->setEnabled( false ); goUp->setEnabled( false );
setActionMenuTextOnly( goUp, QString() ); setActionMenuTextOnly( goUp, TQString() );
} }
else else
setActionMenuTextOnly( goUp, url.upURL().path( 1 ) ); setActionMenuTextOnly( goUp, url.upURL().path( 1 ) );
@ -247,7 +247,7 @@ void
MainWindow::readProperties( KConfig *config ) //virtual MainWindow::readProperties( KConfig *config ) //virtual
{ {
m_histories->restore( config ); m_histories->restore( config );
slotScanPath( config->readEntry( "currentMap", QString::null ) ); slotScanPath( config->readEntry( "currentMap", TQString() ) );
} }
} //namespace Filelight } //namespace Filelight
@ -256,23 +256,23 @@ MainWindow::readProperties( KConfig *config ) //virtual
/// declared in historyAction.h /// declared in historyAction.h
void setActionMenuTextOnly( KAction *a, QString const &suffix ) void setActionMenuTextOnly( KAction *a, TQString const &suffix )
{ {
QString const menu_text = suffix.isEmpty() TQString const menu_text = suffix.isEmpty()
? a->text() ? a->text()
: i18n( "&Up: /home/mxcl", "%1: %2" ).arg( a->text(), suffix ); : i18n( "&Up: /home/mxcl", "%1: %2" ).tqarg( a->text(), suffix );
for (int i = 0; i < a->containerCount(); ++i) { for (int i = 0; i < a->containerCount(); ++i) {
QWidget *w = a->container( i ); TQWidget *w = a->container( i );
int const id = a->itemId( i ); int const id = a->itemId( i );
if (w->inherits( "QPopupMenu" )) if (w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ))
static_cast<QPopupMenu*>(w)->changeItem( id, menu_text ); static_cast<TQPopupMenu*>(w)->changeItem( id, menu_text );
else if (w->inherits( "KToolBar" )) { else if (w->inherits( "KToolBar" )) {
QWidget *button = static_cast<KToolBar*>(w)->getWidget( id ); TQWidget *button = static_cast<KToolBar*>(w)->getWidget( id );
if (button->inherits( "KToolBarButton" )) if (button->inherits( "KToolBarButton" ))
QToolTip::add( button, suffix ); TQToolTip::add( button, suffix );
} }
} }
} }

@ -36,6 +36,7 @@ class Part;
class MainWindow : public KParts::MainWindow class MainWindow : public KParts::MainWindow
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
MainWindow(); MainWindow();
@ -49,7 +50,7 @@ class MainWindow : public KParts::MainWindow
void slotScanHomeDirectory(); void slotScanHomeDirectory();
void slotScanRootDirectory(); void slotScanRootDirectory();
bool slotScanUrl( const KURL& ); bool slotScanUrl( const KURL& );
bool slotScanPath( const QString& ); bool slotScanPath( const TQString& );
void slotAbortScan(); void slotAbortScan();
void configToolbars(); void configToolbars();

@ -14,7 +14,7 @@ uint Config::antiAliasFactor;
uint Config::minFontPitch; uint Config::minFontPitch;
uint Config::defaultRingDepth; uint Config::defaultRingDepth;
Filelight::MapScheme Config::scheme; Filelight::MapScheme Config::scheme;
QStringList Config::skipList; TQStringList Config::skipList;
inline KConfig& inline KConfig&
@ -37,7 +37,7 @@ Filelight::Config::read()
showSmallFiles = config.readBoolEntry( "showSmallFiles", false ); showSmallFiles = config.readBoolEntry( "showSmallFiles", false );
contrast = config.readNumEntry( "contrast", 75 ); contrast = config.readNumEntry( "contrast", 75 );
antiAliasFactor = config.readNumEntry( "antiAliasFactor", 2 ); antiAliasFactor = config.readNumEntry( "antiAliasFactor", 2 );
minFontPitch = config.readNumEntry( "minFontPitch", QFont().pointSize() - 3); minFontPitch = config.readNumEntry( "minFontPitch", TQFont().pointSize() - 3);
scheme = (MapScheme) config.readNumEntry( "scheme", 0 ); scheme = (MapScheme) config.readNumEntry( "scheme", 0 );
skipList = config.readPathListEntry( "skipList" ); skipList = config.readPathListEntry( "skipList" );

@ -2,7 +2,7 @@
#ifndef Config_H #ifndef Config_H
#define Config_H #define Config_H
#include <qstringlist.h> #include <tqstringlist.h>
class KConfig; class KConfig;
@ -32,7 +32,7 @@ namespace Filelight
static uint defaultRingDepth; static uint defaultRingDepth;
static MapScheme scheme; static MapScheme scheme;
static QStringList skipList; static TQStringList skipList;
}; };
} }

@ -1,10 +1,10 @@
<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <!DOCTYPE UI><UI version="3.2" stdsetdef="1">
<class>Dialog</class> <class>Dialog</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>Dialog</cstring> <cstring>Dialog</cstring>
</property> </property>
<property name="geometry"> <property name="tqgeometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -19,14 +19,14 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QTabWidget"> <widget class="TQTabWidget">
<property name="name"> <property name="name">
<cstring>tabWidget</cstring> <cstring>tabWidget</cstring>
</property> </property>
<property name="acceptDrops"> <property name="acceptDrops">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Widget2</cstring> <cstring>Widget2</cstring>
</property> </property>
@ -37,7 +37,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -59,7 +59,7 @@
<cstring>m_listBox</cstring> <cstring>m_listBox</cstring>
</property> </property>
</widget> </widget>
<widget class="QListBox"> <widget class="TQListBox">
<property name="name"> <property name="name">
<cstring>m_listBox</cstring> <cstring>m_listBox</cstring>
</property> </property>
@ -70,9 +70,9 @@
<string>Filelight will not scan these directories unless you specifically request them.</string> <string>Filelight will not scan these directories unless you specifically request them.</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout4</cstring> <cstring>tqlayout4</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -88,14 +88,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>180</width> <width>180</width>
<height>21</height> <height>21</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>m_removeButton</cstring> <cstring>m_removeButton</cstring>
</property> </property>
@ -109,7 +109,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>m_addButton</cstring> <cstring>m_addButton</cstring>
</property> </property>
@ -129,7 +129,7 @@
<property name="name"> <property name="name">
<cstring>line1</cstring> <cstring>line1</cstring>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>15</height> <height>15</height>
@ -151,9 +151,9 @@
<enum>Horizontal</enum> <enum>Horizontal</enum>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout7</cstring> <cstring>tqlayout7</cstring>
</property> </property>
<grid> <grid>
<property name="name"> <property name="name">
@ -169,27 +169,27 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>16</width> <width>16</width>
<height>50</height> <height>50</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="1" column="1"> <widget class="TQCheckBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>dontScanRemoteMounts</cstring> <cstring>dontScanRemoteMounts</cstring>
</property> </property>
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>0</height> <height>0</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>32767</width> <width>32767</width>
<height>32767</height> <height>32767</height>
@ -208,7 +208,7 @@
<string>Prevents scanning of filesystems that are not on this computer, e.g. NFS or Samba mounts.</string> <string>Prevents scanning of filesystems that are not on this computer, e.g. NFS or Samba mounts.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>scanAcrossMounts</cstring> <cstring>scanAcrossMounts</cstring>
</property> </property>
@ -219,7 +219,7 @@
<string>Allows scans to enter directories that are part of other filesystems. For example, when unchecked, this will usually prevent the contents of &lt;b&gt;/mnt&lt;/b&gt; from being scanned if you scan &lt;b&gt;/&lt;/b&gt;.</string> <string>Allows scans to enter directories that are part of other filesystems. For example, when unchecked, this will usually prevent the contents of &lt;b&gt;/mnt&lt;/b&gt; from being scanned if you scan &lt;b&gt;/&lt;/b&gt;.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="2" column="1"> <widget class="TQCheckBox" row="2" column="1">
<property name="name"> <property name="name">
<cstring>dontScanRemovableMedia</cstring> <cstring>dontScanRemovableMedia</cstring>
</property> </property>
@ -240,7 +240,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>Widget3</cstring> <cstring>Widget3</cstring>
</property> </property>
@ -251,7 +251,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QGroupBox"> <widget class="TQGroupBox">
<property name="name"> <property name="name">
<cstring>groupBox1</cstring> <cstring>groupBox1</cstring>
</property> </property>
@ -262,7 +262,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QVButtonGroup"> <widget class="TQVButtonGroup">
<property name="name"> <property name="name">
<cstring>colourSchemeGroup</cstring> <cstring>colourSchemeGroup</cstring>
</property> </property>
@ -275,15 +275,15 @@
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout10</cstring> <cstring>tqlayout10</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel3</cstring> <cstring>textLabel3</cstring>
</property> </property>
@ -297,7 +297,7 @@
<cstring>contrastSlider</cstring> <cstring>contrastSlider</cstring>
</property> </property>
</widget> </widget>
<widget class="QSlider"> <widget class="TQSlider">
<property name="name"> <property name="name">
<cstring>contrastSlider</cstring> <cstring>contrastSlider</cstring>
</property> </property>
@ -318,7 +318,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QCheckBox"> <widget class="TQCheckBox">
<property name="name"> <property name="name">
<cstring>useAntialiasing</cstring> <cstring>useAntialiasing</cstring>
</property> </property>
@ -329,9 +329,9 @@
<string>Anti-aliasing the filemap makes it clearer and prettier, unfortunately it also makes rendering very slow.</string> <string>Anti-aliasing the filemap makes it clearer and prettier, unfortunately it also makes rendering very slow.</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout10</cstring> <cstring>tqlayout10</cstring>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
@ -340,7 +340,7 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QCheckBox"> <widget class="TQCheckBox">
<property name="name"> <property name="name">
<cstring>varyLabelFontSizes</cstring> <cstring>varyLabelFontSizes</cstring>
</property> </property>
@ -354,9 +354,9 @@
<string>The font size of exploded labels can be varied relative to the depth of the directories they represent. This helps you spot the important labels more easily. Set a sensible minimum font size.</string> <string>The font size of exploded labels can be varied relative to the depth of the directories they represent. This helps you spot the important labels more easily. Set a sensible minimum font size.</string>
</property> </property>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout9</cstring> <cstring>tqlayout9</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
@ -372,14 +372,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Fixed</enum> <enum>Fixed</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLabel"> <widget class="TQLabel">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -414,7 +414,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>0</height> <height>0</height>
@ -434,7 +434,7 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QCheckBox"> <widget class="TQCheckBox">
<property name="name"> <property name="name">
<cstring>showSmallFiles</cstring> <cstring>showSmallFiles</cstring>
</property> </property>
@ -448,15 +448,15 @@
</vbox> </vbox>
</widget> </widget>
</widget> </widget>
<widget class="QLayoutWidget"> <widget class="TQLayoutWidget">
<property name="name"> <property name="name">
<cstring>layout6</cstring> <cstring>tqlayout6</cstring>
</property> </property>
<hbox> <hbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>m_resetButton</cstring> <cstring>m_resetButton</cstring>
</property> </property>
@ -480,14 +480,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>120</width> <width>120</width>
<height>30</height> <height>30</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QPushButton"> <widget class="TQPushButton">
<property name="name"> <property name="name">
<cstring>m_closeButton</cstring> <cstring>m_closeButton</cstring>
</property> </property>
@ -504,8 +504,8 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>QVButtonGroup</class> <class>TQVButtonGroup</class>
<header location="global">qvbuttongroup.h</header> <header location="global">tqvbuttongroup.h</header>
<sizehint> <sizehint>
<width>-1</width> <width>-1</width>
<height>-1</height> <height>-1</height>
@ -561,14 +561,14 @@
<tabstop>dontScanRemoteMounts</tabstop> <tabstop>dontScanRemoteMounts</tabstop>
<tabstop>dontScanRemovableMedia</tabstop> <tabstop>dontScanRemovableMedia</tabstop>
</tabstops> </tabstops>
<slots> <Q_SLOTS>
<slot>toggleDontScanRemovableMedia(bool)</slot> <slot>toggleDontScanRemovableMedia(bool)</slot>
<slot>toggleDontScanRemoteMounts(bool)</slot> <slot>toggleDontScanRemoteMounts(bool)</slot>
<slot>toggleScanAcrossMounts(bool)</slot> <slot>toggleScanAcrossMounts(bool)</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>qvbuttongroup.h</includehint> <includehint>tqvbuttongroup.h</includehint>
<includehint>knuminput.h</includehint> <includehint>knuminput.h</includehint>
</includehints> </includehints>
</UI> </UI>

@ -4,7 +4,7 @@
#include "fileTree.h" #include "fileTree.h"
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
#include <qfile.h> #include <tqfile.h>
//static definitions //static definitions
@ -12,33 +12,33 @@ const uint File::DENOMINATOR[4] = { 1<<0, 1<<10, 1<<20, 1<<30 };
static const char PREFIX[4] = { 'K', 'M', 'G', 'T' }; static const char PREFIX[4] = { 'K', 'M', 'G', 'T' };
QString TQString
File::fullPath( const Directory *root /*= 0*/ ) const File::fullPath( const Directory *root /*= 0*/ ) const
{ {
QString path; TQString path;
if( root == this ) if( root == this )
root = 0; //prevent returning empty string when there is something we could return root = 0; //prevent returning empty string when there is something we could return
for( const Directory *d = (Directory*)this; d != root && d; d = d->parent() ) for( const Directory *d = (Directory*)this; d != root && d; d = d->tqparent() )
path.prepend( d->name() ); path.prepend( d->name() );
return path; return path;
} }
QString TQString
File::humanReadableSize( UnitPrefix key /*= mega*/ ) const //FIXME inline File::humanReadableSize( UnitPrefix key /*= mega*/ ) const //FIXME inline
{ {
return humanReadableSize( m_size, key ); return humanReadableSize( m_size, key );
} }
QString TQString
File::humanReadableSize( uint size, UnitPrefix key /*= mega*/ ) //static File::humanReadableSize( uint size, UnitPrefix key /*= mega*/ ) //static
{ {
if( size == 0 ) if( size == 0 )
return "0 B"; return "0 B";
QString s; TQString s;
double prettySize = (double)size / (double)DENOMINATOR[key]; double prettySize = (double)size / (double)DENOMINATOR[key];
const KLocale &locale = *KGlobal::locale(); const KLocale &locale = *KGlobal::locale();

@ -4,8 +4,8 @@
#ifndef FILETREE_H #ifndef FILETREE_H
#define FILETREE_H #define FILETREE_H
#include <qcstring.h> //qstrdup #include <tqcstring.h> //qstrdup
#include <qfile.h> //decodeName() #include <tqfile.h> //decodeName()
#include <stdlib.h> #include <stdlib.h>
@ -153,7 +153,7 @@ private:
class Directory; class Directory;
class QString; class TQString;
class File class File
{ {
@ -168,21 +168,21 @@ public:
File( const char *name, FileSize size ) : m_parent( 0 ), m_name( qstrdup( name ) ), m_size( size ) {} File( const char *name, FileSize size ) : m_parent( 0 ), m_name( qstrdup( name ) ), m_size( size ) {}
virtual ~File() { delete [] m_name; } virtual ~File() { delete [] m_name; }
const Directory *parent() const { return m_parent; } const Directory *tqparent() const { return m_parent; }
const char *name8Bit() const { return m_name; } const char *name8Bit() const { return m_name; }
const FileSize size() const { return m_size; } const FileSize size() const { return m_size; }
QString name() const { return QFile::decodeName( m_name ); } TQString name() const { return TQFile::decodeName( m_name ); }
virtual bool isDirectory() const { return false; } virtual bool isDirectory() const { return false; }
QString fullPath( const Directory* = 0 ) const; TQString fullPath( const Directory* = 0 ) const;
QString humanReadableSize( UnitPrefix key = mega ) const; TQString humanReadableSize( UnitPrefix key = mega ) const;
public: public:
static QString humanReadableSize( uint size, UnitPrefix Key = mega ); static TQString humanReadableSize( uint size, UnitPrefix Key = mega );
protected: protected:
File( const char *name, FileSize size, Directory *parent ) : m_parent( parent ), m_name( qstrdup( name ) ), m_size( size ) {} File( const char *name, FileSize size, Directory *tqparent ) : m_parent( tqparent ), m_name( qstrdup( name ) ), m_size( size ) {}
Directory *m_parent; //0 if this is treeRoot Directory *m_parent; //0 if this is treeRoot
char *m_name; char *m_name;
@ -197,9 +197,9 @@ private:
class Directory : public Chain<File>, public File class Directory : public Chain<File>, public File
{ {
public: public:
Directory( const char *name ) : File( name, 0 ), m_children( 0 ) {} //DON'T pass the full path! Directory( const char *name ) : File( name, 0 ), m_tqchildren( 0 ) {} //DON'T pass the full path!
uint children() const { return m_children; } uint tqchildren() const { return m_tqchildren; }
virtual bool isDirectory() const { return true; } virtual bool isDirectory() const { return true; }
///appends a Directory ///appends a Directory
@ -209,7 +209,7 @@ public:
delete [] d->m_name; delete [] d->m_name;
d->m_name = qstrdup( name ); } //directories that had a fullpath copy just their names this way d->m_name = qstrdup( name ); } //directories that had a fullpath copy just their names this way
m_children += d->children(); //doesn't include the dir itself m_tqchildren += d->tqchildren(); //doesn't include the dir itself
d->m_parent = this; d->m_parent = this;
append( (File*)d ); //will add 1 to filecount for the dir itself append( (File*)d ); //will add 1 to filecount for the dir itself
} }
@ -223,12 +223,12 @@ public:
private: private:
void append( File *p ) void append( File *p )
{ {
m_children++; m_tqchildren++;
m_size += p->size(); m_size += p->size();
Chain<File>::append( p ); Chain<File>::append( p );
} }
uint m_children; uint m_tqchildren;
private: private:
Directory( const Directory& ); //undefined Directory( const Directory& ); //undefined

@ -10,8 +10,8 @@
#ifdef HAVE_MNTENT_H #ifdef HAVE_MNTENT_H
#include <mntent.h> #include <mntent.h>
#endif #endif
#include <qapplication.h> //postEvent() #include <tqapplication.h> //postEvent()
#include <qfile.h> #include <tqfile.h>
#include "scan.h" #include "scan.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h> #include <sys/types.h>
@ -19,23 +19,23 @@
namespace Filelight namespace Filelight
{ {
QStringList LocalLister::s_remoteMounts; TQStringList LocalLister::s_remoteMounts;
QStringList LocalLister::s_localMounts; TQStringList LocalLister::s_localMounts;
LocalLister::LocalLister( const QString &path, Chain<Directory> *cachedTrees, QObject *parent ) LocalLister::LocalLister( const TQString &path, Chain<Directory> *cachedTrees, TQObject *tqparent )
: QThread() : TQThread()
, m_path( path ) , m_path( path )
, m_trees( cachedTrees ) , m_trees( cachedTrees )
, m_parent( parent ) , m_parent( tqparent )
{ {
//add empty directories for any mount points that are in the path //add empty directories for any mount points that are in the path
//TODO empty directories is not ideal as adds to fileCount incorrectly //TODO empty directories is not ideal as adds to fileCount incorrectly
QStringList list( Config::skipList ); TQStringList list( Config::skipList );
if( !Config::scanAcrossMounts ) list += s_localMounts; if( !Config::scanAcrossMounts ) list += s_localMounts;
if( !Config::scanRemoteMounts ) list += s_remoteMounts; if( !Config::scanRemoteMounts ) list += s_remoteMounts;
for( QStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it ) for( TQStringList::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it )
if( (*it).startsWith( path ) ) if( (*it).startsWith( path ) )
//prevent scanning of these directories //prevent scanning of these directories
m_trees->append( new Directory( (*it).local8Bit() ) ); m_trees->append( new Directory( (*it).local8Bit() ) );
@ -47,7 +47,7 @@ namespace Filelight
LocalLister::run() LocalLister::run()
{ {
//recursively scan the requested path //recursively scan the requested path
const QCString path = QFile::encodeName( m_path ); const TQCString path = TQFile::encodeName( m_path );
Directory *tree = scan( path, path ); Directory *tree = scan( path, path );
//delete the list of trees useful for this scan, //delete the list of trees useful for this scan,
@ -61,9 +61,9 @@ namespace Filelight
tree = 0; tree = 0;
} }
QCustomEvent *e = new QCustomEvent( 1000 ); TQCustomEvent *e = new TQCustomEvent( 1000 );
e->setData( tree ); e->setData( tree );
QApplication::postEvent( m_parent, e ); TQApplication::postEvent( m_parent, e );
} }
// from system.h in GNU coreutils package // from system.h in GNU coreutils package
@ -127,7 +127,7 @@ namespace Filelight
#include <errno.h> #include <errno.h>
static void static void
outputError( QCString path ) outputError( TQCString path )
{ {
///show error message that stat or opendir may give ///show error message that stat or opendir may give
@ -160,7 +160,7 @@ namespace Filelight
} }
Directory* Directory*
LocalLister::scan( const QCString &path, const QCString &dirname ) LocalLister::scan( const TQCString &path, const TQCString &dirname )
{ {
Directory *cwd = new Directory( dirname ); Directory *cwd = new Directory( dirname );
DIR *dir = opendir( path ); DIR *dir = opendir( path );
@ -180,7 +180,7 @@ namespace Filelight
if( qstrcmp( ent->d_name, "." ) == 0 || qstrcmp( ent->d_name, ".." ) == 0 ) if( qstrcmp( ent->d_name, "." ) == 0 || qstrcmp( ent->d_name, ".." ) == 0 )
continue; continue;
QCString new_path = path; new_path += ent->d_name; TQCString new_path = path; new_path += ent->d_name;
//get file information //get file information
if( lstat( new_path, &statbuf ) == -1 ) { if( lstat( new_path, &statbuf ) == -1 ) {
@ -204,7 +204,7 @@ namespace Filelight
else if( S_ISDIR( statbuf.st_mode ) ) //directory else if( S_ISDIR( statbuf.st_mode ) ) //directory
{ {
Directory *d = 0; Directory *d = 0;
QCString new_dirname = ent->d_name; TQCString new_dirname = ent->d_name;
new_dirname += '/'; new_dirname += '/';
new_path += '/'; new_path += '/';
@ -216,7 +216,7 @@ namespace Filelight
{ {
debug() << "Tree pre-completed: " << (*it)->name() << "\n"; debug() << "Tree pre-completed: " << (*it)->name() << "\n";
d = it.remove(); d = it.remove();
ScanManager::s_files += d->children(); ScanManager::s_files += d->tqchildren();
//**** ideally don't have this redundant extra somehow //**** ideally don't have this redundant extra somehow
cwd->append( d, new_dirname ); cwd->append( d, new_dirname );
} }
@ -251,7 +251,7 @@ namespace Filelight
#ifdef HAVE_MNTENT_H #ifdef HAVE_MNTENT_H
struct mntent *mnt_ent; struct mntent *mnt_ent;
#endif #endif
QString str; TQString str;
#ifdef HAVE_MNTENT_H #ifdef HAVE_MNTENT_H
@ -267,7 +267,7 @@ namespace Filelight
#define FS_TYPE fstab_ent->fs_vfstype // fs-type #define FS_TYPE fstab_ent->fs_vfstype // fs-type
#define FS_MNTOPS fstab_ent->fs_mntops // mount-options #define FS_MNTOPS fstab_ent->fs_mntops // mount-options
QStringList remoteFsTypes; TQStringList remoteFsTypes;
remoteFsTypes << "smbfs" ; remoteFsTypes << "smbfs" ;
#ifdef MNTTYPE_NFS #ifdef MNTTYPE_NFS
remoteFsTypes << MNTTYPE_NFS; remoteFsTypes << MNTTYPE_NFS;
@ -278,11 +278,11 @@ namespace Filelight
while( (fstab_ent = getfsent()) != NULL ) while( (fstab_ent = getfsent()) != NULL )
{ {
str = QString( FS_FILE ); str = TQString( FS_FILE );
if( str == "/" ) continue; if( str == "/" ) continue;
str += '/'; str += '/';
if( remoteFsTypes.contains( FS_TYPE ) ) if( remoteFsTypes.tqcontains( FS_TYPE ) )
s_remoteMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!! s_remoteMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!!
else else
@ -310,15 +310,15 @@ namespace Filelight
{ {
bool b = false; bool b = false;
str = QString( FS_FILE ); str = TQString( FS_FILE );
if( str == "/" ) continue; if( str == "/" ) continue;
str += "/"; str += "/";
if( remoteFsTypes.contains( FS_TYPE ) ) if( remoteFsTypes.tqcontains( FS_TYPE ) )
if( b = !s_remoteMounts.contains( str ) ) if( b = !s_remoteMounts.tqcontains( str ) )
s_remoteMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!! s_remoteMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!!
else if( b = !s_localMounts.contains( str ) ) else if( b = !s_localMounts.tqcontains( str ) )
s_localMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!! s_localMounts.append( str ); //**** NO! can't be sure won't have trailing slash, need to do a check first dummy!!
if( b ) kdDebug() << "MTAB: " << FS_TYPE << "\n"; if( b ) kdDebug() << "MTAB: " << FS_TYPE << "\n";

@ -4,31 +4,31 @@
#ifndef LOCALLISTER_H #ifndef LOCALLISTER_H
#define LOCALLISTER_H #define LOCALLISTER_H
#include <qthread.h> #include <tqthread.h>
class Directory; class Directory;
template<class T> class Chain; template<class T> class Chain;
namespace Filelight namespace Filelight
{ {
class LocalLister : public QThread class LocalLister : public TQThread
{ {
public: public:
LocalLister( const QString &path, Chain<Directory> *cachedTrees, QObject *parent ); LocalLister( const TQString &path, Chain<Directory> *cachedTrees, TQObject *tqparent );
static bool readMounts(); static bool readMounts();
private: private:
QString m_path; TQString m_path;
Chain<Directory> *m_trees; Chain<Directory> *m_trees;
QObject *m_parent; TQObject *m_parent;
private: private:
virtual void run(); virtual void run();
Directory *scan( const QCString&, const QCString& ); Directory *scan( const TQCString&, const TQCString& );
private: private:
static QStringList s_localMounts, s_remoteMounts; //TODO namespace static TQStringList s_localMounts, s_remoteMounts; //TODO namespace
}; };
} }

@ -20,9 +20,9 @@
#include <kparts/genericfactory.h> #include <kparts/genericfactory.h>
#include <kstatusbar.h> #include <kstatusbar.h>
#include <kstdaction.h> #include <kstdaction.h>
#include <qfile.h> //encodeName() #include <tqfile.h> //encodeName()
#include <qtimer.h> //postInit() hack #include <tqtimer.h> //postInit() hack
#include <qvbox.h> #include <tqvbox.h>
#include <unistd.h> //access() #include <unistd.h> //access()
@ -33,46 +33,46 @@ typedef KParts::GenericFactory<Filelight::Part> Factory;
K_EXPORT_COMPONENT_FACTORY( libfilelight, Filelight::Factory ) K_EXPORT_COMPONENT_FACTORY( libfilelight, Filelight::Factory )
BrowserExtension::BrowserExtension( Part *parent, const char *name ) BrowserExtension::BrowserExtension( Part *tqparent, const char *name )
: KParts::BrowserExtension( parent, name ) : KParts::BrowserExtension( tqparent, name )
{} {}
Part::Part( QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, const QStringList& ) Part::Part( TQWidget *tqparentWidget, const char *widgetName, TQObject *tqparent, const char *name, const TQStringList& )
: ReadOnlyPart( parent, name ) : ReadOnlyPart( tqparent, name )
, m_ext( new BrowserExtension( this ) ) , m_ext( new BrowserExtension( this ) )
, m_statusbar( new StatusBarExtension( this ) ) , m_statusbar( new StatusBarExtension( this ) )
, m_map( 0 ) , m_map( 0 )
, m_manager( new ScanManager( this ) ) , m_manager( new ScanManager( this ) )
, m_started( false ) , m_started( false )
{ {
QPixmap::setDefaultOptimization( QPixmap::BestOptim ); TQPixmap::setDefaultOptimization( TQPixmap::BestOptim );
Config::read(); Config::read();
setInstance( Factory::instance() ); setInstance( Factory::instance() );
setWidget( new QVBox( parentWidget, widgetName ) ); setWidget( new TQVBox( tqparentWidget, widgetName ) );
setXMLFile( "filelight_partui.rc" ); setXMLFile( "filelight_partui.rc" );
m_map = new RadialMap::Widget( widget() ); m_map = new RadialMap::Widget( widget() );
m_map->hide(); m_map->hide();
KStdAction::zoomIn( m_map, SLOT(zoomIn()), actionCollection() ); KStdAction::zoomIn( TQT_TQOBJECT(m_map), TQT_SLOT(zoomIn()), actionCollection() );
KStdAction::zoomOut( m_map, SLOT(zoomOut()), actionCollection() ); KStdAction::zoomOut( TQT_TQOBJECT(m_map), TQT_SLOT(zoomOut()), actionCollection() );
KStdAction::preferences( this, SLOT(configFilelight()), actionCollection(), "configure_filelight" )->setText( i18n( "Configure Filelight..." ) ); KStdAction::preferences( this, TQT_SLOT(configFilelight()), actionCollection(), "configure_filelight" )->setText( i18n( "Configure Filelight..." ) );
connect( m_map, SIGNAL(created( const Directory* )), SIGNAL(completed()) ); connect( m_map, TQT_SIGNAL(created( const Directory* )), TQT_SIGNAL(completed()) );
connect( m_map, SIGNAL(created( const Directory* )), SLOT(mapChanged( const Directory* )) ); connect( m_map, TQT_SIGNAL(created( const Directory* )), TQT_SLOT(mapChanged( const Directory* )) );
connect( m_map, SIGNAL(activated( const KURL& )), SLOT(updateURL( const KURL& )) ); connect( m_map, TQT_SIGNAL(activated( const KURL& )), TQT_SLOT(updateURL( const KURL& )) );
// TODO make better system // TODO make better system
connect( m_map, SIGNAL(giveMeTreeFor( const KURL& )), SLOT(updateURL( const KURL& )) ); connect( m_map, TQT_SIGNAL(giveMeTreeFor( const KURL& )), TQT_SLOT(updateURL( const KURL& )) );
connect( m_map, SIGNAL(giveMeTreeFor( const KURL& )), SLOT(openURL( const KURL& )) ); connect( m_map, TQT_SIGNAL(giveMeTreeFor( const KURL& )), TQT_SLOT(openURL( const KURL& )) );
connect( m_manager, SIGNAL(completed( Directory* )), SLOT(scanCompleted( Directory* )) ); connect( m_manager, TQT_SIGNAL(completed( Directory* )), TQT_SLOT(scanCompleted( Directory* )) );
connect( m_manager, SIGNAL(aboutToEmptyCache()), m_map, SLOT(invalidate()) ); connect( m_manager, TQT_SIGNAL(aboutToEmptyCache()), m_map, TQT_SLOT(tqinvalidate()) );
QTimer::singleShot( 0, this, SLOT(postInit()) ); TQTimer::singleShot( 0, this, TQT_SLOT(postInit()) );
} }
void void
@ -80,8 +80,8 @@ Part::postInit()
{ {
if( m_url.isEmpty() ) //if url is not empty openURL() has been called immediately after ctor, which happens if( m_url.isEmpty() ) //if url is not empty openURL() has been called immediately after ctor, which happens
{ {
QWidget *summary = new SummaryWidget( widget(), "summaryWidget" ); TQWidget *summary = new SummaryWidget( widget(), "summaryWidget" );
connect( summary, SIGNAL(activated( const KURL& )), SLOT(openURL( const KURL& )) ); connect( summary, TQT_SIGNAL(activated( const KURL& )), TQT_SLOT(openURL( const KURL& )) );
summary->show(); summary->show();
//FIXME KXMLGUI is b0rked, it should allow us to set this //FIXME KXMLGUI is b0rked, it should allow us to set this
@ -99,14 +99,14 @@ Part::openURL( const KURL &u )
//TODO everyone hates dialogs, instead render the text in big fonts on the Map //TODO everyone hates dialogs, instead render the text in big fonts on the Map
//TODO should have an empty KURL until scan is confirmed successful //TODO should have an empty KURL until scan is confirmed successful
//TODO probably should set caption to QString::null while map is unusable //TODO probably should set caption to TQString() while map is unusable
#define KMSG( s ) KMessageBox::information( widget(), s ) #define KMSG( s ) KMessageBox::information( widget(), s )
KURL url = u; KURL url = u;
url.cleanPath( true ); url.cleanPath( true );
const QString path = url.path( 1 ); const TQString path = url.path( 1 );
const QCString path8bit = QFile::encodeName( path ); const TQCString path8bit = TQFile::encodeName( path );
const bool isLocal = url.protocol() == "file"; const bool isLocal = url.protocol() == "file";
if( url.isEmpty() ) if( url.isEmpty() )
@ -119,15 +119,15 @@ Part::openURL( const KURL &u )
} }
else if( path[0] != '/' ) else if( path[0] != '/' )
{ {
KMSG( i18n( "Filelight only accepts absolute paths, eg. /%1" ).arg( path ) ); KMSG( i18n( "Filelight only accepts absolute paths, eg. /%1" ).tqarg( path ) );
} }
else if( isLocal && access( path8bit, F_OK ) != 0 ) //stat( path, &statbuf ) == 0 else if( isLocal && access( path8bit, F_OK ) != 0 ) //stat( path, &statbuf ) == 0
{ {
KMSG( i18n( "Directory not found: %1" ).arg( path ) ); KMSG( i18n( "Directory not found: %1" ).tqarg( path ) );
} }
else if( isLocal && access( path8bit, R_OK | X_OK ) != 0 ) else if( isLocal && access( path8bit, R_OK | X_OK ) != 0 )
{ {
KMSG( i18n( "Unable to enter: %1\nYou do not have access rights to this location." ).arg( path ) ); KMSG( i18n( "Unable to enter: %1\nYou do not have access rights to this location." ).tqarg( path ) );
} }
else else
{ {
@ -165,10 +165,10 @@ Part::updateURL( const KURL &u )
void void
Part::configFilelight() Part::configFilelight()
{ {
QWidget *dialog = new SettingsDialog( widget(), "settings_dialog" ); TQWidget *dialog = new SettingsDialog( widget(), "settings_dialog" );
connect( dialog, SIGNAL(canvasIsDirty( int )), m_map, SLOT(refresh( int )) ); connect( dialog, TQT_SIGNAL(canvasIsDirty( int )), m_map, TQT_SLOT(refresh( int )) );
connect( dialog, SIGNAL(mapIsInvalid()), m_manager, SLOT(emptyCache()) ); connect( dialog, TQT_SIGNAL(mapIsInvalid()), m_manager, TQT_SLOT(emptyCache()) );
dialog->show(); //deletes itself dialog->show(); //deletes itself
} }
@ -184,20 +184,20 @@ Part::start( const KURL &url )
{ {
if( !m_started ) { if( !m_started ) {
m_statusbar->addStatusBarItem( new ProgressBox( statusBar(), this ), 0, true ); m_statusbar->addStatusBarItem( new ProgressBox( statusBar(), this ), 0, true );
connect( m_map, SIGNAL(mouseHover( const QString& )), statusBar(), SLOT(message( const QString& )) ); connect( m_map, TQT_SIGNAL(mouseHover( const TQString& )), statusBar(), TQT_SLOT(message( const TQString& )) );
connect( m_map, SIGNAL(created( const Directory* )), statusBar(), SLOT(clear()) ); connect( m_map, TQT_SIGNAL(created( const Directory* )), statusBar(), TQT_SLOT(clear()) );
m_started = true; m_started = true;
} }
if( m_manager->start( url ) ) { if( m_manager->start( url ) ) {
m_url = url; m_url = url;
const QString s = i18n( "Scanning: %1" ).arg( prettyURL() ); const TQString s = i18n( "Scanning: %1" ).tqarg( prettyURL() );
stateChanged( "scan_started" ); stateChanged( "scan_started" );
emit started( 0 ); //as a Part, we have to do this emit started( 0 ); //as a Part, we have to do this
emit setWindowCaption( s ); emit setWindowCaption( s );
statusBar()->message( s ); statusBar()->message( s );
m_map->invalidate(); //to maintain ui consistency m_map->tqinvalidate(); //to maintain ui consistency
return true; return true;
} }
@ -209,7 +209,7 @@ void
Part::rescan() Part::rescan()
{ {
//FIXME we have to empty the cache because otherwise rescan picks up the old tree.. //FIXME we have to empty the cache because otherwise rescan picks up the old tree..
m_manager->emptyCache(); //causes canvas to invalidate m_manager->emptyCache(); //causes canvas to tqinvalidate
start( m_url ); start( m_url );
} }
@ -226,11 +226,11 @@ Part::scanCompleted( Directory *tree )
} }
else { else {
stateChanged( "scan_failed" ); stateChanged( "scan_failed" );
emit canceled( i18n( "Scan failed: %1" ).arg( prettyURL() ) ); emit canceled( i18n( "Scan failed: %1" ).tqarg( prettyURL() ) );
emit setWindowCaption( QString::null ); emit setWindowCaption( TQString() );
statusBar()->clear(); statusBar()->clear();
// QTimer::singleShot( 2000, statusBar(), SLOT(clear()) ); // TQTimer::singleShot( 2000, statusBar(), TQT_SLOT(clear()) );
m_url = KURL(); m_url = KURL();
} }
@ -243,10 +243,10 @@ Part::mapChanged( const Directory *tree )
emit setWindowCaption( prettyURL() ); emit setWindowCaption( prettyURL() );
ProgressBox *progress = static_cast<ProgressBox *>(statusBar()->child( "ProgressBox" )); ProgressBox *progress = static_cast<ProgressBox *>(TQT_TQWIDGET(statusBar()->child( "ProgressBox" )));
if( progress ) if( progress )
progress->setText( tree->children() ); progress->setText( tree->tqchildren() );
} }
} //namespace Filelight } //namespace Filelight

@ -29,14 +29,15 @@ namespace Filelight
class Part : public KParts::ReadOnlyPart class Part : public KParts::ReadOnlyPart
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Part( QWidget *, const char *, QObject *, const char *, const QStringList& ); Part( TQWidget *, const char *, TQObject *, const char *, const TQStringList& );
virtual bool openFile() { return false; } //pure virtual in base class virtual bool openFile() { return false; } //pure virtual in base class
virtual bool closeURL(); virtual bool closeURL();
QString prettyURL() const { return m_url.protocol() == "file" ? m_url.path() : m_url.prettyURL(); } TQString prettyURL() const { return m_url.protocol() == "file" ? m_url.path() : m_url.prettyURL(); }
static KAboutData *createAboutData(); static KAboutData *createAboutData();

@ -10,22 +10,22 @@
#include "progressBox.h" #include "progressBox.h"
ProgressBox::ProgressBox( QWidget *parent, QObject *part ) ProgressBox::ProgressBox( TQWidget *tqparent, TQObject *part )
: QLabel( parent, "ProgressBox" ) : TQLabel( tqparent, "ProgressBox" )
{ {
hide(); hide();
setAlignment( Qt::AlignCenter ); tqsetAlignment( TQt::AlignCenter );
setFont( KGlobalSettings::fixedFont() ); setFont( KGlobalSettings::fixedFont() );
setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed );
setText( 999999 ); setText( 999999 );
setMinimumWidth( sizeHint().width() ); setMinimumWidth( tqsizeHint().width() );
connect( &m_timer, SIGNAL(timeout()), SLOT(report()) ); connect( &m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(report()) );
connect( part, SIGNAL(started( KIO::Job* )), SLOT(start()) ); connect( part, TQT_SIGNAL(started( KIO::Job* )), TQT_SLOT(start()) );
connect( part, SIGNAL(completed()), SLOT(stop()) ); connect( part, TQT_SIGNAL(completed()), TQT_SLOT(stop()) );
connect( part, SIGNAL(canceled( const QString& )), SLOT(halt()) ); connect( part, TQT_SIGNAL(canceled( const TQString& )), TQT_SLOT(halt()) );
} }
void void
@ -53,13 +53,13 @@ ProgressBox::halt()
{ {
// canceled by stop button // canceled by stop button
m_timer.stop(); m_timer.stop();
QTimer::singleShot( 2000, this, SLOT(hide()) ); TQTimer::singleShot( 2000, this, TQT_SLOT(hide()) );
} }
void void
ProgressBox::setText( int files ) ProgressBox::setText( int files )
{ {
QLabel::setText( i18n("%n File", "%n Files", files) ); TQLabel::setText( i18n("%n File", "%n Files", files) );
} }
#include "progressBox.moc" #include "progressBox.moc"

@ -4,18 +4,19 @@
#ifndef PROGRESSBOX_H #ifndef PROGRESSBOX_H
#define PROGRESSBOX_H #define PROGRESSBOX_H
#include <qlabel.h> #include <tqlabel.h>
#include <qtimer.h> #include <tqtimer.h>
namespace KIO { class Job; } namespace KIO { class Job; }
class ProgressBox : public QLabel class ProgressBox : public TQLabel
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
ProgressBox( QWidget*, QObject* ); ProgressBox( TQWidget*, TQObject* );
void setText( int ); void setText( int );
@ -26,7 +27,7 @@ public slots:
void halt(); void halt();
private: private:
QTimer m_timer; TQTimer m_timer;
}; };
#endif #endif

@ -40,7 +40,7 @@ RadialMap::Builder::Builder( RadialMap::Map *m, const Directory* const d, bool f
void void
RadialMap::Builder::findVisibleDepth( const Directory* const dir, const unsigned int depth ) RadialMap::Builder::findVisibleDepth( const Directory* const dir, const unsigned int depth )
{ {
//**** because I don't use the same minimumSize criteria as in the visual function //**** because I don't use the same tqminimumSize criteria as in the visual function
// this can lead to incorrect visual representation // this can lead to incorrect visual representation
//**** BUT, you can't set those limits until you know m_depth! //**** BUT, you can't set those limits until you know m_depth!
@ -84,7 +84,7 @@ RadialMap::Builder::build( const Directory* const dir, const unsigned int depth,
{ {
//first iteration: dir == m_root //first iteration: dir == m_root
if( dir->children() == 0 ) //we do fileCount rather than size to avoid chance of divide by zero later if( dir->tqchildren() == 0 ) //we do fileCount rather than size to avoid chance of divide by zero later
return false; return false;
uint hiddenSize = 0, hiddenFileCount = 0; uint hiddenSize = 0, hiddenFileCount = 0;
@ -116,13 +116,13 @@ RadialMap::Builder::build( const Directory* const dir, const unsigned int depth,
hiddenSize += (*it)->size(); hiddenSize += (*it)->size();
if( (*it)->isDirectory() ) //**** considered virtual, but dir wouldn't count itself! if( (*it)->isDirectory() ) //**** considered virtual, but dir wouldn't count itself!
hiddenFileCount += static_cast<const Directory*>(*it)->children(); //need to add one to count the dir as well hiddenFileCount += static_cast<const Directory*>(*it)->tqchildren(); //need to add one to count the dir as well
++hiddenFileCount; ++hiddenFileCount;
} }
} }
if( hiddenFileCount == dir->children() && !Config::showSmallFiles ) if( hiddenFileCount == dir->tqchildren() && !Config::showSmallFiles )
return true; return true;
else if( (Config::showSmallFiles && hiddenSize > m_limits[depth]) || (depth == 0 && (hiddenSize > dir->size()/8)) /*|| > size() * 0.75*/ ) else if( (Config::showSmallFiles && hiddenSize > m_limits[depth]) || (depth == 0 && (hiddenSize > dir->size()/8)) /*|| > size() * 0.75*/ )
@ -130,9 +130,9 @@ RadialMap::Builder::build( const Directory* const dir, const unsigned int depth,
//append a segment for unrepresented space - a "fake" segment //append a segment for unrepresented space - a "fake" segment
// I dunno how to i18n this // I dunno how to i18n this
const QString s = i18n( "There can't ever be only 1 file", "%1 files, each about %2" ) const TQString s = i18n( "There can't ever be only 1 file", "%1 files, each about %2" )
.arg( hiddenFileCount ) .tqarg( hiddenFileCount )
.arg( File::humanReadableSize( hiddenSize/hiddenFileCount ) ); .tqarg( File::humanReadableSize( hiddenSize/hiddenFileCount ) );
(m_signature + depth)->append( new Segment( new File( s.local8Bit(), hiddenSize ), a_start, a_end - a_start, true ) ); (m_signature + depth)->append( new Segment( new File( s.local8Bit(), hiddenSize ), a_start, a_end - a_start, true ) );
} }

@ -2,10 +2,10 @@
//Copyright: See COPYING file that comes with this distribution //Copyright: See COPYING file that comes with this distribution
#include <kstringhandler.h> #include <kstringhandler.h>
#include <qfont.h> #include <tqfont.h>
#include <qfontmetrics.h> #include <tqfontmetrics.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include "Config.h" #include "Config.h"
#include "fileTree.h" #include "fileTree.h"
@ -30,13 +30,13 @@ namespace RadialMap
int x1, y1, x2, y2, x3; int x1, y1, x2, y2, x3;
int tx, ty; int tx, ty;
QString qs; TQString qs;
}; };
class LabelList : public QPtrList<Label> class LabelList : public TQPtrList<Label>
{ {
protected: protected:
int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) int compareItems( TQPtrCollection::Item item1, TQPtrCollection::Item item2 )
{ {
//you add 1440 to work round the fact that later you want the circle split vertically //you add 1440 to work round the fact that later you want the circle split vertically
//and as it is you start at 3 o' clock. It's to do with rightPrevY, stops annoying bug //and as it is you start at 3 o' clock. It's to do with rightPrevY, stops annoying bug
@ -60,12 +60,12 @@ namespace RadialMap
void void
RadialMap::Widget::paintExplodedLabels( QPainter &paint ) const RadialMap::Widget::paintExplodedLabels( TQPainter &paint ) const
{ {
//we are a friend of RadialMap::Map //we are a friend of RadialMap::Map
LabelList list; list.setAutoDelete( true ); LabelList list; list.setAutoDelete( true );
QPtrListIterator<Label> it( list ); TQPtrListIterator<Label> it( list );
unsigned int startLevel = 0; unsigned int startLevel = 0;
@ -80,7 +80,7 @@ RadialMap::Widget::paintExplodedLabels( QPainter &paint ) const
//find the range of levels we will be potentially drawing labels for //find the range of levels we will be potentially drawing labels for
//startLevel is the level above whatever m_focus is in //startLevel is the level above whatever m_focus is in
for( const Directory *p = (const Directory*)m_focus->file(); p != m_tree; ++startLevel ) for( const Directory *p = (const Directory*)m_focus->file(); p != m_tree; ++startLevel )
p = p->parent(); p = p->tqparent();
//range=2 means 2 levels to draw labels for //range=2 means 2 levels to draw labels for
@ -122,7 +122,7 @@ RadialMap::Widget::paintExplodedLabels( QPainter &paint ) const
// if so, remove the least significant labels // if so, remove the least significant labels
it.toFirst(); it.toFirst();
QPtrListIterator<Label> jt( it ); TQPtrListIterator<Label> jt( it );
++jt; ++jt;
while( jt ) //**** no need to check _it_ as jt will be NULL if _it_ was too while( jt ) //**** no need to check _it_ as jt will be NULL if _it_ was too
@ -202,15 +202,15 @@ RadialMap::Widget::paintExplodedLabels( QPainter &paint ) const
bool rightSide; bool rightSide;
QFont font; TQFont font;
for( it.toFirst(); it != 0; ++it ) for( it.toFirst(); it != 0; ++it )
{ {
//** bear in mind that text is drawn with QPoint param as BOTTOM left corner of text box //** bear in mind that text is drawn with TQPoint param as BOTTOM left corner of text box
QString qs = (*it)->segment->file()->name(); TQString qs = (*it)->segment->file()->name();
if( varySizes ) if( varySizes )
font.setPointSize( sizes[(*it)->lvl] ); font.setPointSize( sizes[(*it)->lvl] );
QFontMetrics fm( font ); TQFontMetrics fm( font );
int fmh = fm.height(); //used to ensure label texts don't overlap int fmh = fm.height(); //used to ensure label texts don't overlap
int fmhD4 = fmh / 4; int fmhD4 = fmh / 4;
@ -305,14 +305,14 @@ RadialMap::Widget::paintExplodedLabels( QPainter &paint ) const
//5. Render labels //5. Render labels
paint.setPen( QPen( Qt::black, 1 ) ); paint.setPen( TQPen( TQt::black, 1 ) );
for( it.toFirst(); it != 0; ++it ) for( it.toFirst(); it != 0; ++it )
{ {
if( varySizes ) { if( varySizes ) {
//**** how much overhead in making new QFont each time? //**** how much overhead in making new TQFont each time?
// (implicate sharing remember) // (implicate sharing remember)
QFont font = paint.font(); TQFont font = paint.font();
font.setPointSize( sizes[(*it)->lvl] ); font.setPointSize( sizes[(*it)->lvl] );
paint.setFont( font ); paint.setFont( font );
} }

@ -4,11 +4,11 @@
#include <kcursor.h> //make() #include <kcursor.h> //make()
#include <kglobalsettings.h> //kdeColours #include <kglobalsettings.h> //kdeColours
#include <kimageeffect.h> //desaturate() #include <kimageeffect.h> //desaturate()
#include <qapplication.h> //make() #include <tqapplication.h> //make()
#include <qimage.h> //make() & paint() #include <tqimage.h> //make() & paint()
#include <qfont.h> //ctor #include <tqfont.h> //ctor
#include <qfontmetrics.h> //ctor #include <tqfontmetrics.h> //ctor
#include <qpainter.h> #include <tqpainter.h>
#include "builder.h" #include "builder.h"
#include "Config.h" #include "Config.h"
@ -18,7 +18,7 @@
#include "sincos.h" #include "sincos.h"
#include "widget.h" #include "widget.h"
#define COLOR_GREY QColor( 0, 0, 140, QColor::Hsv ) #define COLOR_GREY TQColor( 0, 0, 140, TQColor::Hsv )
RadialMap::Map::Map() RadialMap::Map::Map()
@ -28,7 +28,7 @@ RadialMap::Map::Map()
, m_visibleDepth( DEFAULT_RING_DEPTH ) , m_visibleDepth( DEFAULT_RING_DEPTH )
{ {
//FIXME this is all broken. No longer is a maximum depth! //FIXME this is all broken. No longer is a maximum depth!
const int fmh = QFontMetrics( QFont() ).height(); const int fmh = TQFontMetrics( TQFont() ).height();
const int fmhD4 = fmh / 4; const int fmhD4 = fmh / 4;
MAP_2MARGIN = 2 * ( fmh - (fmhD4 - LABEL_MAP_SPACER) ); //margin is dependent on fitting in labels at top and bottom MAP_2MARGIN = 2 * ( fmh - (fmhD4 - LABEL_MAP_SPACER) ); //margin is dependent on fitting in labels at top and bottom
} }
@ -39,7 +39,7 @@ RadialMap::Map::~Map()
} }
void void
RadialMap::Map::invalidate( const bool desaturateTheImage ) RadialMap::Map::tqinvalidate( const bool desaturateTheImage )
{ {
DEBUG_ANNOUNCE DEBUG_ANNOUNCE
@ -48,7 +48,7 @@ RadialMap::Map::invalidate( const bool desaturateTheImage )
if( desaturateTheImage ) if( desaturateTheImage )
{ {
QImage img = this->convertToImage(); TQImage img = this->convertToImage();
KImageEffect::desaturate( img, 0.7 ); KImageEffect::desaturate( img, 0.7 );
KImageEffect::toGray( img, true ); KImageEffect::toGray( img, true );
@ -69,7 +69,7 @@ RadialMap::Map::make( const Directory *tree, bool refresh )
// even if it makes it a lie? // even if it makes it a lie?
//slow operation so set the wait cursor //slow operation so set the wait cursor
QApplication::setOverrideCursor( KCursor::waitCursor() ); TQApplication::setOverrideCursor( KCursor::waitCursor() );
{ {
//build a signature of visible components //build a signature of visible components
@ -94,7 +94,7 @@ RadialMap::Map::make( const Directory *tree, bool refresh )
//paint the pixmap //paint the pixmap
aaPaint(); aaPaint();
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
} }
void void
@ -114,7 +114,7 @@ RadialMap::Map::setRingBreadth()
} }
bool bool
RadialMap::Map::resize( const QRect &rect ) RadialMap::Map::resize( const TQRect &rect )
{ {
DEBUG_ANNOUNCE DEBUG_ANNOUNCE
@ -138,7 +138,7 @@ RadialMap::Map::resize( const QRect &rect )
if( size < minSize ) size = minSize; if( size < minSize ) size = minSize;
//this QRect is used by paint() //this TQRect is used by paint()
m_rect.setRect( mD2, mD2, size, size ); m_rect.setRect( mD2, mD2, size, size );
} }
@ -173,12 +173,12 @@ RadialMap::Map::colorise()
{ {
DEBUG_ANNOUNCE DEBUG_ANNOUNCE
QColor cp, cb; TQColor cp, cb;
double darkness = 1; double darkness = 1;
double contrast = (double)Config::contrast / (double)100; double contrast = (double)Config::contrast / (double)100;
int h, s1, s2, v1, v2; int h, s1, s2, v1, v2;
QColor kdeColour[2] = { KGlobalSettings::inactiveTitleColor(), KGlobalSettings::activeTitleColor() }; TQColor kdeColour[2] = { KGlobalSettings::inactiveTitleColor(), KGlobalSettings::activeTitleColor() };
double deltaRed = (double)(kdeColour[0].red() - kdeColour[1].red()) / 2880; //2880 for semicircle double deltaRed = (double)(kdeColour[0].red() - kdeColour[1].red()) / 2880; //2880 for semicircle
double deltaGreen = (double)(kdeColour[0].green() - kdeColour[1].green()) / 2880; double deltaGreen = (double)(kdeColour[0].green() - kdeColour[1].green()) / 2880;
@ -193,7 +193,7 @@ RadialMap::Map::colorise()
case 2000: //HACK for summary view case 2000: //HACK for summary view
if( (*it)->file()->name() == "Used" ) { if( (*it)->file()->name() == "Used" ) {
cb = QApplication::palette().active().color( QColorGroup::Highlight ); cb = TQApplication::tqpalette().active().color( TQColorGroup::Highlight );
cb.getHsv( &h, &s1, &v1 ); cb.getHsv( &h, &s1, &v1 );
if( s1 > 80 ) if( s1 > 80 )
@ -206,8 +206,8 @@ RadialMap::Map::colorise()
cp.setHsv( h, s2, v2 ); cp.setHsv( h, s2, v2 );
} }
else { else {
cp = Qt::gray; cp = TQt::gray;
cb = Qt::white; cb = TQt::white;
} }
(*it)->setPalette( cp, cb ); (*it)->setPalette( cp, cb );
@ -272,7 +272,7 @@ RadialMap::Map::colorise()
//**** may be better to store KDE colours as H and S and vary V as others //**** may be better to store KDE colours as H and S and vary V as others
//**** perhaps make saturation difference for s2 dependent on contrast too //**** perhaps make saturation difference for s2 dependent on contrast too
//**** fake segments don't work with highContrast //**** fake segments don't work with highContrast
//**** may work better with cp = cb rather than Qt::white //**** may work better with cp = cb rather than TQt::white
//**** you have to ensure the grey of files is sufficient, currently it works only with rainbow (perhaps use contrast there too) //**** you have to ensure the grey of files is sufficient, currently it works only with rainbow (perhaps use contrast there too)
//**** change v1,v2 to vp, vb etc. //**** change v1,v2 to vp, vb etc.
//**** using percentages is not strictly correct as the eye doesn't work like that //**** using percentages is not strictly correct as the eye doesn't work like that
@ -286,9 +286,9 @@ RadialMap::Map::aaPaint()
{ {
//paint() is called during continuous processes //paint() is called during continuous processes
//aaPaint() is not and is slower so set overidecursor (make sets it too) //aaPaint() is not and is slower so set overidecursor (make sets it too)
QApplication::setOverrideCursor( KCursor::waitCursor() ); TQApplication::setOverrideCursor( KCursor::waitCursor() );
paint( Config::antiAliasFactor ); paint( Config::antiAliasFactor );
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
} }
void void
@ -299,8 +299,8 @@ RadialMap::Map::paint( unsigned int scaleFactor )
if (scaleFactor == 0) //just in case if (scaleFactor == 0) //just in case
scaleFactor = 1; scaleFactor = 1;
QPainter paint; TQPainter paint;
QRect rect = m_rect; TQRect rect = m_rect;
int step = m_ringBreadth; int step = m_ringBreadth;
int excess = -1; int excess = -1;
@ -349,8 +349,8 @@ RadialMap::Map::paint( unsigned int scaleFactor )
if( (*it)->hasHiddenChildren() ) if( (*it)->hasHiddenChildren() )
{ {
//draw arrow head to indicate undisplayed files/directories //draw arrow head to indicate undisplayed files/directories
QPointArray pts( 3 ); TQPointArray pts( 3 );
QPoint pos, cpos = rect.center(); TQPoint pos, cpos = rect.center();
int a[3] = { (*it)->start(), (*it)->length(), 0 }; int a[3] = { (*it)->start(), (*it)->length(), 0 };
a[2] = a[0] + (a[1] / 2); //assign to halfway between a[2] = a[0] + (a[1] / 2); //assign to halfway between
@ -385,11 +385,11 @@ RadialMap::Map::paint( unsigned int scaleFactor )
{ {
//**** code is bloated! //**** code is bloated!
paint.save(); paint.save();
QPen pen = paint.pen(); TQPen pen = paint.pen();
int width = 2 * scaleFactor; int width = 2 * scaleFactor;
pen.setWidth( width ); pen.setWidth( width );
paint.setPen( pen ); paint.setPen( pen );
QRect rect2 = rect; TQRect rect2 = rect;
width /= 2; width /= 2;
rect2.addCoords( width, width, -width, -width ); rect2.addCoords( width, width, -width, -width );
paint.drawArc( rect2, (*it)->start(), (*it)->length() ); paint.drawArc( rect2, (*it)->start(), (*it)->length() );
@ -409,7 +409,7 @@ RadialMap::Map::paint( unsigned int scaleFactor )
// if( excess > 0 ) rect.addCoords( excess, excess, 0, 0 ); //ugly // if( excess > 0 ) rect.addCoords( excess, excess, 0, 0 ); //ugly
paint.setPen( COLOR_GREY ); paint.setPen( COLOR_GREY );
paint.setBrush( Qt::white ); paint.setBrush( TQt::white );
paint.drawEllipse( rect ); paint.drawEllipse( rect );
if( scaleFactor > 1 ) if( scaleFactor > 1 )
@ -425,16 +425,16 @@ RadialMap::Map::paint( unsigned int scaleFactor )
y2 /= scaleFactor; y2 /= scaleFactor;
rect.setCoords( x1, y1, x2, y2 ); rect.setCoords( x1, y1, x2, y2 );
QImage img = this->convertToImage(); TQImage img = this->convertToImage();
img = img.smoothScale( this->size() / (int)scaleFactor ); img = img.smoothScale( this->size() / (int)scaleFactor );
this->convertFromImage( img ); this->convertFromImage( img );
paint.begin( this ); paint.begin( this );
paint.setPen( COLOR_GREY ); paint.setPen( COLOR_GREY );
paint.setBrush( Qt::white ); paint.setBrush( TQt::white );
} }
paint.drawText( rect, Qt::AlignCenter, m_centerText ); paint.drawText( rect, TQt::AlignCenter, m_centerText );
m_innerRadius = rect.width() / 2; //rect.width should be multiple of 2 m_innerRadius = rect.width() / 2; //rect.width should be multiple of 2

@ -4,7 +4,7 @@
#ifndef RADIALMAP_H #ifndef RADIALMAP_H
#define RADIALMAP_H #define RADIALMAP_H
#include <qcolor.h> #include <tqcolor.h>
class File; class File;
@ -26,8 +26,8 @@ namespace RadialMap
uint length() const { return m_angleSegment; } uint length() const { return m_angleSegment; }
uint end() const { return m_angleStart + m_angleSegment; } uint end() const { return m_angleStart + m_angleSegment; }
const File *file() const { return m_file; } const File *file() const { return m_file; }
const QColor& pen() const { return m_pen; } const TQColor& pen() const { return m_pen; }
const QColor& brush() const { return m_brush; } const TQColor& brush() const { return m_brush; }
bool isFake() const { return m_fake; } bool isFake() const { return m_fake; }
bool hasHiddenChildren() const { return m_hasHiddenChildren; } bool hasHiddenChildren() const { return m_hasHiddenChildren; }
@ -38,11 +38,11 @@ namespace RadialMap
friend class Builder; friend class Builder;
private: private:
void setPalette( const QColor &p, const QColor &b ) { m_pen = p; m_brush = b; } void setPalette( const TQColor &p, const TQColor &b ) { m_pen = p; m_brush = b; }
const uint m_angleStart, m_angleSegment; const uint m_angleStart, m_angleSegment;
const File* const m_file; const File* const m_file;
QColor m_pen, m_brush; TQColor m_pen, m_brush;
bool m_hasHiddenChildren; bool m_hasHiddenChildren;
const bool m_fake; const bool m_fake;
}; };

@ -10,8 +10,8 @@
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <klocale.h> #include <klocale.h>
#include <kpixmapeffect.h> #include <kpixmapeffect.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qtooltip.h> //for its palette #include <tqtooltip.h> //for its palette
@ -29,20 +29,20 @@ bool isBackingStoreActive()
buffer[ N ] = '\0'; buffer[ N ] = '\0';
pclose( xdpyinfo ); pclose( xdpyinfo );
return QString::fromLocal8Bit( buffer ).contains( "backing-store YES" ); return TQString(TQString::fromLocal8Bit( buffer )).tqcontains( "backing-store YES" );
} }
SegmentTip::SegmentTip( uint h ) SegmentTip::SegmentTip( uint h )
: QWidget( 0, 0, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM ) : TQWidget( 0, 0, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM )
, m_cursorHeight( -h ) , m_cursorHeight( -h )
, m_backing_store( isBackingStoreActive() ) , m_backing_store( isBackingStoreActive() )
{ {
setBackgroundMode( Qt::NoBackground ); setBackgroundMode( TQt::NoBackground );
} }
void void
SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove ) SegmentTip::moveTo( TQPoint p, const TQWidget &canvas, bool placeAbove )
{ {
//**** this function is very slow and seems to be visibly influenced by operations like mapFromGlobal() (who knows why!) //**** this function is very slow and seems to be visibly influenced by operations like mapFromGlobal() (who knows why!)
// ** so any improvements are much desired // ** so any improvements are much desired
@ -51,7 +51,7 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove )
p.rx() -= rect().center().x(); p.rx() -= rect().center().x();
p.ry() -= (placeAbove ? 8 + height() : m_cursorHeight - 8); p.ry() -= (placeAbove ? 8 + height() : m_cursorHeight - 8);
const QRect screen = KGlobalSettings::desktopGeometry( parentWidget() ); const TQRect screen = KGlobalSettings::desktopGeometry( tqparentWidget() );
const int x = p.x(); const int x = p.x();
const int y = p.y(); const int y = p.y();
@ -66,25 +66,25 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove )
if( y2 > sh ) p.ry() -= y2 - sh; if( y2 > sh ) p.ry() -= y2 - sh;
//I'm using this QPoint to determine where to offset the bitBlt in m_pixmap //I'm using this TQPoint to determine where to offset the bitBlt in m_pixmap
QPoint offset = canvas.mapToGlobal( QPoint() ) - p; TQPoint offset = canvas.mapToGlobal( TQPoint() ) - p;
if( offset.x() < 0 ) offset.setX( 0 ); if( offset.x() < 0 ) offset.setX( 0 );
if( offset.y() < 0 ) offset.setY( 0 ); if( offset.y() < 0 ) offset.setY( 0 );
const QRect alphaMaskRect( canvas.mapFromGlobal( p ), size() ); const TQRect alphaMaskRect( canvas.mapFromGlobal( p ), size() );
const QRect intersection( alphaMaskRect.intersect( canvas.rect() ) ); const TQRect intersection( alphaMaskRect.intersect( canvas.rect() ) );
m_pixmap.resize( size() ); //move to updateTip once you are sure it can never be null m_pixmap.resize( size() ); //move to updateTip once you are sure it can never be null
bitBlt( &m_pixmap, offset, &canvas, intersection, Qt::CopyROP ); bitBlt( &m_pixmap, offset, &canvas, intersection, TQt::CopyROP );
QColor const c = QToolTip::palette().color( QPalette::Active, QColorGroup::Background ); TQColor const c = TQToolTip::palette().color( TQPalette::Active, TQColorGroup::Background );
if (!m_backing_store) if (!m_backing_store)
m_pixmap.fill( c ); m_pixmap.fill( c );
QPainter paint( &m_pixmap ); TQPainter paint( &m_pixmap );
paint.setPen( Qt::black ); paint.setPen( TQt::black );
paint.setBrush( Qt::NoBrush ); paint.setBrush( TQt::NoBrush );
paint.drawRect( rect() ); paint.drawRect( rect() );
paint.end(); paint.end();
@ -105,15 +105,15 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove )
void void
SegmentTip::updateTip( const File* const file, const Directory* const root ) SegmentTip::updateTip( const File* const file, const Directory* const root )
{ {
const QString s1 = file->fullPath( root ); const TQString s1 = file->fullPath( root );
QString s2 = file->humanReadableSize(); TQString s2 = file->humanReadableSize();
KLocale *loc = KGlobal::locale(); KLocale *loc = KGlobal::locale();
const uint MARGIN = 3; const uint MARGIN = 3;
const uint pc = 100 * file->size() / root->size(); const uint pc = 100 * file->size() / root->size();
uint maxw = 0; uint maxw = 0;
uint h = fontMetrics().height()*2 + 2*MARGIN; uint h = fontMetrics().height()*2 + 2*MARGIN;
if( pc > 0 ) s2 += QString( " (%1%)" ).arg( loc->formatNumber( pc, 0 ) ); if( pc > 0 ) s2 += TQString( " (%1%)" ).tqarg( loc->formatNumber( pc, 0 ) );
m_text = s1; m_text = s1;
m_text += '\n'; m_text += '\n';
@ -121,11 +121,11 @@ SegmentTip::updateTip( const File* const file, const Directory* const root )
if( file->isDirectory() ) if( file->isDirectory() )
{ {
double files = static_cast<const Directory*>(file)->children(); double files = static_cast<const Directory*>(file)->tqchildren();
const uint pc = uint((100 * files) / (double)root->children()); const uint pc = uint((100 * files) / (double)root->tqchildren());
QString s3 = i18n( "Files: %1" ).arg( loc->formatNumber( files, 0 ) ); TQString s3 = i18n( "Files: %1" ).tqarg( loc->formatNumber( files, 0 ) );
if( pc > 0 ) s3 += QString( " (%1%)" ).arg( loc->formatNumber( pc, 0 ) ); if( pc > 0 ) s3 += TQString( " (%1%)" ).tqarg( loc->formatNumber( pc, 0 ) );
maxw = fontMetrics().width( s3 ); maxw = fontMetrics().width( s3 );
h += fontMetrics().height(); h += fontMetrics().height();
@ -141,19 +141,19 @@ SegmentTip::updateTip( const File* const file, const Directory* const root )
} }
bool bool
SegmentTip::event( QEvent *e ) SegmentTip::event( TQEvent *e )
{ {
switch( e->type() ) switch( e->type() )
{ {
case QEvent::Show: case TQEvent::Show:
kapp->installEventFilter( this ); kapp->installEventFilter( this );
break; break;
case QEvent::Hide: case TQEvent::Hide:
kapp->removeEventFilter( this ); kapp->removeEventFilter( this );
break; break;
case QEvent::Paint: case TQEvent::Paint:
{ {
//QPainter( this ).drawPixmap( 0, 0, m_pixmap ); //TQPainter( this ).drawPixmap( 0, 0, m_pixmap );
bitBlt( this, 0, 0, &m_pixmap ); bitBlt( this, 0, 0, &m_pixmap );
return true; return true;
} }
@ -161,22 +161,22 @@ SegmentTip::event( QEvent *e )
; ;
} }
return false/*QWidget::event( e )*/; return false/*TQWidget::event( e )*/;
} }
bool bool
SegmentTip::eventFilter( QObject*, QEvent *e ) SegmentTip::eventFilter( TQObject*, TQEvent *e )
{ {
switch ( e->type() ) switch ( e->type() )
{ {
case QEvent::Leave: case TQEvent::Leave:
// case QEvent::MouseButtonPress: // case TQEvent::MouseButtonPress:
// case QEvent::MouseButtonRelease: // case TQEvent::MouseButtonRelease:
case QEvent::KeyPress: case TQEvent::KeyPress:
case QEvent::KeyRelease: case TQEvent::KeyRelease:
case QEvent::FocusIn: case TQEvent::FocusIn:
case QEvent::FocusOut: case TQEvent::FocusOut:
case QEvent::Wheel: case TQEvent::Wheel:
hide(); //FALL THROUGH hide(); //FALL THROUGH
default: default:
return false; //allow this event to passed to target return false; //allow this event to passed to target

@ -5,28 +5,28 @@
#define SEGMENTTIP_H #define SEGMENTTIP_H
#include <kpixmap.h> #include <kpixmap.h>
#include <qwidget.h> #include <tqwidget.h>
class File; class File;
class Directory; class Directory;
namespace RadialMap namespace RadialMap
{ {
class SegmentTip : public QWidget class SegmentTip : public TQWidget
{ {
public: public:
SegmentTip( uint ); SegmentTip( uint );
void updateTip( const File*, const Directory* ); void updateTip( const File*, const Directory* );
void moveTo( QPoint, const QWidget&, bool ); void moveTo( TQPoint, const TQWidget&, bool );
private: private:
virtual bool eventFilter( QObject*, QEvent* ); virtual bool eventFilter( TQObject*, TQEvent* );
virtual bool event( QEvent* ); virtual bool event( TQEvent* );
uint m_cursorHeight; uint m_cursorHeight;
KPixmap m_pixmap; KPixmap m_pixmap;
QString m_text; TQString m_text;
bool m_backing_store; bool m_backing_store;
}; };
} }

@ -4,10 +4,10 @@
#include <kcursor.h> //ctor #include <kcursor.h> //ctor
#include <klocale.h> #include <klocale.h>
#include <kurl.h> #include <kurl.h>
#include <qapplication.h> //sendEvent #include <tqapplication.h> //sendEvent
#include <qbitmap.h> //ctor - finding cursor size #include <tqbitmap.h> //ctor - finding cursor size
#include <qcursor.h> //slotPostMouseEvent() #include <tqcursor.h> //slotPostMouseEvent()
#include <qtimer.h> //member #include <tqtimer.h> //member
#include "Config.h" #include "Config.h"
#include "debug.h" #include "debug.h"
@ -17,23 +17,23 @@
RadialMap::Widget::Widget( QWidget *parent, const char *name ) RadialMap::Widget::Widget( TQWidget *tqparent, const char *name )
: QWidget( parent, name, Qt::WNoAutoErase ) : TQWidget( tqparent, name, TQt::WNoAutoErase )
, m_tree( 0 ) , m_tree( 0 )
, m_focus( 0 ) , m_focus( 0 )
, m_rootSegment( 0 ) //TODO we don't delete it, *shrug* , m_rootSegment( 0 ) //TODO we don't delete it, *shrug*
{ {
setAcceptDrops( true ); setAcceptDrops( true );
setBackgroundColor( Qt::white ); setBackgroundColor( TQt::white );
const QBitmap *cursor = KCursor::handCursor().bitmap(); const QBitmap *cursor = KCursor::handCursor().bitmap();
m_tip = new SegmentTip(cursor ? cursor->height() : 16); m_tip = new SegmentTip(cursor ? cursor->height() : 16);
connect( this, SIGNAL(created( const Directory* )), SLOT(sendFakeMouseEvent()) ); connect( this, TQT_SIGNAL(created( const Directory* )), TQT_SLOT(sendFakeMouseEvent()) );
connect( this, SIGNAL(created( const Directory* )), SLOT(update()) ); connect( this, TQT_SIGNAL(created( const Directory* )), TQT_SLOT(update()) );
connect( &m_timer, SIGNAL(timeout()), SLOT(resizeTimeout()) ); connect( &m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(resizeTimeout()) );
} }
QString TQString
RadialMap::Widget::path() const RadialMap::Widget::path() const
{ {
return m_tree->fullPath(); return m_tree->fullPath();
@ -46,11 +46,11 @@ RadialMap::Widget::url( File const * const file ) const
} }
void void
RadialMap::Widget::invalidate( const bool b ) RadialMap::Widget::tqinvalidate( const bool b )
{ {
if( isValid() ) if( isValid() )
{ {
//**** have to check that only way to invalidate is this function frankly //**** have to check that only way to tqinvalidate is this function frankly
//**** otherwise you may get bugs.. //**** otherwise you may get bugs..
//disable mouse tracking //disable mouse tracking
@ -65,22 +65,22 @@ RadialMap::Widget::invalidate( const bool b )
//FIXME move this disablement thing no? //FIXME move this disablement thing no?
// it is confusing in other areas, like the whole createFromCache() thing // it is confusing in other areas, like the whole createFromCache() thing
m_map.invalidate( b ); //b signifies whether the pixmap is made to look disabled or not m_map.tqinvalidate( b ); //b signifies whether the pixmap is made to look disabled or not
if( b ) if( b )
update(); update();
//tell rest of Filelight //tell rest of Filelight
emit invalidated( url() ); emit tqinvalidated( url() );
} }
} }
void void
RadialMap::Widget::create( const Directory *tree ) RadialMap::Widget::create( const Directory *tree )
{ {
//it is not the responsibility of create() to invalidate first //it is not the responsibility of create() to tqinvalidate first
//skip invalidation at your own risk //skip invalidation at your own risk
//FIXME make it the responsibility of create to invalidate first //FIXME make it the responsibility of create to tqinvalidate first
if( tree ) if( tree )
{ {
@ -102,16 +102,16 @@ RadialMap::Widget::create( const Directory *tree )
void void
RadialMap::Widget::createFromCache( const Directory *tree ) RadialMap::Widget::createFromCache( const Directory *tree )
{ {
//no scan was necessary, use cached tree, however we MUST still emit invalidate //no scan was necessary, use cached tree, however we MUST still emit tqinvalidate
invalidate( false ); tqinvalidate( false );
create( tree ); create( tree );
} }
void void
RadialMap::Widget::sendFakeMouseEvent() //slot RadialMap::Widget::sendFakeMouseEvent() //slot
{ {
QMouseEvent me( QEvent::MouseMove, mapFromGlobal( QCursor::pos() ), Qt::NoButton, Qt::NoButton ); TQMouseEvent me( TQEvent::MouseMove, mapFromGlobal( TQCursor::pos() ), Qt::NoButton, Qt::NoButton );
QApplication::sendEvent( this, &me ); TQApplication::sendEvent( this, &me );
} }
void void

@ -5,7 +5,7 @@
#define WIDGET_H #define WIDGET_H
#include <kurl.h> #include <kurl.h>
#include <qtimer.h> #include <tqtimer.h>
#include "segmentTip.h" #include "segmentTip.h"
template <class T> class Chain; template <class T> class Chain;
@ -25,10 +25,10 @@ namespace RadialMap
~Map(); ~Map();
void make( const Directory *, bool = false ); void make( const Directory *, bool = false );
bool resize( const QRect& ); bool resize( const TQRect& );
bool isNull() const { return ( m_signature == 0 ); } bool isNull() const { return ( m_signature == 0 ); }
void invalidate( const bool ); void tqinvalidate( const bool );
friend class Builder; friend class Builder;
friend class Widget; friend class Widget;
@ -41,24 +41,25 @@ namespace RadialMap
Chain<Segment> *m_signature; Chain<Segment> *m_signature;
QRect m_rect; TQRect m_rect;
uint m_ringBreadth; ///ring breadth uint m_ringBreadth; ///ring breadth
uint m_innerRadius; ///radius of inner circle uint m_innerRadius; ///radius of inner circle
uint m_visibleDepth; ///visible level depth of system uint m_visibleDepth; ///visible level depth of system
QString m_centerText; TQString m_centerText;
uint MAP_2MARGIN; uint MAP_2MARGIN;
}; };
class Widget : public QWidget class Widget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Widget( QWidget* = 0, const char* = 0 ); Widget( TQWidget* = 0, const char* = 0 );
~Widget() { delete m_tip; } ~Widget() { delete m_tip; }
QString path() const; TQString path() const;
KURL url( File const * const = 0 ) const; KURL url( File const * const = 0 ) const;
bool isValid() const { return m_tree != 0; } bool isValid() const { return m_tree != 0; }
@ -69,7 +70,7 @@ namespace RadialMap
void zoomIn(); void zoomIn();
void zoomOut(); void zoomOut();
void create( const Directory* ); void create( const Directory* );
void invalidate( const bool = true ); void tqinvalidate( const bool = true );
void refresh( int ); void refresh( int );
private slots: private slots:
@ -80,31 +81,31 @@ namespace RadialMap
signals: signals:
void activated( const KURL& ); void activated( const KURL& );
void invalidated( const KURL& ); void tqinvalidated( const KURL& );
void created( const Directory* ); void created( const Directory* );
void mouseHover( const QString& ); void mouseHover( const TQString& );
void giveMeTreeFor( const KURL& ); void giveMeTreeFor( const KURL& );
protected: protected:
virtual void paintEvent( QPaintEvent* ); virtual void paintEvent( TQPaintEvent* );
virtual void resizeEvent( QResizeEvent* ); virtual void resizeEvent( TQResizeEvent* );
virtual void mouseMoveEvent( QMouseEvent* ); virtual void mouseMoveEvent( TQMouseEvent* );
virtual void mousePressEvent( QMouseEvent* ); virtual void mousePressEvent( TQMouseEvent* );
virtual void dragEnterEvent( QDragEnterEvent* ); virtual void dragEnterEvent( TQDragEnterEvent* );
virtual void dropEvent( QDropEvent* ); virtual void dropEvent( TQDropEvent* );
protected: protected:
const Segment *segmentAt( QPoint& ) const; //FIXME const reference for a library others can use const Segment *segmentAt( TQPoint& ) const; //FIXME const reference for a library others can use
const Segment *rootSegment() const { return m_rootSegment; } ///never == 0 const Segment *rootSegment() const { return m_rootSegment; } ///never == 0
const Segment *focusSegment() const { return m_focus; } ///0 == nothing in focus const Segment *focusSegment() const { return m_focus; } ///0 == nothing in focus
private: private:
void paintExplodedLabels( QPainter& ) const; void paintExplodedLabels( TQPainter& ) const;
const Directory *m_tree; const Directory *m_tree;
const Segment *m_focus; const Segment *m_focus;
QPoint m_offset; TQPoint m_offset;
QTimer m_timer; TQTimer m_timer;
Map m_map; Map m_map;
SegmentTip *m_tip; SegmentTip *m_tip;
Segment *m_rootSegment; Segment *m_rootSegment;

@ -15,15 +15,15 @@
#include <kpopupmenu.h> //::mousePressEvent() #include <kpopupmenu.h> //::mousePressEvent()
#include <krun.h> //::mousePressEvent() #include <krun.h> //::mousePressEvent()
#include <kurldrag.h> #include <kurldrag.h>
#include <qapplication.h>//QApplication::setOverrideCursor() #include <tqapplication.h>//TQApplication::setOverrideCursor()
#include <qclipboard.h> #include <tqclipboard.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qtimer.h> //::resizeEvent() #include <tqtimer.h> //::resizeEvent()
void void
RadialMap::Widget::resizeEvent( QResizeEvent* ) RadialMap::Widget::resizeEvent( TQResizeEvent* )
{ {
if( m_map.resize( rect() ) ) if( m_map.resize( rect() ) )
m_timer.start( 500, true ); //will cause signature to rebuild for new size m_timer.start( 500, true ); //will cause signature to rebuild for new size
@ -34,13 +34,13 @@ RadialMap::Widget::resizeEvent( QResizeEvent* )
} }
void void
RadialMap::Widget::paintEvent( QPaintEvent* ) RadialMap::Widget::paintEvent( TQPaintEvent* )
{ {
//bltBit for some Qt setups will bitBlt _after_ the labels are painted. Which buggers things up! //bltBit for some TQt setups will bitBlt _after_ the labels are painted. Which buggers things up!
//shame as bitBlt is faster, possibly Qt bug? Should report the bug? - seems to be race condition //shame as bitBlt is faster, possibly TQt bug? Should report the bug? - seems to be race condition
//bitBlt( this, m_offset, &m_map ); //bitBlt( this, m_offset, &m_map );
QPainter paint( this ); TQPainter paint( this );
paint.drawPixmap( m_offset, m_map ); paint.drawPixmap( m_offset, m_map );
@ -63,9 +63,9 @@ RadialMap::Widget::paintEvent( QPaintEvent* )
} }
const RadialMap::Segment* const RadialMap::Segment*
RadialMap::Widget::segmentAt( QPoint &e ) const RadialMap::Widget::segmentAt( TQPoint &e ) const
{ {
//determine which segment QPoint e is above //determine which segment TQPoint e is above
e -= m_offset; e -= m_offset;
@ -110,12 +110,12 @@ RadialMap::Widget::segmentAt( QPoint &e ) const
} }
void void
RadialMap::Widget::mouseMoveEvent( QMouseEvent *e ) RadialMap::Widget::mouseMoveEvent( TQMouseEvent *e )
{ {
//set m_focus to what we hover over, update UI if it's a new segment //set m_focus to what we hover over, update UI if it's a new segment
Segment const * const oldFocus = m_focus; Segment const * const oldFocus = m_focus;
QPoint p = e->pos(); TQPoint p = e->pos();
m_focus = segmentAt( p ); //NOTE p is passed by non-const reference m_focus = segmentAt( p ); //NOTE p is passed by non-const reference
@ -127,11 +127,11 @@ RadialMap::Widget::mouseMoveEvent( QMouseEvent *e )
m_tip->updateTip( m_focus->file(), m_tree ); m_tip->updateTip( m_focus->file(), m_tree );
emit mouseHover( m_focus->file()->fullPath() ); emit mouseHover( m_focus->file()->fullPath() );
//repaint required to update labels now before transparency is generated //tqrepaint required to update labels now before transparency is generated
repaint( false ); tqrepaint( false );
} }
m_tip->moveTo( e->globalPos(), *this, ( p.y() < 0 ) ); //updates tooltip psuedo-tranparent background m_tip->moveTo( e->globalPos(), *this, ( p.y() < 0 ) ); //updates tooltip psuedo-trantqparent background
} }
else if( oldFocus && oldFocus->file() != m_tree ) else if( oldFocus && oldFocus->file() != m_tree )
{ {
@ -139,12 +139,12 @@ RadialMap::Widget::mouseMoveEvent( QMouseEvent *e )
m_tip->hide(); m_tip->hide();
update(); update();
emit mouseHover( QString::null ); emit mouseHover( TQString() );
} }
} }
void void
RadialMap::Widget::mousePressEvent( QMouseEvent *e ) RadialMap::Widget::mousePressEvent( TQMouseEvent *e )
{ {
//m_tip is hidden already by event filter //m_tip is hidden already by event filter
//m_focus is set correctly (I've been strict, I assure you it is correct!) //m_focus is set correctly (I've been strict, I assure you it is correct!)
@ -184,12 +184,12 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e )
switch (popup.exec( e->globalPos(), 1 )) { switch (popup.exec( e->globalPos(), 1 )) {
case Konqueror: case Konqueror:
//KRun::runCommand will show an error message if there was trouble //KRun::runCommand will show an error message if there was trouble
KRun::runCommand( QString( "kfmclient openURL \"%1\"" ).arg( url.url() ) ); KRun::runCommand( TQString( "kfmclient openURL \"%1\"" ).tqarg( url.url() ) );
break; break;
case Konsole: case Konsole:
// --workdir only works for local file paths // --workdir only works for local file paths
KRun::runCommand( QString( "konsole --workdir \"%1\"" ).arg( url.path() ) ); KRun::runCommand( TQString( "konsole --workdir \"%1\"" ).tqarg( url.path() ) );
break; break;
case Center: case Center:
@ -197,24 +197,24 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e )
goto section_two; goto section_two;
case Copy: case Copy:
QApplication::clipboard()->setData( new KURLDrag( KURL::List( url ) ) ); TQApplication::tqclipboard()->setData( new KURLDrag( KURL::List( url ) ) );
break; break;
case Delete: case Delete:
{ {
const KURL url = Widget::url( m_focus->file() ); const KURL url = Widget::url( m_focus->file() );
const QString message = m_focus->file()->isDirectory() const TQString message = m_focus->file()->isDirectory()
? i18n( "<qt>The directory at <i>'%1'</i> will be <b>recursively</b> and <b>permanently</b> deleted." ) ? i18n( "<qt>The directory at <i>'%1'</i> will be <b>recursively</b> and <b>permanently</b> deleted." )
: i18n( "<qt><i>'%1'</i> will be <b>permanently</b> deleted." ); : i18n( "<qt><i>'%1'</i> will be <b>permanently</b> deleted." );
const int userIntention = KMessageBox::warningContinueCancel( const int userIntention = KMessageBox::warningContinueCancel(
this, message.arg( url.prettyURL() ), this, message.tqarg( url.prettyURL() ),
QString::null, KGuiItem( i18n("&Delete"), "editdelete" ) ); TQString(), KGuiItem( i18n("&Delete"), "editdelete" ) );
if (userIntention == KMessageBox::Continue) { if (userIntention == KMessageBox::Continue) {
KIO::Job *job = KIO::del( url ); KIO::Job *job = KIO::del( url );
job->setWindow( this ); job->setWindow( this );
connect( job, SIGNAL(result( KIO::Job* )), SLOT(deleteJobFinished( KIO::Job* )) ); connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(deleteJobFinished( KIO::Job* )) );
QApplication::setOverrideCursor( KCursor::workingCursor() ); TQApplication::setOverrideCursor( KCursor::workingCursor() );
} }
} }
@ -226,7 +226,7 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e )
else { // not right mouse button else { // not right mouse button
section_two: section_two:
const QRect rect( e->x() - 20, e->y() - 20, 40, 40 ); const TQRect rect( e->x() - 20, e->y() - 20, 40, 40 );
m_tip->hide(); // user expects this m_tip->hide(); // user expects this
@ -248,16 +248,16 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e )
void void
RadialMap::Widget::deleteJobFinished( KIO::Job *job ) RadialMap::Widget::deleteJobFinished( KIO::Job *job )
{ {
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
if( !job->error() ) if( !job->error() )
invalidate(); tqinvalidate();
else else
job->showErrorDialog( this ); job->showErrorDialog( this );
} }
#include "debug.h" #include "debug.h"
void void
RadialMap::Widget::dropEvent( QDropEvent *e ) RadialMap::Widget::dropEvent( TQDropEvent *e )
{ {
DEBUG_ANNOUNCE DEBUG_ANNOUNCE
@ -267,7 +267,7 @@ RadialMap::Widget::dropEvent( QDropEvent *e )
} }
void void
RadialMap::Widget::dragEnterEvent( QDragEnterEvent *e ) RadialMap::Widget::dragEnterEvent( TQDragEnterEvent *e )
{ {
DEBUG_ANNOUNCE DEBUG_ANNOUNCE

@ -3,9 +3,9 @@
#include <debug.h> #include <debug.h>
#include "fileTree.h" #include "fileTree.h"
#include <qapplication.h> #include <tqapplication.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include "remoteLister.h" #include "remoteLister.h"
#include "scan.h" #include "scan.h"
@ -18,21 +18,21 @@ namespace Filelight
struct Store { struct Store {
typedef QValueList<Store*> List; typedef TQValueList<Store*> List;
/// location of the directory /// location of the directory
const KURL url; const KURL url;
/// the directory on which we are operating /// the directory on which we are operating
Directory *directory; Directory *directory;
/// so we can reference the parent store /// so we can reference the tqparent store
Store *parent; Store *tqparent;
/// directories in this directory that need to be scanned before we can propagate() /// directories in this directory that need to be scanned before we can propagate()
List stores; List stores;
Store() Store()
: directory( 0 ), parent( 0 ) {} : directory( 0 ), tqparent( 0 ) {}
Store( const KURL &u, const QString &name, Store *s ) Store( const KURL &u, const TQString &name, Store *s )
: url( u ), directory( new Directory( name.local8Bit() + '/' ) ), parent( s ) {} : url( u ), directory( new Directory( name.local8Bit() + '/' ) ), tqparent( s ) {}
Store* Store*
@ -42,13 +42,13 @@ namespace Filelight
debug() << "propagate: " << url << endl; debug() << "propagate: " << url << endl;
if( parent ) { if( tqparent ) {
parent->directory->append( directory ); tqparent->directory->append( directory );
if( parent->stores.isEmpty() ) { if( tqparent->stores.isEmpty() ) {
return parent->propagate(); return tqparent->propagate();
} }
else else
return parent; return tqparent;
} }
//we reached the root, let's get our next directory scanned //we reached the root, let's get our next directory scanned
@ -61,18 +61,18 @@ namespace Filelight
}; };
RemoteLister::RemoteLister( const KURL &url, QWidget *parent ) RemoteLister::RemoteLister( const KURL &url, TQWidget *tqparent )
: KDirLister( true /*don't fetch mimetypes*/ ) : KDirLister( true /*don't fetch mimetypes*/ )
, m_root( new Store( url, url.url(), 0 ) ) , m_root( new Store( url, url.url(), 0 ) )
, m_store( m_root ) , m_store( m_root )
{ {
setAutoUpdate( false ); //don't use KDirWatchers setAutoUpdate( false ); //don't use KDirWatchers
setShowingDotFiles( true ); //stupid KDirLister API function names setShowingDotFiles( true ); //stupid KDirLister API function names
setMainWindow( parent ); setMainWindow( tqparent );
//use SIGNAL(result(KIO::Job*)) instead and then use Job::error() //use TQT_SIGNAL(result(KIO::Job*)) instead and then use Job::error()
connect( this, SIGNAL(completed()), SLOT(completed()) ); connect( this, TQT_SIGNAL(completed()), TQT_SLOT(completed()) );
connect( this, SIGNAL(canceled()), SLOT(canceled()) ); connect( this, TQT_SIGNAL(canceled()), TQT_SLOT(canceled()) );
//we do this non-recursively - it is the only way! //we do this non-recursively - it is the only way!
openURL( url ); openURL( url );
@ -82,9 +82,9 @@ namespace Filelight
{ {
Directory *tree = isFinished() ? m_store->directory : 0; Directory *tree = isFinished() ? m_store->directory : 0;
QCustomEvent *e = new QCustomEvent( 1000 ); TQCustomEvent *e = new TQCustomEvent( 1000 );
e->setData( tree ); e->setData( tree );
QApplication::postEvent( parent(), e ); TQApplication::postEvent( tqparent(), e );
delete m_root; delete m_root;
} }
@ -97,7 +97,7 @@ namespace Filelight
//as usual KDE documentation didn't suggest I needed to do this at all //as usual KDE documentation didn't suggest I needed to do this at all
//I had to figure it out myself //I had to figure it out myself
// -- avoid crash // -- avoid crash
QTimer::singleShot( 0, this, SLOT(_completed()) ); TQTimer::singleShot( 0, this, TQT_SLOT(_completed()) );
} }
void void
@ -105,7 +105,7 @@ namespace Filelight
{ {
debug() << "canceled: " << url().prettyURL() << endl; debug() << "canceled: " << url().prettyURL() << endl;
QTimer::singleShot( 0, this, SLOT(_completed()) ); TQTimer::singleShot( 0, this, TQT_SLOT(_completed()) );
} }
void void
@ -126,7 +126,7 @@ namespace Filelight
if( m_store->stores.isEmpty() ) if( m_store->stores.isEmpty() )
//no directories to scan, so we need to append ourselves to the parent directory //no directories to scan, so we need to append ourselves to the tqparent directory
//propagate() will return the next ancestor that has stores left to be scanned, or root if we are done //propagate() will return the next ancestor that has stores left to be scanned, or root if we are done
m_store = m_store->propagate(); m_store = m_store->propagate();

@ -11,8 +11,9 @@ namespace Filelight
class RemoteLister : public KDirLister class RemoteLister : public KDirLister
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
RemoteLister( const KURL &url, QWidget *parent ); RemoteLister( const KURL &url, TQWidget *tqparent );
~RemoteLister(); ~RemoteLister();
private slots: private slots:

@ -5,7 +5,7 @@
#include "fileTree.h" #include "fileTree.h"
#include <kcursor.h> #include <kcursor.h>
#include "localLister.h" #include "localLister.h"
#include <qapplication.h> #include <tqapplication.h>
#include "remoteLister.h" #include "remoteLister.h"
#include "scan.h" #include "scan.h"
@ -15,8 +15,8 @@ namespace Filelight
bool ScanManager::s_abort = false; bool ScanManager::s_abort = false;
uint ScanManager::s_files = 0; uint ScanManager::s_files = 0;
ScanManager::ScanManager( QObject *parent ) ScanManager::ScanManager( TQObject *tqparent )
: QObject( parent ) : TQObject( tqparent )
, m_thread( 0 ) , m_thread( 0 )
, m_cache( new Chain<Directory> ) , m_cache( new Chain<Directory> )
{ {
@ -33,7 +33,7 @@ namespace Filelight
delete m_cache; delete m_cache;
//RemoteListers are QObjects and get automatically deleted //RemoteListers are TQObjects and get automatically deleted
} }
bool bool
@ -62,7 +62,7 @@ namespace Filelight
if( url.protocol() == "file" ) if( url.protocol() == "file" )
{ {
const QString path = url.path( 1 ); const TQString path = url.path( 1 );
Chain<Directory> *trees = new Chain<Directory>; Chain<Directory> *trees = new Chain<Directory>;
@ -76,7 +76,7 @@ namespace Filelight
for( Iterator<Directory> it = m_cache->iterator(); it != m_cache->end(); ++it ) for( Iterator<Directory> it = m_cache->iterator(); it != m_cache->end(); ++it )
{ {
QString cachePath = (*it)->name(); TQString cachePath = (*it)->name();
if( path.startsWith( cachePath ) ) //then whole tree already scanned if( path.startsWith( cachePath ) ) //then whole tree already scanned
{ {
@ -84,7 +84,7 @@ namespace Filelight
debug() << "Cache-(a)hit: " << cachePath << endl; debug() << "Cache-(a)hit: " << cachePath << endl;
QStringList split = QStringList::split( '/', path.mid( cachePath.length() ) ); TQStringList split = TQStringList::split( '/', path.mid( cachePath.length() ) );
Directory *d = *it; Directory *d = *it;
Iterator<File> jt; Iterator<File> jt;
@ -93,7 +93,7 @@ namespace Filelight
jt = d->iterator(); jt = d->iterator();
const Link<File> *end = d->end(); const Link<File> *end = d->end();
QString s = split.first(); s += '/'; TQString s = split.first(); s += '/';
for( d = 0; jt != end; ++jt ) for( d = 0; jt != end; ++jt )
if( s == (*jt)->name() ) if( s == (*jt)->name() )
@ -113,16 +113,16 @@ namespace Filelight
debug() << "Found cache-handle, generating map..\n"; debug() << "Found cache-handle, generating map..\n";
//1001 indicates that this should not be cached //1001 indicates that this should not be cached
QCustomEvent *e = new QCustomEvent( 1001 ); TQCustomEvent *e = new TQCustomEvent( 1001 );
e->setData( d ); e->setData( d );
QApplication::postEvent( this, e ); TQApplication::postEvent( this, e );
return true; return true;
} }
else else
{ {
//something went wrong, we couldn't find the directory we were expecting //something went wrong, we couldn't find the directory we were expecting
error() << "Didn't find " << path << " in the cache!\n"; error() << "Didn't tqfind " << path << " in the cache!\n";
delete it.remove(); //safest to get rid of it delete it.remove(); //safest to get rid of it
break; //do a full scan break; //do a full scan
} }
@ -135,16 +135,16 @@ namespace Filelight
} }
m_url.setPath( path ); //FIXME stop switching between paths and KURLs all the time m_url.setPath( path ); //FIXME stop switching between paths and KURLs all the time
QApplication::setOverrideCursor( KCursor::workingCursor() ); TQApplication::setOverrideCursor( KCursor::workingCursor() );
//starts listing by itself //starts listing by itself
m_thread = new Filelight::LocalLister( path, trees, this ); m_thread = new Filelight::LocalLister( path, trees, this );
return true; return true;
} }
m_url = url; m_url = url;
QApplication::setOverrideCursor( KCursor::workingCursor() ); TQApplication::setOverrideCursor( KCursor::workingCursor() );
//will start listing straight away //will start listing straight away
QObject *o = new Filelight::RemoteLister( url, (QWidget*)parent() ); TQObject *o = new Filelight::RemoteLister( url, (TQWidget*)tqparent() );
insertChild( o ); insertChild( o );
o->setName( "remote_lister" ); o->setName( "remote_lister" );
return true; return true;
@ -174,7 +174,7 @@ namespace Filelight
} }
void void
ScanManager::customEvent( QCustomEvent *e ) ScanManager::customEvent( TQCustomEvent *e )
{ {
Directory *tree = (Directory*)e->data(); Directory *tree = (Directory*)e->data();
@ -197,7 +197,7 @@ namespace Filelight
else //scan failed else //scan failed
m_cache->empty(); //FIXME this is safe but annoying m_cache->empty(); //FIXME this is safe but annoying
QApplication::restoreOverrideCursor(); TQApplication::restoreOverrideCursor();
} }
} }

@ -5,23 +5,24 @@
#define SCAN_H #define SCAN_H
#include <kurl.h> #include <kurl.h>
#include <qobject.h> #include <tqobject.h>
class QThread; class TQThread;
class Directory; class Directory;
template<class T> class Chain; template<class T> class Chain;
namespace Filelight namespace Filelight
{ {
class ScanManager : public QObject class ScanManager : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
friend class LocalLister; friend class LocalLister;
friend class RemoteLister; friend class RemoteLister;
public: public:
ScanManager( QObject *parent ); ScanManager( TQObject *tqparent );
virtual ~ScanManager(); virtual ~ScanManager();
bool start( const KURL& ); bool start( const KURL& );
@ -42,10 +43,10 @@ namespace Filelight
static uint s_files; static uint s_files;
KURL m_url; KURL m_url;
QThread *m_thread; TQThread *m_thread;
Chain<Directory> *m_cache; Chain<Directory> *m_cache;
virtual void customEvent( QCustomEvent* ); virtual void customEvent( TQCustomEvent* );
}; };
} }

@ -1,12 +1,12 @@
//Author: Max Howell <max.howell@methylblue.com>, (C) 2003-4 //Author: Max Howell <max.howell@methylblue.com>, (C) 2003-4
//Copyright: See COPYING file that comes with this distribution //Copyright: See COPYING file that comes with this distribution
#include <qapplication.h> //Getting desktop width #include <tqapplication.h> //Getting desktop width
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qpushbutton.h> #include <tqpushbutton.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qslider.h> #include <tqslider.h>
#include <qvbuttongroup.h> #include <tqvbuttongroup.h>
#include <kdirselectdialog.h> #include <kdirselectdialog.h>
#include <kiconloader.h> #include <kiconloader.h>
@ -18,38 +18,38 @@
#include "Config.h" #include "Config.h"
SettingsDialog::SettingsDialog( QWidget *parent, const char *name ) SettingsDialog::SettingsDialog( TQWidget *tqparent, const char *name )
: Dialog( parent, name, false ) //3rd param => modal : Dialog( tqparent, name, false ) //3rd param => modal
{ {
colourSchemeGroup->setFrameShape( QFrame::NoFrame ); colourSchemeGroup->setFrameShape( TQFrame::NoFrame );
colourSchemeGroup->insert( new QRadioButton( i18n("Rainbow"), colourSchemeGroup ), Filelight::Rainbow ); colourSchemeGroup->insert( new TQRadioButton( i18n("Rainbow"), colourSchemeGroup ), Filelight::Rainbow );
colourSchemeGroup->insert( new QRadioButton( i18n("KDE Colors"), colourSchemeGroup ), Filelight::KDE ); colourSchemeGroup->insert( new TQRadioButton( i18n("KDE Colors"), colourSchemeGroup ), Filelight::KDE );
colourSchemeGroup->insert( new QRadioButton( i18n("High Contrast"), colourSchemeGroup ), Filelight::HighContrast ); colourSchemeGroup->insert( new TQRadioButton( i18n("High Contrast"), colourSchemeGroup ), Filelight::HighContrast );
//read in settings before you make all those nasty connections! //read in settings before you make all those nasty connections!
reset(); //makes dialog reflect global settings reset(); //makes dialog reflect global settings
connect( &m_timer, SIGNAL(timeout()), SIGNAL(mapIsInvalid()) ); connect( &m_timer, TQT_SIGNAL(timeout()), TQT_SIGNAL(mapIsInvalid()) );
connect( m_addButton, SIGNAL( clicked() ), SLOT( addDirectory() ) ); connect( m_addButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addDirectory() ) );
connect( m_removeButton, SIGNAL( clicked() ), SLOT( removeDirectory() ) ); connect( m_removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeDirectory() ) );
connect( m_resetButton, SIGNAL( clicked() ), SLOT( reset() ) ); connect( m_resetButton, TQT_SIGNAL( clicked() ), TQT_SLOT( reset() ) );
connect( m_closeButton, SIGNAL( clicked() ), SLOT( close() ) ); connect( m_closeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) );
connect( colourSchemeGroup, SIGNAL(clicked( int )), SLOT(changeScheme( int )) ); connect( colourSchemeGroup, TQT_SIGNAL(clicked( int )), TQT_SLOT(changeScheme( int )) );
connect( contrastSlider, SIGNAL(valueChanged( int )), SLOT(changeContrast( int )) ); connect( contrastSlider, TQT_SIGNAL(valueChanged( int )), TQT_SLOT(changeContrast( int )) );
connect( contrastSlider, SIGNAL(sliderReleased()), SLOT(slotSliderReleased()) ); connect( contrastSlider, TQT_SIGNAL(sliderReleased()), TQT_SLOT(slotSliderReleased()) );
connect( scanAcrossMounts, SIGNAL( toggled( bool ) ), SLOT( startTimer() ) ); connect( scanAcrossMounts, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( startTimer() ) );
connect( dontScanRemoteMounts, SIGNAL( toggled( bool ) ), SLOT( startTimer() ) ); connect( dontScanRemoteMounts, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( startTimer() ) );
connect( dontScanRemovableMedia, SIGNAL( toggled( bool ) ), SLOT( startTimer() ) ); connect( dontScanRemovableMedia, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( startTimer() ) );
connect( useAntialiasing, SIGNAL( toggled( bool ) ), SLOT( toggleUseAntialiasing( bool ) ) ); connect( useAntialiasing, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( toggleUseAntialiasing( bool ) ) );
connect( varyLabelFontSizes, SIGNAL( toggled( bool ) ), SLOT( toggleVaryLabelFontSizes( bool ) ) ); connect( varyLabelFontSizes, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( toggleVaryLabelFontSizes( bool ) ) );
connect( showSmallFiles, SIGNAL( toggled( bool ) ), SLOT( toggleShowSmallFiles( bool ) ) ); connect( showSmallFiles, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( toggleShowSmallFiles( bool ) ) );
connect( minFontPitch, SIGNAL ( valueChanged( int ) ), SLOT( changeMinFontPitch( int ) ) ); connect( minFontPitch, TQT_SIGNAL ( valueChanged( int ) ), TQT_SLOT( changeMinFontPitch( int ) ) );
m_addButton->setIconSet( SmallIcon( "fileopen" ) ); m_addButton->setIconSet( SmallIcon( "fileopen" ) );
m_resetButton->setIconSet( SmallIcon( "undo" ) ); m_resetButton->setIconSet( SmallIcon( "undo" ) );
@ -57,7 +57,7 @@ SettingsDialog::SettingsDialog( QWidget *parent, const char *name )
} }
void SettingsDialog::closeEvent( QCloseEvent* ) void SettingsDialog::closeEvent( TQCloseEvent* )
{ {
//if an invalidation is pending, force it now! //if an invalidation is pending, force it now!
if( m_timer.isActive() ) m_timer.changeInterval( 0 ); if( m_timer.isActive() ) m_timer.changeInterval( 0 );
@ -90,7 +90,7 @@ void SettingsDialog::reset()
if( colourSchemeGroup->id( colourSchemeGroup->selected() ) != Config::scheme ) if( colourSchemeGroup->id( colourSchemeGroup->selected() ) != Config::scheme )
{ {
colourSchemeGroup->setButton( Config::scheme ); colourSchemeGroup->setButton( Config::scheme );
//setButton doesn't call a single QButtonGroup signal! //setButton doesn't call a single TQButtonGroup signal!
//so we need to call this ourselves (and hence the detection above) //so we need to call this ourselves (and hence the detection above)
changeScheme( Config::scheme ); changeScheme( Config::scheme );
} }
@ -135,9 +135,9 @@ void SettingsDialog::addDirectory()
if( !url.isEmpty() ) if( !url.isEmpty() )
{ {
const QString path = url.path( 1 ); const TQString path = url.path( 1 );
if( !Config::skipList.contains( path ) ) if( !Config::skipList.tqcontains( path ) )
{ {
Config::skipList.append( path ); Config::skipList.append( path );
m_listBox->insertItem( path ); m_listBox->insertItem( path );
@ -208,7 +208,7 @@ void SettingsDialog::reject()
{ {
//called when escape is pressed //called when escape is pressed
reset(); reset();
QDialog::reject(); //**** doesn't change back scheme so far TQDialog::reject(); //**** doesn't change back scheme so far
} }
#include "settingsDialog.moc" #include "settingsDialog.moc"

@ -5,18 +5,19 @@
#define SETTINGSDLG_H #define SETTINGSDLG_H
#include "dialog.h" //generated by uic #include "dialog.h" //generated by uic
#include <qtimer.h> #include <tqtimer.h>
class SettingsDialog : public Dialog class SettingsDialog : public Dialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
SettingsDialog( QWidget* =0, const char* =0 ); SettingsDialog( TQWidget* =0, const char* =0 );
protected: protected:
virtual void closeEvent( QCloseEvent * ); virtual void closeEvent( TQCloseEvent * );
virtual void reject(); virtual void reject();
public slots: public slots:
@ -40,7 +41,7 @@ signals:
void canvasIsDirty( int ); void canvasIsDirty( int );
private: private:
QTimer m_timer; TQTimer m_timer;
static const uint TIMEOUT=1000; static const uint TIMEOUT=1000;
}; };

@ -8,10 +8,10 @@
#include <kiconeffect.h> //MyRadialMap::mousePressEvent() #include <kiconeffect.h> //MyRadialMap::mousePressEvent()
#include <kiconloader.h> #include <kiconloader.h>
#include <klocale.h> #include <klocale.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qlayout.h> #include <tqlayout.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <qvbox.h> #include <tqvbox.h>
#include "radialMap/radialMap.h" #include "radialMap/radialMap.h"
#include "radialMap/widget.h" #include "radialMap/widget.h"
#include "summaryWidget.h" #include "summaryWidget.h"
@ -23,10 +23,10 @@ static Filelight::MapScheme oldScheme;
struct Disk struct Disk
{ {
QString device; TQString device;
QString type; TQString type;
QString mount; TQString mount;
QString icon; TQString icon;
int size; int size;
int used; int used;
@ -36,7 +36,7 @@ struct Disk
}; };
struct DiskList : QValueList<Disk> struct DiskList : TQValueList<Disk>
{ {
DiskList(); DiskList();
}; };
@ -45,11 +45,11 @@ struct DiskList : QValueList<Disk>
class MyRadialMap : public RadialMap::Widget class MyRadialMap : public RadialMap::Widget
{ {
public: public:
MyRadialMap( QWidget *parent ) MyRadialMap( TQWidget *tqparent )
: RadialMap::Widget( parent ) : RadialMap::Widget( tqparent )
{} {}
virtual void setCursor( const QCursor &c ) virtual void setCursor( const TQCursor &c )
{ {
if( focusSegment() && focusSegment()->file()->name() == "Used" ) if( focusSegment() && focusSegment()->file()->name() == "Used" )
RadialMap::Widget::setCursor( c ); RadialMap::Widget::setCursor( c );
@ -57,7 +57,7 @@ public:
unsetCursor(); unsetCursor();
} }
virtual void mousePressEvent( QMouseEvent *e ) virtual void mousePressEvent( TQMouseEvent *e )
{ {
const RadialMap::Segment *segment = focusSegment(); const RadialMap::Segment *segment = focusSegment();
@ -67,7 +67,7 @@ public:
//and clicks to the used segment //and clicks to the used segment
else if( segment && segment->file()->name() == "Used" ) { else if( segment && segment->file()->name() == "Used" ) {
const QRect rect( e->x() - 20, e->y() - 20, 40, 40 ); const TQRect rect( e->x() - 20, e->y() - 20, 40, 40 );
KIconEffect::visualActivate( this, rect ); KIconEffect::visualActivate( this, rect );
emit activated( url() ); emit activated( url() );
} }
@ -76,17 +76,17 @@ public:
SummaryWidget::SummaryWidget( QWidget *parent, const char *name ) SummaryWidget::SummaryWidget( TQWidget *tqparent, const char *name )
: QWidget( parent, name ) : TQWidget( tqparent, name )
{ {
qApp->setOverrideCursor( KCursor::waitCursor() ); tqApp->setOverrideCursor( KCursor::waitCursor() );
setPaletteBackgroundColor( Qt::white ); setPaletteBackgroundColor( TQt::white );
(new QGridLayout( this, 1, 2 ))->setAutoAdd( true ); (new TQGridLayout( this, 1, 2 ))->setAutoAdd( true );
createDiskMaps(); createDiskMaps();
qApp->restoreOverrideCursor(); tqApp->restoreOverrideCursor();
} }
SummaryWidget::~SummaryWidget() SummaryWidget::~SummaryWidget()
@ -99,8 +99,8 @@ SummaryWidget::createDiskMaps()
{ {
DiskList disks; DiskList disks;
const QCString free = i18n( "Free" ).local8Bit(); const TQCString free = i18n( "Free" ).local8Bit();
const QCString used = i18n( "Used" ).local8Bit(); const TQCString used = i18n( "Used" ).local8Bit();
KIconLoader loader; KIconLoader loader;
@ -114,19 +114,19 @@ SummaryWidget::createDiskMaps()
if (disk.free == 0 && disk.used == 0) if (disk.free == 0 && disk.used == 0)
continue; continue;
QWidget *box = new QVBox( this ); TQWidget *box = new TQVBox( this );
RadialMap::Widget *map = new MyRadialMap( box ); RadialMap::Widget *map = new MyRadialMap( box );
QString text; QTextOStream( &text ) TQString text; TQTextOStream( &text )
<< "<img src='" << loader.iconPath( disk.icon, KIcon::Toolbar ) << "'>" << "<img src='" << loader.iconPath( disk.icon, KIcon::Toolbar ) << "'>"
<< " &nbsp;" << disk.mount << " " << " &nbsp;" << disk.mount << " "
<< "<i>(" << disk.device << ")</i>"; << "<i>(" << disk.device << ")</i>";
QLabel *label = new QLabel( text, box ); TQLabel *label = new TQLabel( text, box );
label->setAlignment( Qt::AlignCenter ); label->tqsetAlignment( TQt::AlignCenter );
label->setSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum ); label->tqsetSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Maximum );
box->show(); // will show its children too box->show(); // will show its tqchildren too
Directory *tree = new Directory( disk.mount.local8Bit() ); Directory *tree = new Directory( disk.mount.local8Bit() );
tree->append( free, disk.free ); tree->append( free, disk.free );
@ -134,7 +134,7 @@ SummaryWidget::createDiskMaps()
map->create( tree ); //must be done when visible map->create( tree ); //must be done when visible
connect( map, SIGNAL(activated( const KURL& )), SIGNAL(activated( const KURL& )) ); connect( map, TQT_SIGNAL(activated( const KURL& )), TQT_SIGNAL(activated( const KURL& )) );
} }
} }
@ -162,46 +162,46 @@ DiskList::DiskList()
buffer[ N ] = '\0'; buffer[ N ] = '\0';
pclose( df ); pclose( df );
QString output = QString::fromLocal8Bit( buffer ); TQString output = TQString::fromLocal8Bit( buffer );
QTextStream t( &output, IO_ReadOnly ); TQTextStream t( &output, IO_ReadOnly );
QString const BLANK( QChar(' ') ); TQString const BLANK( TQChar(' ') );
while (!t.atEnd()) { while (!t.atEnd()) {
QString s = t.readLine(); TQString s = t.readLine();
s = s.simplifyWhiteSpace(); s = s.simplifyWhiteSpace();
if (s.isEmpty()) if (s.isEmpty())
continue; continue;
if (s.find( BLANK ) < 0) // devicename was too long, rest in next line if (s.tqfind( BLANK ) < 0) // devicename was too long, rest in next line
if (!t.eof()) { // just appends the next line if (!t.eof()) { // just appends the next line
QString v = t.readLine(); TQString v = t.readLine();
s = s.append( v.latin1() ); s = s.append( v.latin1() );
s = s.simplifyWhiteSpace(); s = s.simplifyWhiteSpace();
} }
Disk disk; Disk disk;
disk.device = s.left( s.find( BLANK ) ); disk.device = s.left( s.tqfind( BLANK ) );
s = s.remove( 0, s.find( BLANK ) + 1 ); s = s.remove( 0, s.tqfind( BLANK ) + 1 );
#ifndef NO_FS_TYPE #ifndef NO_FS_TYPE
disk.type = s.left( s.find( BLANK ) ); disk.type = s.left( s.tqfind( BLANK ) );
s = s.remove( 0, s.find( BLANK ) + 1 ); s = s.remove( 0, s.tqfind( BLANK ) + 1 );
#endif #endif
int n = s.find( BLANK ); int n = s.tqfind( BLANK );
disk.size = s.left( n ).toInt(); disk.size = s.left( n ).toInt();
s = s.remove( 0, n + 1 ); s = s.remove( 0, n + 1 );
n = s.find( BLANK ); n = s.tqfind( BLANK );
disk.used = s.left( n ).toInt(); disk.used = s.left( n ).toInt();
s = s.remove( 0, n + 1 ); s = s.remove( 0, n + 1 );
n = s.find( BLANK ); n = s.tqfind( BLANK );
disk.free = s.left( n ).toInt(); disk.free = s.left( n ).toInt();
s = s.remove( 0, n + 1 ); s = s.remove( 0, n + 1 );
s = s.remove( 0, s.find( BLANK ) + 1 ); // delete the capacity 94% s = s.remove( 0, s.tqfind( BLANK ) + 1 ); // delete the capacity 94%
disk.mount = s; disk.mount = s;
disk.guessIconName(); disk.guessIconName();
@ -214,21 +214,21 @@ DiskList::DiskList()
void void
Disk::guessIconName() Disk::guessIconName()
{ {
if( mount.contains( "cdrom", false ) ) icon = "cdrom"; if( mount.tqcontains( "cdrom", false ) ) icon = "cdrom";
else if( device.contains( "cdrom", false ) ) icon = "cdrom"; else if( device.tqcontains( "cdrom", false ) ) icon = "cdrom";
else if( mount.contains( "writer", false ) ) icon = "cdwriter"; else if( mount.tqcontains( "writer", false ) ) icon = "cdwriter";
else if( device.contains( "writer", false ) ) icon = "cdwriter"; else if( device.tqcontains( "writer", false ) ) icon = "cdwriter";
else if( mount.contains( "mo", false ) ) icon = "mo"; else if( mount.tqcontains( "mo", false ) ) icon = "mo";
else if( device.contains( "mo", false ) ) icon = "mo"; else if( device.tqcontains( "mo", false ) ) icon = "mo";
else if( device.contains( "fd", false ) ) { else if( device.tqcontains( "fd", false ) ) {
if( device.contains( "360", false ) ) icon = "5floppy"; if( device.tqcontains( "360", false ) ) icon = "5floppy";
if( device.contains( "1200", false ) ) icon = "5floppy"; if( device.tqcontains( "1200", false ) ) icon = "5floppy";
else else
icon = "3floppy"; icon = "3floppy";
} }
else if( mount.contains( "floppy", false ) ) icon = "3floppy"; else if( mount.tqcontains( "floppy", false ) ) icon = "3floppy";
else if( mount.contains( "zip", false ) ) icon = "zip"; else if( mount.tqcontains( "zip", false ) ) icon = "zip";
else if( type.contains( "nfs", false ) ) icon = "nfs"; else if( type.tqcontains( "nfs", false ) ) icon = "nfs";
else else
icon = "hdd"; icon = "hdd";

@ -4,15 +4,16 @@
#ifndef FILELIGHTSUMMARY_H #ifndef FILELIGHTSUMMARY_H
#define FILELIGHTSUMMARY_H #define FILELIGHTSUMMARY_H
#include <qwidget.h> #include <tqwidget.h>
class SummaryWidget : public QWidget class SummaryWidget : public TQWidget
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
SummaryWidget( QWidget *parent, const char *name ); SummaryWidget( TQWidget *tqparent, const char *name );
~SummaryWidget(); ~SummaryWidget();
signals: signals:

Loading…
Cancel
Save