Rename a number of classes to enhance compatibility with KDE4

pull/1/head
Timothy Pearson 11 years ago
parent 401bc51c19
commit 1d88613b6b

@ -9,12 +9,12 @@
inline inline
HistoryAction::HistoryAction( const TQString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name ) HistoryAction::HistoryAction( const TQString &text, const char *icon, const TDEShortcut &cut, TDEActionCollection *ac, const char *name )
: KAction( text, icon, cut, 0, 0, ac, name ) : TDEAction( text, icon, cut, 0, 0, ac, name )
, m_text( text ) , m_text( text )
{ {
// ui files make this false, but we can't rely on UI file as it isn't compiled in :( // ui files make this false, but we can't rely on UI file as it isn't compiled in :(
KAction::setEnabled( false ); TDEAction::setEnabled( false );
} }
void void
@ -24,7 +24,7 @@ HistoryAction::push( const TQString &path )
{ {
m_list.append( path ); m_list.append( path );
setActionMenuTextOnly( this, path ); setActionMenuTextOnly( this, path );
KAction::setEnabled( true ); TDEAction::setEnabled( true );
} }
} }
@ -40,10 +40,10 @@ HistoryAction::pop()
HistoryCollection::HistoryCollection( KActionCollection *ac, TQObject *parent, const char *name ) HistoryCollection::HistoryCollection( TDEActionCollection *ac, TQObject *parent, const char *name )
: TQObject( parent, name ) : TQObject( parent, name )
, m_b( new HistoryAction( i18n( "Back" ), "back", KStdAccel::back(), ac, "go_back" ) ) , m_b( new HistoryAction( i18n( "Back" ), "back", TDEStdAccel::back(), ac, "go_back" ) )
, m_f( new HistoryAction( i18n( "Forward" ), "forward", KStdAccel::forward(), ac, "go_forward" ) ) , m_f( new HistoryAction( i18n( "Forward" ), "forward", TDEStdAccel::forward(), ac, "go_forward" ) )
, m_receiver( 0 ) , m_receiver( 0 )
{ {
connect( m_b, TQT_SIGNAL(activated()), TQT_SLOT(pop()) ); connect( m_b, TQT_SIGNAL(activated()), TQT_SLOT(pop()) );

@ -12,19 +12,19 @@ class TDEConfig;
/// defined in mainWindow.cpp /// defined in mainWindow.cpp
void setActionMenuTextOnly( KAction *a, TQString const &suffix ); void setActionMenuTextOnly( TDEAction *a, TQString const &suffix );
class HistoryAction : KAction class HistoryAction : TDEAction
{ {
HistoryAction( const TQString &text, const char *icon, const KShortcut &cut, KActionCollection *ac, const char *name ); HistoryAction( const TQString &text, const char *icon, const TDEShortcut &cut, TDEActionCollection *ac, const char *name );
friend class HistoryCollection; friend class HistoryCollection;
public: public:
virtual void setEnabled( bool b = true ) { KAction::setEnabled( b ? !m_list.isEmpty() : false ); } virtual void setEnabled( bool b = true ) { TDEAction::setEnabled( b ? !m_list.isEmpty() : false ); }
void clear() { m_list.clear(); KAction::setText( m_text ); } void clear() { m_list.clear(); TDEAction::setText( m_text ); }
private: private:
void setText(); void setText();
@ -43,7 +43,7 @@ Q_OBJECT
public: public:
HistoryCollection( KActionCollection *ac, TQObject *parent, const char *name ); HistoryCollection( TDEActionCollection *ac, TQObject *parent, const char *name );
void save( TDEConfig *config ); void save( TDEConfig *config );
void restore( TDEConfig *config ); void restore( TDEConfig *config );

@ -6,7 +6,7 @@
#include "historyAction.h" #include "historyAction.h"
#include <cstdlib> //std::exit() #include <cstdlib> //std::exit()
#include <kaccel.h> //KStdAccel namespace #include <kaccel.h> //TDEStdAccel namespace
#include <kaction.h> #include <kaction.h>
#include <kapplication.h> //setupActions() #include <kapplication.h> //setupActions()
#include <kcombobox.h> //locationbar #include <kcombobox.h> //locationbar
@ -52,7 +52,7 @@ 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?
TQObjectList *buttons = toolBar()->queryList( "KToolBarButton" ); TQObjectList *buttons = toolBar()->queryList( "TDEToolBarButton" );
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;
@ -74,7 +74,7 @@ MainWindow::MainWindow()
inline void inline void
MainWindow::setupActions() //singleton function MainWindow::setupActions() //singleton function
{ {
KActionCollection *const ac = actionCollection(); TDEActionCollection *const ac = actionCollection();
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 ) );
@ -88,15 +88,15 @@ MainWindow::setupActions() //singleton function
KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configToolbars()), ac); KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(configToolbars()), ac);
KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configKeys()), ac); KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(configKeys()), ac);
new KAction( i18n( "Scan &Home Directory" ), "folder_home", CTRL+Key_Home, TQT_TQOBJECT(this), TQT_SLOT(slotScanHomeDirectory()), ac, "scan_home" ); new TDEAction( 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, TQT_TQOBJECT(this), TQT_SLOT(slotScanRootDirectory()), ac, "scan_root" ); new TDEAction( i18n( "Scan &Root Directory" ), "folder_red", 0, TQT_TQOBJECT(this), TQT_SLOT(slotScanRootDirectory()), ac, "scan_root" );
new KAction( i18n( "Rescan" ), "reload", KStdAccel::reload(), TQT_TQOBJECT(m_part), TQT_SLOT(rescan()), ac, "scan_rescan" ); new TDEAction( i18n( "Rescan" ), "reload", TDEStdAccel::reload(), TQT_TQOBJECT(m_part), TQT_SLOT(rescan()), ac, "scan_rescan" );
new KAction( i18n( "Stop" ), "stop", TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(slotAbortScan()), ac, "scan_stop" ); new TDEAction( i18n( "Stop" ), "stop", TQt::Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(slotAbortScan()), ac, "scan_stop" );
new KAction( i18n( "Clear Location Bar" ), TDEApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, TQT_TQOBJECT(m_combo), TQT_SLOT(clearEdit()), ac, "clear_location" ); new TDEAction( i18n( "Clear Location Bar" ), TDEApplication::reverseLayout() ? "clear_left" : "locationbar_erase", 0, TQT_TQOBJECT(m_combo), TQT_SLOT(clearEdit()), ac, "clear_location" );
new KAction( i18n( "Go" ), "key_enter", 0, TQT_TQOBJECT(m_combo), TQT_SIGNAL(returnPressed()), ac, "go" ); new TDEAction( 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 TDERecentFilesAction( i18n( "&Recent Scans" ), 0, ac, "scan_recent", 8 );
m_histories = new HistoryCollection( ac, TQT_TQOBJECT(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..." ) );
@ -176,7 +176,7 @@ MainWindow::slotScanUrl( const KURL &url )
if (b) { if (b) {
m_histories->push( oldUrl ); m_histories->push( oldUrl );
action( "go_back" )->KAction::setEnabled( false ); } //FIXME action( "go_back" )->TDEAction::setEnabled( false ); } //FIXME
return b; return b;
} }
@ -205,7 +205,7 @@ MainWindow::scanFailed()
void void
MainWindow::scanCompleted() MainWindow::scanCompleted()
{ {
KAction *goUp = action( "go_up" ); TDEAction *goUp = action( "go_up" );
const KURL url = m_part->url(); const KURL url = m_part->url();
stateChanged( "scan_complete" ); stateChanged( "scan_complete" );
@ -256,7 +256,7 @@ MainWindow::readProperties( TDEConfig *config ) //virtual
/// declared in historyAction.h /// declared in historyAction.h
void setActionMenuTextOnly( KAction *a, TQString const &suffix ) void setActionMenuTextOnly( TDEAction *a, TQString const &suffix )
{ {
TQString const menu_text = suffix.isEmpty() TQString const menu_text = suffix.isEmpty()
? a->text() ? a->text()
@ -269,9 +269,9 @@ void setActionMenuTextOnly( KAction *a, TQString const &suffix )
if (w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING )) if (w->inherits( TQPOPUPMENU_OBJECT_NAME_STRING ))
static_cast<TQPopupMenu*>(w)->changeItem( id, menu_text ); static_cast<TQPopupMenu*>(w)->changeItem( id, menu_text );
else if (w->inherits( "KToolBar" )) { else if (w->inherits( "TDEToolBar" )) {
TQWidget *button = static_cast<KToolBar*>(w)->getWidget( id ); TQWidget *button = static_cast<TDEToolBar*>(w)->getWidget( id );
if (button->inherits( "KToolBarButton" )) if (button->inherits( "TDEToolBarButton" ))
TQToolTip::add( button, suffix ); TQToolTip::add( button, suffix );
} }
} }

@ -22,8 +22,8 @@
class KSqueezedTextLabel; class KSqueezedTextLabel;
class KHistoryCombo; class KHistoryCombo;
class KAction; class TDEAction;
class KRecentFilesAction; class TDERecentFilesAction;
class ScanProgressBox; class ScanProgressBox;
class HistoryCollection; class HistoryCollection;
@ -73,7 +73,7 @@ class MainWindow : public KParts::MainWindow
KSqueezedTextLabel *m_status[2]; KSqueezedTextLabel *m_status[2];
KHistoryCombo *m_combo; KHistoryCombo *m_combo;
HistoryCollection *m_histories; HistoryCollection *m_histories;
KRecentFilesAction *m_recentScans; TDERecentFilesAction *m_recentScans;
void setupStatusBar(); void setupStatusBar();
void setupActions(); void setupActions();

@ -158,7 +158,7 @@ RadialMap::Widget::mousePressEvent( TQMouseEvent *e )
if( e->button() == Qt::RightButton ) if( e->button() == Qt::RightButton )
{ {
KPopupMenu popup; TDEPopupMenu popup;
popup.insertTitle( m_focus->file()->fullPath( m_tree ) ); popup.insertTitle( m_focus->file()->fullPath( m_tree ) );
if (isDir) { if (isDir) {

Loading…
Cancel
Save