diff options
Diffstat (limited to 'kdesktop/kdiconview.cpp')
-rw-r--r-- | kdesktop/kdiconview.cpp | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/kdesktop/kdiconview.cpp b/kdesktop/kdiconview.cpp index 409887784..70f1010b7 100644 --- a/kdesktop/kdiconview.cpp +++ b/kdesktop/kdiconview.cpp @@ -27,7 +27,7 @@ #include <tdeapplication.h> #include <kcolordrag.h> #include <kdebug.h> -#include <kdesktopfile.h> +#include <tdedesktopfile.h> #include <kdirlister.h> #include <tdeglobalsettings.h> #include <kpropertiesdialog.h> @@ -42,7 +42,7 @@ #include <kivfreespaceoverlay.h> #include <kprotocolinfo.h> #include <kstdaction.h> -#include <kstandarddirs.h> +#include <tdestandarddirs.h> #include <kurldrag.h> #include <twin.h> #include <twinmodule.h> @@ -74,7 +74,7 @@ TQRect KDIconView::desktopRect() // ----------------------------------------------------------------------------- -void KDIconView::saveIconPosition(KSimpleConfig *config, int x, int y) +void KDIconView::saveIconPosition(TDESimpleConfig *config, int x, int y) { // save the icon position in absolute coordinates config->writeEntry("Xabs", x); @@ -90,7 +90,7 @@ void KDIconView::saveIconPosition(KSimpleConfig *config, int x, int y) // ----------------------------------------------------------------------------- -void KDIconView::readIconPosition(KSimpleConfig *config, int &x, int &y) +void KDIconView::readIconPosition(TDESimpleConfig *config, int &x, int &y) { // check if we have the position for the current desktop size TQRect desk = desktopRect(); @@ -138,7 +138,7 @@ KDIconView::KDIconView( TQWidget *parent, const char* name ) m_bNeedSave( false ), m_autoAlign( false ), m_hasExistingPos( false ), - m_bEditableDesktopIcons( kapp->authorize("editable_desktop_icons") ), + m_bEditableDesktopIcons( tdeApp->authorize("editable_desktop_icons") ), m_bShowDot( false ), m_bVertAlign( true ), m_dirLister( 0L ), @@ -162,32 +162,32 @@ KDIconView::KDIconView( TQWidget *parent, const char* name ) // Initialize media handler mMediaListView = new TQListView(); - connect( TQApplication::clipboard(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotClipboardDataChanged()) ); + connect( TQApplication::clipboard(), TQ_SIGNAL(dataChanged()), this, TQ_SLOT(slotClipboardDataChanged()) ); setURL( desktopURL() ); // sets m_url m_desktopDirs = TDEGlobal::dirs()->findDirs( "appdata", "Desktop" ); initDotDirectories(); - connect( this, TQT_SIGNAL( executed( TQIconViewItem * ) ), - TQT_SLOT( slotExecuted( TQIconViewItem * ) ) ); - connect( this, TQT_SIGNAL( returnPressed( TQIconViewItem * ) ), - TQT_SLOT( slotReturnPressed( TQIconViewItem * ) ) ); - connect( this, TQT_SIGNAL( mouseButtonPressed(int, TQIconViewItem*, const TQPoint&)), - TQT_SLOT( slotMouseButtonPressed(int, TQIconViewItem*, const TQPoint&)) ); - connect( this, TQT_SIGNAL( mouseButtonClicked(int, TQIconViewItem*, const TQPoint&)), - TQT_SLOT( slotMouseButtonClickedKDesktop(int, TQIconViewItem*, const TQPoint&)) ); - connect( this, TQT_SIGNAL( contextMenuRequested(TQIconViewItem*, const TQPoint&)), - TQT_SLOT( slotContextMenuRequested(TQIconViewItem*, const TQPoint&)) ); + connect( this, TQ_SIGNAL( executed( TQIconViewItem * ) ), + TQ_SLOT( slotExecuted( TQIconViewItem * ) ) ); + connect( this, TQ_SIGNAL( returnPressed( TQIconViewItem * ) ), + TQ_SLOT( slotReturnPressed( TQIconViewItem * ) ) ); + connect( this, TQ_SIGNAL( mouseButtonPressed(int, TQIconViewItem*, const TQPoint&)), + TQ_SLOT( slotMouseButtonPressed(int, TQIconViewItem*, const TQPoint&)) ); + connect( this, TQ_SIGNAL( mouseButtonClicked(int, TQIconViewItem*, const TQPoint&)), + TQ_SLOT( slotMouseButtonClickedKDesktop(int, TQIconViewItem*, const TQPoint&)) ); + connect( this, TQ_SIGNAL( contextMenuRequested(TQIconViewItem*, const TQPoint&)), + TQ_SLOT( slotContextMenuRequested(TQIconViewItem*, const TQPoint&)) ); - connect( this, TQT_SIGNAL( enableAction( const char * , bool ) ), - TQT_SLOT( slotEnableAction( const char * , bool ) ) ); + connect( this, TQ_SIGNAL( enableAction( const char * , bool ) ), + TQ_SLOT( slotEnableAction( const char * , bool ) ) ); // Hack: KonqIconViewWidget::slotItemRenamed is not virtual :-( - disconnect( this, TQT_SIGNAL(itemRenamed(TQIconViewItem *, const TQString &)), - this, TQT_SLOT(slotItemRenamed(TQIconViewItem *, const TQString &)) ); - connect( this, TQT_SIGNAL(itemRenamed(TQIconViewItem *, const TQString &)), - this, TQT_SLOT(slotItemRenamed(TQIconViewItem *, const TQString &)) ); + disconnect( this, TQ_SIGNAL(itemRenamed(TQIconViewItem *, const TQString &)), + this, TQ_SLOT(slotItemRenamed(TQIconViewItem *, const TQString &)) ); + connect( this, TQ_SIGNAL(itemRenamed(TQIconViewItem *, const TQString &)), + this, TQ_SLOT(slotItemRenamed(TQIconViewItem *, const TQString &)) ); if (!m_bEditableDesktopIcons) { @@ -226,7 +226,7 @@ void KDIconView::initDotDirectories() delete m_dotDirectory; - m_dotDirectory = new KSimpleConfig( dotFileName ); + m_dotDirectory = new TDESimpleConfig( dotFileName ); // If we don't allow editable desktop icons, empty m_dotDirectory if (!m_bEditableDesktopIcons) { @@ -248,7 +248,7 @@ void KDIconView::initDotDirectories() if (TQFile::exists(localDotFileName)) { - KSimpleConfig dotDir(localDotFileName, true); // Read only + TDESimpleConfig dotDir(localDotFileName, true); // Read only TQStringList groups = dotDir.groupList(); TQStringList::ConstIterator gIt = groups.begin(); @@ -370,16 +370,16 @@ void KDIconView::start() m_bNeedSave = false; - connect( m_dirLister, TQT_SIGNAL( clear() ), this, TQT_SLOT( slotClear() ) ); - connect( m_dirLister, TQT_SIGNAL( started(const KURL&) ), this, TQT_SLOT( slotStarted(const KURL&) ) ); - connect( m_dirLister, TQT_SIGNAL( completed() ), this, TQT_SLOT( slotCompleted() ) ); - connect( m_dirLister, TQT_SIGNAL( newItems( const KFileItemList & ) ), this, TQT_SLOT( slotNewItems( const KFileItemList & ) ) ); - connect( m_dirLister, TQT_SIGNAL( deleteItem( KFileItem * ) ), this, TQT_SLOT( slotDeleteItem( KFileItem * ) ) ); - connect( m_dirLister, TQT_SIGNAL( refreshItems( const KFileItemList & ) ), this, TQT_SLOT( slotRefreshItems( const KFileItemList & ) ) ); + connect( m_dirLister, TQ_SIGNAL( clear() ), this, TQ_SLOT( slotClear() ) ); + connect( m_dirLister, TQ_SIGNAL( started(const KURL&) ), this, TQ_SLOT( slotStarted(const KURL&) ) ); + connect( m_dirLister, TQ_SIGNAL( completed() ), this, TQ_SLOT( slotCompleted() ) ); + connect( m_dirLister, TQ_SIGNAL( newItems( const KFileItemList & ) ), this, TQ_SLOT( slotNewItems( const KFileItemList & ) ) ); + connect( m_dirLister, TQ_SIGNAL( deleteItem( KFileItem * ) ), this, TQ_SLOT( slotDeleteItem( KFileItem * ) ) ); + connect( m_dirLister, TQ_SIGNAL( refreshItems( const KFileItemList & ) ), this, TQ_SLOT( slotRefreshItems( const KFileItemList & ) ) ); // Start the directory lister ! m_dirLister->setShowingDotFiles( m_bShowDot ); - kapp->allowURLAction("list", KURL(), url()); + tdeApp->allowURLAction("list", KURL(), url()); startDirLister(); createActions(); } @@ -420,35 +420,35 @@ void KDIconView::createActions() { if (m_bEditableDesktopIcons) { - TDEAction *undo = KStdAction::undo( KonqUndoManager::self(), TQT_SLOT( undo() ), &m_actionCollection, "undo" ); - connect( KonqUndoManager::self(), TQT_SIGNAL( undoAvailable( bool ) ), - undo, TQT_SLOT( setEnabled( bool ) ) ); - connect( KonqUndoManager::self(), TQT_SIGNAL( undoTextChanged( const TQString & ) ), - undo, TQT_SLOT( setText( const TQString & ) ) ); + TDEAction *undo = KStdAction::undo( KonqUndoManager::self(), TQ_SLOT( undo() ), &m_actionCollection, "undo" ); + connect( KonqUndoManager::self(), TQ_SIGNAL( undoAvailable( bool ) ), + undo, TQ_SLOT( setEnabled( bool ) ) ); + connect( KonqUndoManager::self(), TQ_SIGNAL( undoTextChanged( const TQString & ) ), + undo, TQ_SLOT( setText( const TQString & ) ) ); undo->setEnabled( KonqUndoManager::self()->undoAvailable() ); - TDEAction* paCut = KStdAction::cut( TQT_TQOBJECT(this), TQT_SLOT( slotCut() ), &m_actionCollection, "cut" ); + TDEAction* paCut = KStdAction::cut( this, TQ_SLOT( slotCut() ), &m_actionCollection, "cut" ); TDEShortcut cutShortCut = paCut->shortcut(); cutShortCut.remove( KKey( SHIFT + Key_Delete ) ); // used for deleting files paCut->setShortcut( cutShortCut ); - KStdAction::copy( TQT_TQOBJECT(this), TQT_SLOT( slotCopy() ), &m_actionCollection, "copy" ); - KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotPaste() ), &m_actionCollection, "paste" ); - TDEAction *pasteTo = KStdAction::paste( TQT_TQOBJECT(this), TQT_SLOT( slotPopupPasteTo() ), &m_actionCollection, "pasteto" ); + KStdAction::copy( this, TQ_SLOT( slotCopy() ), &m_actionCollection, "copy" ); + KStdAction::paste( this, TQ_SLOT( slotPaste() ), &m_actionCollection, "paste" ); + TDEAction *pasteTo = KStdAction::paste( this, TQ_SLOT( slotPopupPasteTo() ), &m_actionCollection, "pasteto" ); pasteTo->setEnabled( false ); // only enabled during popupMenu() TDEShortcut reloadShortcut = TDEStdAccel::shortcut(TDEStdAccel::Reload); - new TDEAction( i18n( "&Reload" ), "reload", reloadShortcut, TQT_TQOBJECT(this), TQT_SLOT( refreshIcons() ), &m_actionCollection, "reload" ); + new TDEAction( i18n( "&Reload" ), "reload", reloadShortcut, this, TQ_SLOT( refreshIcons() ), &m_actionCollection, "reload" ); - (void) new TDEAction( i18n( "&Rename" ), /*"editrename",*/ Key_F2, TQT_TQOBJECT(this), TQT_SLOT( renameSelectedItem() ), &m_actionCollection, "rename" ); - (void) new TDEAction( i18n( "&Properties" ), ALT+Key_Return, TQT_TQOBJECT(this), TQT_SLOT( slotProperties() ), &m_actionCollection, "properties" ); + (void) new TDEAction( i18n( "&Rename" ), /*"editrename",*/ Key_F2, this, TQ_SLOT( renameSelectedItem() ), &m_actionCollection, "rename" ); + (void) new TDEAction( i18n( "&Properties" ), ALT+Key_Return, this, TQ_SLOT( slotProperties() ), &m_actionCollection, "properties" ); TDEAction* trash = new TDEAction( i18n( "&Move to Trash" ), "edittrash", Key_Delete, &m_actionCollection, "trash" ); - connect( trash, TQT_SIGNAL( activated( TDEAction::ActivationReason, TQt::ButtonState ) ), - this, TQT_SLOT( slotTrashActivated( TDEAction::ActivationReason, TQt::ButtonState ) ) ); + connect( trash, TQ_SIGNAL( activated( TDEAction::ActivationReason, TQt::ButtonState ) ), + this, TQ_SLOT( slotTrashActivated( TDEAction::ActivationReason, TQt::ButtonState ) ) ); TDEConfig config("kdeglobals", true, false); config.setGroup( "KDE" ); - (void) new TDEAction( i18n( "&Delete" ), "edit-delete", SHIFT+Key_Delete, TQT_TQOBJECT(this), TQT_SLOT( slotDelete() ), &m_actionCollection, "del" ); + (void) new TDEAction( i18n( "&Delete" ), "edit-delete", SHIFT+Key_Delete, this, TQ_SLOT( slotDelete() ), &m_actionCollection, "del" ); // Initial state of the actions (cut/copy/paste/...) slotSelectionChanged(); @@ -526,8 +526,8 @@ void KDIconView::setAutoAlign( bool b ) else { KRootWm::self()->startup = false; } - connect( this, TQT_SIGNAL( iconMoved() ), - this, TQT_SLOT( lineupIcons() ) ); + connect( this, TQ_SIGNAL( iconMoved() ), + this, TQ_SLOT( lineupIcons() ) ); } else { // change maxItemWidth, because when grid-align was active, it changed this for the grid @@ -535,8 +535,8 @@ void KDIconView::setAutoAlign( bool b ) setMaxItemWidth( TQMAX( TQMAX( sz, previewIconSize( iconSize() ) ), KonqFMSettings::settings()->iconTextWidth() ) ); setFont( font() ); // Force calcRect() - disconnect( this, TQT_SIGNAL( iconMoved() ), - this, TQT_SLOT( lineupIcons() ) ); + disconnect( this, TQ_SIGNAL( iconMoved() ), + this, TQ_SLOT( lineupIcons() ) ); } } @@ -566,7 +566,7 @@ void KDIconView::startDirLister() u.setPath( *it ); m_mergeDirs.append( u ); // And start listing this dir right now - kapp->allowURLAction("list", KURL(), u); + tdeApp->allowURLAction("list", KURL(), u); m_dirLister->openURL( u, true ); } configureMedia(); @@ -650,7 +650,7 @@ void KDIconView::contentsMousePressEvent( TQMouseEvent *e ) if (!m_dirLister) return; //kdDebug(1204) << "KDIconView::contentsMousePressEvent" << endl; // TQIconView, as of Qt 2.2, doesn't emit mouseButtonPressed for LMB on background - if ( e->button() == Qt::LeftButton && KRootWm::self()->hasLeftButtonMenu() ) + if ( e->button() == TQt::LeftButton && KRootWm::self()->hasLeftButtonMenu() ) { TQIconViewItem *item = findItem( e->pos() ); if ( !item ) @@ -676,7 +676,7 @@ void KDIconView::wheelEvent( TQWheelEvent* e ) TQIconViewItem *item = findItem( e->pos() ); if ( !item ) { - TQWheelEvent *we = TQT_TQWHEELEVENT(e); + TQWheelEvent *we = static_cast<TQWheelEvent*>(e); if ( we->state() == ControlButton ) { @@ -731,7 +731,7 @@ void KDIconView::slotMouseButtonClickedKDesktop(int _button, TQIconViewItem* _it { if (!m_dirLister) return; //kdDebug(1204) << "KDIconView::slotMouseButtonClickedKDesktop" << endl; - if ( _item && _button == Qt::MidButton ) { + if ( _item && _button == TQt::MidButton ) { slotExecuted(_item); } } @@ -749,7 +749,7 @@ void KDIconView::slotReturnPressed( TQIconViewItem *item ) void KDIconView::slotExecuted( TQIconViewItem *item ) { - kapp->propagateSessionManager(); + tdeApp->propagateSessionManager(); m_lastDeletedIconPos = TQPoint(); // user action -> not renaming an icon if (item) { visualActivate(item); @@ -839,7 +839,7 @@ void KDIconView::saveMediaListView() appname = "kdesktop"; else appname.sprintf("kdesktop-screen-%d", konq_screen_number); - kapp->dcopClient()->send( appname, "KDesktopIface", "configure()", data ); + tdeApp->dcopClient()->send( appname, "KDesktopIface", "configure()", data ); delete g_pConfig; } @@ -906,7 +906,7 @@ bool KDIconView::deleteGlobalDesktopFiles() // Web Browser kfmclient openBrowser %u Application TDE; if ( isDesktopFile(fItem) ) { - KSimpleConfig cfg( fItem->url().path(), true ); + TDESimpleConfig cfg( fItem->url().path(), true ); cfg.setDesktopGroup(); if ( cfg.readEntry( "X-Trinity-BuiltIn" ) == "true" ) { removeBuiltinIcon(cfg.readEntry( "Name" )); @@ -914,7 +914,7 @@ bool KDIconView::deleteGlobalDesktopFiles() } } - KDesktopFile df(desktopPath + fItem->url().fileName()); + TDEDesktopFile df(desktopPath + fItem->url().fileName()); df.writeEntry("Hidden", true); df.sync(); @@ -947,7 +947,7 @@ void KDIconView::slotDelete() // Not to be confused with the global popup-menu, KRootWm, when doing RMB on the desktop void KDIconView::popupMenu( const TQPoint &_global, const KFileItemList& _items ) { - if (!kapp->authorize("action/kdesktop_rmb")) return; + if (!tdeApp->authorize("action/kdesktop_rmb")) return; if (!m_dirLister) return; if ( _items.count() == 1 ) m_popupURL = _items.getFirst()->url(); @@ -1062,7 +1062,7 @@ bool KDIconView::makeFriendlyText( KFileIVI *fileIVI ) if ( !desktopFile.isEmpty() ) { - KSimpleConfig cfg( desktopFile, true ); + TDESimpleConfig cfg( desktopFile, true ); cfg.setDesktopGroup(); if (cfg.readBoolEntry("Hidden")) { return false; @@ -1145,7 +1145,7 @@ void KDIconView::slotNewItems( const KFileItemList & entries ) if (m_nextItemPos.isNull() && !m_dotDirectory) { // Not found, we'll need to save the new pos kdDebug(1214)<<"Neither a drop position stored nor m_dotDirectory set"<<endl; - m_dotDirectory = new KSimpleConfig( dotDirectoryPath(), true ); + m_dotDirectory = new TDESimpleConfig( dotDirectoryPath(), true ); // recursion slotNewItems( entries ); delete m_dotDirectory; @@ -1406,7 +1406,7 @@ void KDIconView::refreshTrashIcon() KFileIVI * fileIVI = static_cast<KFileIVI *>(it); KFileItem* item = fileIVI->item(); if ( isDesktopFile( item ) ) { - KSimpleConfig cfg( item->url().path(), true ); + TDESimpleConfig cfg( item->url().path(), true ); cfg.setDesktopGroup(); if ( cfg.readEntry( "Type" ) == "Link" && cfg.readEntry( "URL" ) == "trash:/" ) { @@ -1446,7 +1446,7 @@ void KDIconView::showFreeSpaceOverlay(KFileIVI* item) if (!m_paOutstandingFreeSpaceOverlaysTimer) { m_paOutstandingFreeSpaceOverlaysTimer = new TQTimer(this); - connect(m_paOutstandingFreeSpaceOverlaysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(slotFreeSpaceOverlayStart())); + connect(m_paOutstandingFreeSpaceOverlaysTimer, TQ_SIGNAL(timeout()), TQ_SLOT(slotFreeSpaceOverlayStart())); } m_paOutstandingFreeSpaceOverlaysTimer->start(20, true); } @@ -1466,7 +1466,7 @@ void KDIconView::slotFreeSpaceOverlayStart() if (overlay) { - connect( overlay, TQT_SIGNAL( finished() ), this, TQT_SLOT( slotFreeSpaceOverlayFinished() ) ); + connect( overlay, TQ_SIGNAL( finished() ), this, TQ_SLOT( slotFreeSpaceOverlayFinished() ) ); overlay->start(); // Watch out, may emit finished() immediately!! return; // Let it run.... } @@ -1578,7 +1578,7 @@ void KDIconView::slotClipboardDataChanged() void KDIconView::renameDesktopFile(const TQString &path, const TQString &name) { - KDesktopFile cfg( path, false ); + TDEDesktopFile cfg( path, false ); // if we don't have the desktop entry group, then we assume that // it's not a config file (and we don't nuke it!) @@ -1667,7 +1667,7 @@ void KDIconView::slotAboutToCreate(const TQPoint &pos, const TQValueList<TDEIO:: saveIconPosition(m_dotDirectory, m_lastDropPos.x(), m_lastDropPos.y()); int dX = m_lastDropPos.x() - m_dropPos.x(); int dY = m_lastDropPos.y() - m_dropPos.y(); - if ((QABS(dX) > QABS(dY)) || (m_lastDropPos.x() + 2*gridX > width())) + if ((TQABS(dX) > TQABS(dY)) || (m_lastDropPos.x() + 2*gridX > width())) m_lastDropPos = TQPoint(m_dropPos.x(), m_lastDropPos.y() + gridY); else m_lastDropPos = TQPoint(m_lastDropPos.x() + gridX, m_lastDropPos.y()); @@ -1832,8 +1832,8 @@ void KDIconView::updateWorkArea( const TQRect &wr ) } } if ( needRepaint ) { - viewport()->repaint( FALSE ); - repaint( FALSE ); + viewport()->repaint( false ); + repaint( false ); saveIconPositions(); } @@ -1905,7 +1905,7 @@ bool KDIconView::isFreePosition( const TQIconViewItem *item, const TQRect &curre if (area.isNull()) area = iconArea(); // If the proposed item rect is not contained by the desktop, by definition the item position is not free! - if (!area.contains(r, FALSE)) { + if (!area.contains(r, false)) { return false; } @@ -1929,7 +1929,7 @@ bool KDIconView::isFreePosition( const TQIconViewItem *item, const TQRect& rect, if (area.isNull()) area = iconArea(); // If the proposed item rect is not contained by the desktop, by definition the item position is not free! - if (!area.contains(rect, FALSE)) { + if (!area.contains(rect, false)) { return false; } |