|
|
@ -70,7 +70,7 @@ Part::Part( TQWidget *parentWidget, const char *widgetName, TQObject *parent, co
|
|
|
|
connect( m_map, TQT_SIGNAL(giveMeTreeFor( const KURL& )), TQT_SLOT(openURL( const KURL& )) );
|
|
|
|
connect( m_map, TQT_SIGNAL(giveMeTreeFor( const KURL& )), TQT_SLOT(openURL( const KURL& )) );
|
|
|
|
|
|
|
|
|
|
|
|
connect( m_manager, TQT_SIGNAL(completed( Directory* )), TQT_SLOT(scanCompleted( Directory* )) );
|
|
|
|
connect( m_manager, TQT_SIGNAL(completed( Directory* )), TQT_SLOT(scanCompleted( Directory* )) );
|
|
|
|
connect( m_manager, TQT_SIGNAL(aboutToEmptyCache()), m_map, TQT_SLOT(tqinvalidate()) );
|
|
|
|
connect( m_manager, TQT_SIGNAL(aboutToEmptyCache()), m_map, TQT_SLOT(invalidate()) );
|
|
|
|
|
|
|
|
|
|
|
|
TQTimer::singleShot( 0, this, TQT_SLOT(postInit()) );
|
|
|
|
TQTimer::singleShot( 0, this, TQT_SLOT(postInit()) );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -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" ).tqarg( path ) );
|
|
|
|
KMSG( i18n( "Filelight only accepts absolute paths, eg. /%1" ).arg( 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" ).tqarg( path ) );
|
|
|
|
KMSG( i18n( "Directory not found: %1" ).arg( 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." ).tqarg( path ) );
|
|
|
|
KMSG( i18n( "Unable to enter: %1\nYou do not have access rights to this location." ).arg( path ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -192,12 +192,12 @@ Part::start( const KURL &url )
|
|
|
|
if( m_manager->start( url ) ) {
|
|
|
|
if( m_manager->start( url ) ) {
|
|
|
|
m_url = url;
|
|
|
|
m_url = url;
|
|
|
|
|
|
|
|
|
|
|
|
const TQString s = i18n( "Scanning: %1" ).tqarg( prettyURL() );
|
|
|
|
const TQString s = i18n( "Scanning: %1" ).arg( 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->tqinvalidate(); //to maintain ui consistency
|
|
|
|
m_map->invalidate(); //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 tqinvalidate
|
|
|
|
m_manager->emptyCache(); //causes canvas to invalidate
|
|
|
|
start( m_url );
|
|
|
|
start( m_url );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -226,7 +226,7 @@ Part::scanCompleted( Directory *tree )
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
stateChanged( "scan_failed" );
|
|
|
|
stateChanged( "scan_failed" );
|
|
|
|
emit canceled( i18n( "Scan failed: %1" ).tqarg( prettyURL() ) );
|
|
|
|
emit canceled( i18n( "Scan failed: %1" ).arg( prettyURL() ) );
|
|
|
|
emit setWindowCaption( TQString() );
|
|
|
|
emit setWindowCaption( TQString() );
|
|
|
|
|
|
|
|
|
|
|
|
statusBar()->clear();
|
|
|
|
statusBar()->clear();
|
|
|
@ -246,7 +246,7 @@ Part::mapChanged( const Directory *tree )
|
|
|
|
ProgressBox *progress = static_cast<ProgressBox *>(TQT_TQWIDGET(statusBar()->child( "ProgressBox" )));
|
|
|
|
ProgressBox *progress = static_cast<ProgressBox *>(TQT_TQWIDGET(statusBar()->child( "ProgressBox" )));
|
|
|
|
|
|
|
|
|
|
|
|
if( progress )
|
|
|
|
if( progress )
|
|
|
|
progress->setText( tree->tqchildren() );
|
|
|
|
progress->setText( tree->children() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} //namespace Filelight
|
|
|
|
} //namespace Filelight
|
|
|
|