From 6240d69b1f11d3e6c59df5f736549b1fafc49dd0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 14:58:49 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- src/dolphin.cpp | 134 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 67 insertions(+), 67 deletions(-) (limited to 'src/dolphin.cpp') diff --git a/src/dolphin.cpp b/src/dolphin.cpp index bd9a46a..98abe71 100644 --- a/src/dolphin.cpp +++ b/src/dolphin.cpp @@ -123,7 +123,7 @@ void Dolphin::dropURLs(const KURL::List& urls, } else { // no shortcut is used, hence open a popup menu - KPopupMenu popup(this); + TDEPopupMenu popup(this); popup.insertItem(SmallIcon("goto"), i18n("&Move Here") + "\t" + KKey::modFlagLabel(KKey::SHIFT), 0); popup.insertItem(SmallIcon("editcopy"), i18n( "&Copy Here" ) + "\t" + KKey::modFlagLabel(KKey::CTRL), 1); @@ -232,21 +232,21 @@ void Dolphin::slotViewModeChanged() void Dolphin::slotShowHiddenFilesChanged() { - KToggleAction* showHiddenFilesAction = - static_cast(actionCollection()->action("show_hidden_files")); + TDEToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); showHiddenFilesAction->setChecked(m_activeView->isShowHiddenFilesEnabled()); } void Dolphin::slotShowFilterBarChanged() { - KToggleAction* showFilterBarAction = - static_cast(actionCollection()->action("show_filter_bar")); + TDEToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); showFilterBarAction->setChecked(m_activeView->isFilterBarVisible()); } void Dolphin::slotSortingChanged(DolphinView::Sorting sorting) { - KAction* action = 0; + TDEAction* action = 0; switch (sorting) { case DolphinView::SortByName: action = actionCollection()->action("by_name"); @@ -262,14 +262,14 @@ void Dolphin::slotSortingChanged(DolphinView::Sorting sorting) } if (action != 0) { - KToggleAction* toggleAction = static_cast(action); + TDEToggleAction* toggleAction = static_cast(action); toggleAction->setChecked(true); } } void Dolphin::slotSortOrderChanged(TQt::SortOrder order) { - KToggleAction* descending = static_cast(actionCollection()->action("descending")); + TDEToggleAction* descending = static_cast(actionCollection()->action("descending")); const bool sortDescending = (order == TQt::Descending); descending->setChecked(sortDescending); } @@ -284,7 +284,7 @@ void Dolphin::slotSelectionChanged() selectedURLsCount += m_view[SecondaryIdx]->selectedURLs().count(); } - KAction* compareFilesAction = actionCollection()->action("compare_files"); + TDEAction* compareFilesAction = actionCollection()->action("compare_files"); compareFilesAction->setEnabled(selectedURLsCount == 2); m_activeView->updateStatusBar(); @@ -317,7 +317,7 @@ void Dolphin::closeEvent(TQCloseEvent* event) settings.save(); config->sync(); - KMainWindow::closeEvent(event); + TDEMainWindow::closeEvent(event); } void Dolphin::saveProperties(TDEConfig* config) @@ -607,7 +607,7 @@ void Dolphin::slotDeleteFileFinished(TDEIO::Job* job) void Dolphin::slotUndoAvailable(bool available) { - KAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); + TDEAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); if (undoAction != 0) { undoAction->setEnabled(available); } @@ -615,7 +615,7 @@ void Dolphin::slotUndoAvailable(bool available) void Dolphin::slotUndoTextChanged(const TQString& text) { - KAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); + TDEAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo)); if (undoAction != 0) { undoAction->setText(text); } @@ -623,7 +623,7 @@ void Dolphin::slotUndoTextChanged(const TQString& text) void Dolphin::slotRedoAvailable(bool available) { - KAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); + TDEAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); if (redoAction != 0) { redoAction->setEnabled(available); } @@ -631,7 +631,7 @@ void Dolphin::slotRedoAvailable(bool available) void Dolphin::slotRedoTextChanged(const TQString& text) { - KAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); + TDEAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo)); if (redoAction != 0) { redoAction->setText(text); } @@ -697,7 +697,7 @@ void Dolphin::paste() void Dolphin::updatePasteAction() { - KAction* pasteAction = actionCollection()->action(KStdAction::stdName(KStdAction::Paste)); + TDEAction* pasteAction = actionCollection()->action(KStdAction::stdName(KStdAction::Paste)); if (pasteAction == 0) { return; } @@ -851,16 +851,16 @@ void Dolphin::showHiddenFiles() { clearStatusBar(); - const KToggleAction* showHiddenFilesAction = - static_cast(actionCollection()->action("show_hidden_files")); + const TDEToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); const bool show = showHiddenFilesAction->isChecked(); m_activeView->setShowHiddenFilesEnabled(show); } void Dolphin::showFilterBar() { - const KToggleAction* showFilterBarAction = - static_cast(actionCollection()->action("show_filter_bar")); + const TDEToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); const bool show = showFilterBarAction->isChecked(); m_activeView->slotShowFilterBar(show); } @@ -1066,7 +1066,7 @@ void Dolphin::addUndoOperation(TDEIO::Job* job) } Dolphin::Dolphin() : - KMainWindow(0, "D3lphin"), + TDEMainWindow(0, "D3lphin"), m_splitter(0), m_leftsidebar(0), m_rightsidebar(0), @@ -1164,7 +1164,7 @@ void Dolphin::loadSettings() { DolphinSettings& settings = DolphinSettings::instance(); - KToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); + TDEToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); if (settings.isViewSplit()) { splitAction->setChecked(true); toggleSplitView(); @@ -1176,26 +1176,26 @@ void Dolphin::loadSettings() void Dolphin::setupActions() { // setup 'File' menu - KAction* createFolder = new KAction(i18n("Folder..."), "Ctrl+N", + TDEAction* createFolder = new TDEAction(i18n("Folder..."), "Ctrl+N", TQT_TQOBJECT(this), TQT_SLOT(createFolder()), actionCollection(), "create_folder"); createFolder->setIcon("folder"); - new KAction(i18n("Rename"), KKey(Key_F2), + new TDEAction(i18n("Rename"), KKey(Key_F2), TQT_TQOBJECT(this), TQT_SLOT(rename()), actionCollection(), "rename"); - KAction* moveToTrashAction = new KAction(i18n("Move to Trash"), KKey(Key_Delete), + TDEAction* moveToTrashAction = new TDEAction(i18n("Move to Trash"), KKey(Key_Delete), TQT_TQOBJECT(this), TQT_SLOT(moveToTrash()), actionCollection(), "move_to_trash"); moveToTrashAction->setIcon("edittrash"); - KAction* deleteAction = new KAction(i18n("Delete"), "Shift+Delete", + TDEAction* deleteAction = new TDEAction(i18n("Delete"), "Shift+Delete", TQT_TQOBJECT(this), TQT_SLOT(deleteItems()), actionCollection(), "delete"); deleteAction->setIcon("editdelete"); - new KAction(i18n("Propert&ies"), "Alt+Return", + new TDEAction(i18n("Propert&ies"), "Alt+Return", TQT_TQOBJECT(this), TQT_SLOT(properties()), actionCollection(), "properties"); @@ -1223,11 +1223,11 @@ void Dolphin::setupActions() KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), actionCollection()); KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(paste()), actionCollection()); - new KAction(i18n("Select All"), "Ctrl+A", + new TDEAction(i18n("Select All"), "Ctrl+A", TQT_TQOBJECT(this), TQT_SLOT(selectAll()), actionCollection(), "select_all"); - new KAction(i18n("Invert Selection"), "Ctrl+Shift+A", + new TDEAction(i18n("Invert Selection"), "Ctrl+Shift+A", TQT_TQOBJECT(this), TQT_SLOT(invertSelection()), actionCollection(), "invert_selection"); @@ -1240,78 +1240,78 @@ void Dolphin::setupActions() TQT_SLOT(zoomOut()), actionCollection()); - KRadioAction* iconsView = new KRadioAction(i18n("Icons"), "Ctrl+1", + TDERadioAction* iconsView = new TDERadioAction(i18n("Icons"), "Ctrl+1", TQT_TQOBJECT(this), TQT_SLOT(setIconsView()), actionCollection(), "icons"); iconsView->setExclusiveGroup("view_mode"); iconsView->setIcon("view_icon"); - KRadioAction* detailsView = new KRadioAction(i18n("Details"), "Ctrl+2", + TDERadioAction* detailsView = new TDERadioAction(i18n("Details"), "Ctrl+2", TQT_TQOBJECT(this), TQT_SLOT(setDetailsView()), actionCollection(), "details"); detailsView->setExclusiveGroup("view_mode"); detailsView->setIcon("view_text"); - KRadioAction* previewsView = new KRadioAction(i18n("Previews"), "Ctrl+3", + TDERadioAction* previewsView = new TDERadioAction(i18n("Previews"), "Ctrl+3", TQT_TQOBJECT(this), TQT_SLOT(setPreviewsView()), actionCollection(), "previews"); previewsView->setExclusiveGroup("view_mode"); previewsView->setIcon("gvdirpart"); - KRadioAction* sortByName = new KRadioAction(i18n("By Name"), 0, + TDERadioAction* sortByName = new TDERadioAction(i18n("By Name"), 0, TQT_TQOBJECT(this), TQT_SLOT(sortByName()), actionCollection(), "by_name"); sortByName->setExclusiveGroup("sort"); - KRadioAction* sortBySize = new KRadioAction(i18n("By Size"), 0, + TDERadioAction* sortBySize = new TDERadioAction(i18n("By Size"), 0, TQT_TQOBJECT(this), TQT_SLOT(sortBySize()), actionCollection(), "by_size"); sortBySize->setExclusiveGroup("sort"); - KRadioAction* sortByDate = new KRadioAction(i18n("By Date"), 0, + TDERadioAction* sortByDate = new TDERadioAction(i18n("By Date"), 0, TQT_TQOBJECT(this), TQT_SLOT(sortByDate()), actionCollection(), "by_date"); sortByDate->setExclusiveGroup("sort"); - new KToggleAction(i18n("Descending"), 0, TQT_TQOBJECT(this), TQT_SLOT(toggleSortOrder()), + new TDEToggleAction(i18n("Descending"), 0, TQT_TQOBJECT(this), TQT_SLOT(toggleSortOrder()), actionCollection(), "descending"); - new KToggleAction(i18n("Show Hidden Files"), "Alt+.", + new TDEToggleAction(i18n("Show Hidden Files"), "Alt+.", TQT_TQOBJECT(this), TQT_SLOT(showHiddenFiles()), actionCollection(), "show_hidden_files"); - KToggleAction* splitAction = new KToggleAction(i18n("Split View"), "F10", + TDEToggleAction* splitAction = new TDEToggleAction(i18n("Split View"), "F10", TQT_TQOBJECT(this), TQT_SLOT(toggleSplitView()), actionCollection(), "split_view"); splitAction->setIcon("view_left_right"); - KAction* reloadAction = new KAction(i18n("Reload"), "F5", + TDEAction* reloadAction = new TDEAction(i18n("Reload"), "F5", TQT_TQOBJECT(this), TQT_SLOT(reloadView()), actionCollection(), "reload"); reloadAction->setIcon("reload"); - KAction* stopAction = new KAction(i18n("Stop"), 0, + TDEAction* stopAction = new TDEAction(i18n("Stop"), 0, TQT_TQOBJECT(this), TQT_SLOT(stopLoading()), actionCollection(), "stop"); stopAction->setIcon("stop"); - new KAction(i18n("Edit Location"), "Ctrl+L", + new TDEAction(i18n("Edit Location"), "Ctrl+L", TQT_TQOBJECT(this), TQT_SLOT(editLocation()), actionCollection(), "edit_location"); - new KAction(i18n("Browse"), "Ctrl+B", + new TDEAction(i18n("Browse"), "Ctrl+B", TQT_TQOBJECT(this), TQT_SLOT(browse()), actionCollection(), "browse"); - new KToggleAction(i18n("Left Sidebar"), "F8", + new TDEToggleAction(i18n("Left Sidebar"), "F8", TQT_TQOBJECT(this), TQT_SLOT(toggleleftSidebar()), actionCollection(), "leftsidebar"); - new KToggleAction(i18n("Right Sidebar"), "F9", + new TDEToggleAction(i18n("Right Sidebar"), "F9", TQT_TQOBJECT(this), TQT_SLOT(togglerightSidebar()), actionCollection(), "rightsidebar"); - new KAction(i18n("Adjust View Properties..."), 0, + new TDEAction(i18n("Adjust View Properties..."), 0, TQT_TQOBJECT(this), TQT_SLOT(adjustViewProperties()), actionCollection(), "view_properties"); @@ -1322,21 +1322,21 @@ void Dolphin::setupActions() KStdAction::home(TQT_TQOBJECT(this), TQT_SLOT(goHome()), actionCollection()); // setup 'Tools' menu - KAction* openTerminalAction = new KAction(i18n("Open Terminal"), "F4", + TDEAction* openTerminalAction = new TDEAction(i18n("Open Terminal"), "F4", TQT_TQOBJECT(this), TQT_SLOT(openTerminal()), actionCollection(), "open_terminal"); openTerminalAction->setIcon("konsole"); - KAction* findFileAction = new KAction(i18n("Find File..."), "Ctrl+F", + TDEAction* findFileAction = new TDEAction(i18n("Find File..."), "Ctrl+F", TQT_TQOBJECT(this), TQT_SLOT(findFile()), actionCollection(), "find_file"); findFileAction->setIcon("filefind"); - new KToggleAction(i18n("Show Filter Bar"), "filter", "/", + new TDEToggleAction(i18n("Show Filter Bar"), "filter", "/", TQT_TQOBJECT(this), TQT_SLOT(showFilterBar()), actionCollection(), "show_filter_bar"); - KAction* compareFilesAction = new KAction(i18n("Compare Files"), 0, + TDEAction* compareFilesAction = new TDEAction(i18n("Compare Files"), 0, TQT_TQOBJECT(this), TQT_SLOT(compareFiles()), actionCollection(), "compare_files"); compareFilesAction->setIcon("kompare"); @@ -1408,7 +1408,7 @@ void Dolphin::setupCreateNewMenuActions() KSortableValueList::ConstIterator end = m_createFileTemplates.end(); while (it != end) { CreateFileEntry entry = (*it).value(); - KAction* action = new KAction(entry.name); + TDEAction* action = new TDEAction(entry.name); action->setIcon(entry.icon); action->setName((*it).index().ascii()); connect(action, TQT_SIGNAL(activated()), @@ -1452,12 +1452,12 @@ void Dolphin::updateHistory() int index = 0; const TQValueList list = m_activeView->urlHistory(index); - KAction* backAction = actionCollection()->action("go_back"); + TDEAction* backAction = actionCollection()->action("go_back"); if (backAction != 0) { backAction->setEnabled(index < static_cast(list.count()) - 1); } - KAction* forwardAction = actionCollection()->action("go_forward"); + TDEAction* forwardAction = actionCollection()->action("go_forward"); if (forwardAction != 0) { forwardAction->setEnabled(index > 0); } @@ -1472,7 +1472,7 @@ void Dolphin::updateEditActions() else { stateChanged("has_selection"); - KAction* renameAction = actionCollection()->action("rename"); + TDEAction* renameAction = actionCollection()->action("rename"); if (renameAction != 0) { renameAction->setEnabled(list->count() >= 1); } @@ -1490,7 +1490,7 @@ void Dolphin::updateEditActions() ++it; } - KAction* moveToTrashAction = actionCollection()->action("move_to_trash"); + TDEAction* moveToTrashAction = actionCollection()->action("move_to_trash"); moveToTrashAction->setEnabled(enableMoveToTrash); } updatePasteAction(); @@ -1498,17 +1498,17 @@ void Dolphin::updateEditActions() void Dolphin::updateViewActions() { - KAction* zoomInAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomIn)); + TDEAction* zoomInAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomIn)); if (zoomInAction != 0) { zoomInAction->setEnabled(m_activeView->isZoomInPossible()); } - KAction* zoomOutAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomOut)); + TDEAction* zoomOutAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomOut)); if (zoomOutAction != 0) { zoomOutAction->setEnabled(m_activeView->isZoomOutPossible()); } - KAction* action = 0; + TDEAction* action = 0; switch (m_activeView->mode()) { case DolphinView::IconsView: action = actionCollection()->action("icons"); @@ -1524,34 +1524,34 @@ void Dolphin::updateViewActions() } if (action != 0) { - KToggleAction* toggleAction = static_cast(action); + TDEToggleAction* toggleAction = static_cast(action); toggleAction->setChecked(true); } slotSortingChanged(m_activeView->sorting()); slotSortOrderChanged(m_activeView->sortOrder()); - KToggleAction* showFilterBarAction = - static_cast(actionCollection()->action("show_filter_bar")); + TDEToggleAction* showFilterBarAction = + static_cast(actionCollection()->action("show_filter_bar")); showFilterBarAction->setChecked(m_activeView->isFilterBarVisible()); - KToggleAction* showHiddenFilesAction = - static_cast(actionCollection()->action("show_hidden_files")); + TDEToggleAction* showHiddenFilesAction = + static_cast(actionCollection()->action("show_hidden_files")); showHiddenFilesAction->setChecked(m_activeView->isShowHiddenFilesEnabled()); - KToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); + TDEToggleAction* splitAction = static_cast(actionCollection()->action("split_view")); splitAction->setChecked(m_view[SecondaryIdx] != 0); - KToggleAction* leftsidebarAction = static_cast(actionCollection()->action("leftsidebar")); + TDEToggleAction* leftsidebarAction = static_cast(actionCollection()->action("leftsidebar")); leftsidebarAction->setChecked(m_leftsidebar != 0); - KToggleAction* rightsidebarAction = static_cast(actionCollection()->action("rightsidebar")); + TDEToggleAction* rightsidebarAction = static_cast(actionCollection()->action("rightsidebar")); rightsidebarAction->setChecked(m_rightsidebar != 0); } void Dolphin::updateGoActions() { - KAction* goUpAction = actionCollection()->action(KStdAction::stdName(KStdAction::Up)); + TDEAction* goUpAction = actionCollection()->action(KStdAction::stdName(KStdAction::Up)); const KURL& currentURL = m_activeView->url(); goUpAction->setEnabled(currentURL.upURL() != currentURL); } @@ -1691,7 +1691,7 @@ void Dolphin::toggleleftSidebar() closeleftSidebar(); } - KToggleAction* leftsidebarAction = static_cast(actionCollection()->action("leftsidebar")); + TDEToggleAction* leftsidebarAction = static_cast(actionCollection()->action("leftsidebar")); leftsidebarAction->setChecked(m_leftsidebar != 0); } @@ -1704,7 +1704,7 @@ void Dolphin::togglerightSidebar() closerightSidebar(); } - KToggleAction* rightsidebarAction = static_cast(actionCollection()->action("rightsidebar")); + TDEToggleAction* rightsidebarAction = static_cast(actionCollection()->action("rightsidebar")); rightsidebarAction->setChecked(m_rightsidebar != 0); } -- cgit v1.2.1