summaryrefslogtreecommitdiffstats
path: root/src/dolphin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphin.cpp')
-rw-r--r--src/dolphin.cpp145
1 files changed, 74 insertions, 71 deletions
diff --git a/src/dolphin.cpp b/src/dolphin.cpp
index f9e984d..819f59d 100644
--- a/src/dolphin.cpp
+++ b/src/dolphin.cpp
@@ -50,6 +50,7 @@
#include <tdemessagebox.h>
#include <kservice.h>
#include <kstandarddirs.h>
+#include <kprocess.h>
#include <krun.h>
#include <tqclipboard.h>
@@ -431,11 +432,10 @@ void Dolphin::createFile()
KSortableValueList<CreateFileEntry, TQString>::ConstIterator it = m_createFileTemplates.begin();
KSortableValueList<CreateFileEntry, TQString>::ConstIterator end = m_createFileTemplates.end();
- const TQString senderName(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name());
bool found = false;
CreateFileEntry entry;
while (!found && (it != end)) {
- if ((*it).index() == senderName) {
+ if ((*it).index() == sender()->name()) {
entry = (*it).value();
found = true;
}
@@ -553,10 +553,10 @@ void Dolphin::deleteItems()
) == KMessageBox::Continue;
if (del) {
TDEIO::Job* job = TDEIO::del(list);
- connect(job, TQT_SIGNAL(result(TDEIO::Job*)),
- this, TQT_SLOT(slotHandleJobError(TDEIO::Job*)));
- connect(job, TQT_SIGNAL(result(TDEIO::Job*)),
- this, TQT_SLOT(slotDeleteFileFinished(TDEIO::Job*)));
+ connect(job, TQ_SIGNAL(result(TDEIO::Job*)),
+ this, TQ_SLOT(slotHandleJobError(TDEIO::Job*)));
+ connect(job, TQ_SIGNAL(result(TDEIO::Job*)),
+ this, TQ_SLOT(slotDeleteFileFinished(TDEIO::Job*)));
}
}
@@ -922,11 +922,14 @@ void Dolphin::goHome()
void Dolphin::openTerminal()
{
- TQString command("konsole --workdir \"");
- command.append(m_activeView->url().path());
- command.append('\"');
+ TDEConfig * config = kapp->config();
+ config->setGroup("General");
+ TQString term = config->readPathEntry("TerminalApplication", "konsole");
- KRun::runCommand(command, "Konsole", "konsole");
+ TDEProcess proc;
+ proc << term;
+ proc.setWorkingDirectory(m_activeView->url().path());
+ proc.start(TDEProcess::DontCare);
}
void Dolphin::findFile()
@@ -1145,8 +1148,8 @@ void Dolphin::init()
setAutoSaveSettings();
TQClipboard* clipboard = TQApplication::clipboard();
- connect(clipboard, TQT_SIGNAL(dataChanged()),
- this, TQT_SLOT(updatePasteAction()));
+ connect(clipboard, TQ_SIGNAL(dataChanged()),
+ this, TQ_SLOT(updatePasteAction()));
updatePasteAction();
updateGoActions();
@@ -1177,173 +1180,173 @@ void Dolphin::setupActions()
{
// setup 'File' menu
TDEAction* createFolder = new TDEAction(i18n("Folder..."), "Ctrl+N",
- TQT_TQOBJECT(this), TQT_SLOT(createFolder()),
+ this, TQ_SLOT(createFolder()),
actionCollection(), "create_folder");
createFolder->setIcon("folder");
new TDEAction(i18n("Rename"), KKey(Key_F2),
- TQT_TQOBJECT(this), TQT_SLOT(rename()),
+ this, TQ_SLOT(rename()),
actionCollection(), "rename");
TDEAction* moveToTrashAction = new TDEAction(i18n("Move to Trash"), KKey(Key_Delete),
- TQT_TQOBJECT(this), TQT_SLOT(moveToTrash()),
+ this, TQ_SLOT(moveToTrash()),
actionCollection(), "move_to_trash");
moveToTrashAction->setIcon("edittrash");
TDEAction* deleteAction = new TDEAction(i18n("Delete"), "Shift+Delete",
- TQT_TQOBJECT(this), TQT_SLOT(deleteItems()),
+ this, TQ_SLOT(deleteItems()),
actionCollection(), "delete");
deleteAction->setIcon("edit-delete");
- new TDEAction(i18n("Propert&ies"), "Alt+Return",
- TQT_TQOBJECT(this), TQT_SLOT(properties()),
+ new TDEAction(i18n("Propert&ies"), "edit", "Alt+Return",
+ this, TQ_SLOT(properties()),
actionCollection(), "properties");
- KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(quit()), actionCollection());
+ KStdAction::quit(this, TQ_SLOT(quit()), actionCollection());
// setup 'Edit' menu
UndoManager& undoManager = UndoManager::instance();
KStdAction::undo(&undoManager,
- TQT_SLOT(undo()),
+ TQ_SLOT(undo()),
actionCollection());
- connect(&undoManager, TQT_SIGNAL(undoAvailable(bool)),
- TQT_TQOBJECT(this), TQT_SLOT(slotUndoAvailable(bool)));
- connect(&undoManager, TQT_SIGNAL(undoTextChanged(const TQString&)),
- TQT_TQOBJECT(this), TQT_SLOT(slotUndoTextChanged(const TQString&)));
+ connect(&undoManager, TQ_SIGNAL(undoAvailable(bool)),
+ this, TQ_SLOT(slotUndoAvailable(bool)));
+ connect(&undoManager, TQ_SIGNAL(undoTextChanged(const TQString&)),
+ this, TQ_SLOT(slotUndoTextChanged(const TQString&)));
KStdAction::redo(&undoManager,
- TQT_SLOT(redo()),
+ TQ_SLOT(redo()),
actionCollection());
- connect(&undoManager, TQT_SIGNAL(redoAvailable(bool)),
- TQT_TQOBJECT(this), TQT_SLOT(slotRedoAvailable(bool)));
- connect(&undoManager, TQT_SIGNAL(redoTextChanged(const TQString&)),
- TQT_TQOBJECT(this), TQT_SLOT(slotRedoTextChanged(const TQString&)));
+ connect(&undoManager, TQ_SIGNAL(redoAvailable(bool)),
+ this, TQ_SLOT(slotRedoAvailable(bool)));
+ connect(&undoManager, TQ_SIGNAL(redoTextChanged(const TQString&)),
+ this, TQ_SLOT(slotRedoTextChanged(const TQString&)));
- KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(cut()), actionCollection());
- KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), actionCollection());
- KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(paste()), actionCollection());
+ KStdAction::cut(this, TQ_SLOT(cut()), actionCollection());
+ KStdAction::copy(this, TQ_SLOT(copy()), actionCollection());
+ KStdAction::paste(this, TQ_SLOT(paste()), actionCollection());
new TDEAction(i18n("Select All"), "Ctrl+A",
- TQT_TQOBJECT(this), TQT_SLOT(selectAll()),
+ this, TQ_SLOT(selectAll()),
actionCollection(), "select_all");
new TDEAction(i18n("Invert Selection"), "Ctrl+Shift+A",
- TQT_TQOBJECT(this), TQT_SLOT(invertSelection()),
+ this, TQ_SLOT(invertSelection()),
actionCollection(), "invert_selection");
// setup 'View' menu
- KStdAction::zoomIn(TQT_TQOBJECT(this),
- TQT_SLOT(zoomIn()),
+ KStdAction::zoomIn(this,
+ TQ_SLOT(zoomIn()),
actionCollection());
- KStdAction::zoomOut(TQT_TQOBJECT(this),
- TQT_SLOT(zoomOut()),
+ KStdAction::zoomOut(this,
+ TQ_SLOT(zoomOut()),
actionCollection());
TDERadioAction* iconsView = new TDERadioAction(i18n("Icons"), "Ctrl+1",
- TQT_TQOBJECT(this), TQT_SLOT(setIconsView()),
+ this, TQ_SLOT(setIconsView()),
actionCollection(), "icons");
iconsView->setExclusiveGroup("view_mode");
iconsView->setIcon("view_icon");
TDERadioAction* detailsView = new TDERadioAction(i18n("Details"), "Ctrl+2",
- TQT_TQOBJECT(this), TQT_SLOT(setDetailsView()),
+ this, TQ_SLOT(setDetailsView()),
actionCollection(), "details");
detailsView->setExclusiveGroup("view_mode");
detailsView->setIcon("view_text");
TDERadioAction* previewsView = new TDERadioAction(i18n("Previews"), "Ctrl+3",
- TQT_TQOBJECT(this), TQT_SLOT(setPreviewsView()),
+ this, TQ_SLOT(setPreviewsView()),
actionCollection(), "previews");
previewsView->setExclusiveGroup("view_mode");
previewsView->setIcon("gvdirpart");
TDERadioAction* sortByName = new TDERadioAction(i18n("By Name"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(sortByName()),
+ this, TQ_SLOT(sortByName()),
actionCollection(), "by_name");
sortByName->setExclusiveGroup("sort");
TDERadioAction* sortBySize = new TDERadioAction(i18n("By Size"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(sortBySize()),
+ this, TQ_SLOT(sortBySize()),
actionCollection(), "by_size");
sortBySize->setExclusiveGroup("sort");
TDERadioAction* sortByDate = new TDERadioAction(i18n("By Date"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(sortByDate()),
+ this, TQ_SLOT(sortByDate()),
actionCollection(), "by_date");
sortByDate->setExclusiveGroup("sort");
- new TDEToggleAction(i18n("Descending"), 0, TQT_TQOBJECT(this), TQT_SLOT(toggleSortOrder()),
+ new TDEToggleAction(i18n("Descending"), 0, this, TQ_SLOT(toggleSortOrder()),
actionCollection(), "descending");
new TDEToggleAction(i18n("Show Hidden Files"), "Alt+.",
- TQT_TQOBJECT(this), TQT_SLOT(showHiddenFiles()),
+ this, TQ_SLOT(showHiddenFiles()),
actionCollection(), "show_hidden_files");
TDEToggleAction* splitAction = new TDEToggleAction(i18n("Split View"), "F10",
- TQT_TQOBJECT(this), TQT_SLOT(toggleSplitView()),
+ this, TQ_SLOT(toggleSplitView()),
actionCollection(), "split_view");
splitAction->setIcon("view_left_right");
TDEAction* reloadAction = new TDEAction(i18n("Reload"), "F5",
- TQT_TQOBJECT(this), TQT_SLOT(reloadView()),
+ this, TQ_SLOT(reloadView()),
actionCollection(), "reload");
reloadAction->setIcon("reload");
TDEAction* stopAction = new TDEAction(i18n("Stop"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(stopLoading()),
+ this, TQ_SLOT(stopLoading()),
actionCollection(), "stop");
stopAction->setIcon("process-stop");
new TDEAction(i18n("Edit Location"), "Ctrl+L",
- TQT_TQOBJECT(this), TQT_SLOT(editLocation()),
+ this, TQ_SLOT(editLocation()),
actionCollection(), "edit_location");
new TDEAction(i18n("Browse"), "Ctrl+B",
- TQT_TQOBJECT(this), TQT_SLOT(browse()),
+ this, TQ_SLOT(browse()),
actionCollection(), "browse");
new TDEToggleAction(i18n("Left Sidebar"), "F8",
- TQT_TQOBJECT(this), TQT_SLOT(toggleleftSidebar()),
+ this, TQ_SLOT(toggleleftSidebar()),
actionCollection(), "leftsidebar");
new TDEToggleAction(i18n("Right Sidebar"), "F9",
- TQT_TQOBJECT(this), TQT_SLOT(togglerightSidebar()),
+ this, TQ_SLOT(togglerightSidebar()),
actionCollection(), "rightsidebar");
new TDEAction(i18n("Adjust View Properties..."), 0,
- TQT_TQOBJECT(this), TQT_SLOT(adjustViewProperties()),
+ this, TQ_SLOT(adjustViewProperties()),
actionCollection(), "view_properties");
// setup 'Go' menu
- KStdAction::back(TQT_TQOBJECT(this), TQT_SLOT(goBack()), actionCollection());
- KStdAction::forward(TQT_TQOBJECT(this), TQT_SLOT(goForward()), actionCollection());
- KStdAction::up(TQT_TQOBJECT(this), TQT_SLOT(goUp()), actionCollection());
- KStdAction::home(TQT_TQOBJECT(this), TQT_SLOT(goHome()), actionCollection());
+ KStdAction::back(this, TQ_SLOT(goBack()), actionCollection());
+ KStdAction::forward(this, TQ_SLOT(goForward()), actionCollection());
+ KStdAction::up(this, TQ_SLOT(goUp()), actionCollection());
+ KStdAction::home(this, TQ_SLOT(goHome()), actionCollection());
// setup 'Tools' menu
TDEAction* openTerminalAction = new TDEAction(i18n("Open Terminal"), "F4",
- TQT_TQOBJECT(this), TQT_SLOT(openTerminal()),
+ this, TQ_SLOT(openTerminal()),
actionCollection(), "open_terminal");
openTerminalAction->setIcon("konsole");
TDEAction* findFileAction = new TDEAction(i18n("Find File..."), "Ctrl+F",
- TQT_TQOBJECT(this), TQT_SLOT(findFile()),
+ this, TQ_SLOT(findFile()),
actionCollection(), "find_file");
findFileAction->setIcon("filefind");
new TDEToggleAction(i18n("Show Filter Bar"), "filter", "/",
- TQT_TQOBJECT(this), TQT_SLOT(showFilterBar()),
+ this, TQ_SLOT(showFilterBar()),
actionCollection(), "show_filter_bar");
TDEAction* compareFilesAction = new TDEAction(i18n("Compare Files"), 0,
- TQT_TQOBJECT(this), TQT_SLOT(compareFiles()),
+ this, TQ_SLOT(compareFiles()),
actionCollection(), "compare_files");
compareFilesAction->setIcon("kompare");
compareFilesAction->setEnabled(false);
// setup 'Settings' menu
- KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(editSettings()), actionCollection());
+ KStdAction::preferences(this, TQ_SLOT(editSettings()), actionCollection());
}
void Dolphin::setupCreateNewMenuActions()
@@ -1411,8 +1414,8 @@ void Dolphin::setupCreateNewMenuActions()
TDEAction* action = new TDEAction(entry.name);
action->setIcon(entry.icon);
action->setName((*it).index().ascii());
- connect(action, TQT_SIGNAL(activated()),
- this, TQT_SLOT(createFile()));
+ connect(action, TQ_SIGNAL(activated()),
+ this, TQ_SLOT(createFile()));
const TQChar section = ((*it).index()[0]);
switch (section) {
@@ -1596,8 +1599,8 @@ void Dolphin::addPendingUndoJob(TDEIO::Job* job,
const KURL::List& source,
const KURL& dest)
{
- connect(job, TQT_SIGNAL(result(TDEIO::Job*)),
- this, TQT_SLOT(addUndoOperation(TDEIO::Job*)));
+ connect(job, TQ_SIGNAL(result(TDEIO::Job*)),
+ this, TQ_SLOT(addUndoOperation(TDEIO::Job*)));
UndoInfo undoInfo;
undoInfo.id = job->progressId();
@@ -1620,8 +1623,8 @@ void Dolphin::openleftSidebar()
m_leftsidebar = new leftSidebar(m_splitter);
m_leftsidebar->show();
- connect(m_leftsidebar, TQT_SIGNAL(urlChanged(const KURL&)),
- this, TQT_SLOT(slotURLChangeRequest(const KURL&)));
+ connect(m_leftsidebar, TQ_SIGNAL(urlChanged(const KURL&)),
+ this, TQ_SLOT(slotURLChangeRequest(const KURL&)));
m_splitter->setCollapsible(m_leftsidebar, false);
m_splitter->setResizeMode(m_leftsidebar, TQSplitter::KeepSize);
m_splitter->moveToFirst(m_leftsidebar);
@@ -1640,8 +1643,8 @@ void Dolphin::openrightSidebar()
m_rightsidebar = new rightSidebar(m_splitter);
m_rightsidebar->show();
- connect(m_rightsidebar, TQT_SIGNAL(urlChanged(const KURL&)),
- this, TQT_SLOT(slotURLChangeRequest(const KURL&)));
+ connect(m_rightsidebar, TQ_SIGNAL(urlChanged(const KURL&)),
+ this, TQ_SLOT(slotURLChangeRequest(const KURL&)));
m_splitter->setCollapsible(m_rightsidebar, false);
m_splitter->setResizeMode(m_rightsidebar, TQSplitter::KeepSize);
m_splitter->moveToLast(m_rightsidebar);