]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinmainwindow.cpp
Applied some patches found by EBN (thanks to Nicolas Lécureuil for the patches!).
[dolphin.git] / src / dolphinmainwindow.cpp
index 640e7071c7fe24d68ec18c607c8ae1d7dbb9d69f..ad144d625ca96207bc3fbd2188c127645ca374e9 100644 (file)
 #include <kfiledialog.h>
 #include <kconfig.h>
 #include <kurl.h>
-#include <kstdaccel.h>
 #include <kaction.h>
-#include <kstdaction.h>
+#include <kstandardaction.h>
 #include <kmenu.h>
-#include <kio/renamedlg.h>
+#include <kio/renamedialog.h>
 #include <kinputdialog.h>
 #include <kshell.h>
 #include <kdesktopfile.h>
@@ -115,9 +114,10 @@ void DolphinMainWindow::setActiveView(DolphinView* view)
 }
 
 void DolphinMainWindow::dropUrls(const KUrl::List& urls,
-                       const KUrl& destination)
+                                 const KUrl& destination)
 {
-    int selectedIndex = -1;
+    m_dropDestination = destination;
+    m_droppedUrls = urls;
 
     /* KDE4-TODO
     const ButtonState keyboardState = KApplication::keyboardMouseState();
@@ -142,49 +142,22 @@ void DolphinMainWindow::dropUrls(const KUrl::List& urls,
         // no shortcut is used, hence open a popup menu
         KMenu popup(this);
 
-        popup.insertItem(SmallIcon("goto"), i18n("&Move Here") + "\t" /* KDE4-TODO: + KKey::modFlagLabel(KKey::SHIFT)*/, 0);
-        popup.insertItem(SmallIcon("editcopy"), i18n( "&Copy Here" ) /* KDE4-TODO + "\t" + KKey::modFlagLabel(KKey::CTRL)*/, 1);
-        popup.insertItem(i18n("&Link Here") /* KDE4-TODO + "\t" + KKey::modFlagLabel((KKey::ModFlag)(KKey::CTRL|KKey::SHIFT)) */, 2);
-        popup.insertSeparator();
-        popup.insertItem(SmallIcon("stop"), i18n("Cancel"), 3);
-        popup.setAccel(i18n("Escape"), 3);
+        QAction* moveAction = popup.addAction(SmallIcon("goto"), i18n("&Move Here"));
+        connect(moveAction, SIGNAL(triggered()), this, SLOT(moveDroppedItems()));
 
-        /* KDE4-TODO: selectedIndex = popup.exec(QCursor::pos()); */
-        popup.exec(QCursor::pos());
-        selectedIndex = 0; // KD4-TODO: use QAction instead of switch below
-        // See libkonq/konq_operations.cc: KonqOperations::doDropFileCopy() (and doDrop, the main method)
-    }
-
-    if (selectedIndex < 0) {
-        return;
-    }
+        QAction* copyAction = popup.addAction(SmallIcon("editcopy"), i18n( "&Copy Here" ));
+        connect(copyAction, SIGNAL(triggered()), this, SLOT(copyDroppedItems()));
 
-    switch (selectedIndex) {
-        case 0: {
-            // 'Move Here' has been selected
-            updateViewProperties(urls);
-            moveUrls(urls, destination);
-            break;
-        }
-
-        case 1: {
-            // 'Copy Here' has been selected
-            updateViewProperties(urls);
-            copyUrls(urls, destination);
-            break;
-        }
+        QAction* linkAction = popup.addAction(i18n("&Link Here"));
+        connect(linkAction, SIGNAL(triggered()), this, SLOT(linkDroppedItems()));
 
-        case 2: {
-            // 'Link Here' has been selected
-            KIO::Job* job = KIO::link(urls, destination);
-            addPendingUndoJob(job, DolphinCommand::Link, urls, destination);
-            break;
-        }
+        QAction* cancelAction = popup.addAction(SmallIcon("stop"), i18n("Cancel"));
+        popup.insertSeparator(cancelAction);
 
-        default:
-            // 'Cancel' has been selected
-            break;
+        popup.exec(QCursor::pos());
     }
+
+    m_droppedUrls.clear();
 }
 
 void DolphinMainWindow::refreshViews()
@@ -316,19 +289,41 @@ void DolphinMainWindow::openNewMainWindow()
     DolphinApplication::app()->createMainWindow()->show();
 }
 
-void DolphinMainWindow::closeEvent(QCloseEvent* event)
+void DolphinMainWindow::moveDroppedItems()
+{
+    moveUrls(m_droppedUrls, m_dropDestination);
+}
+
+void DolphinMainWindow::copyDroppedItems()
+{
+    copyUrls(m_droppedUrls, m_dropDestination);
+}
+
+void DolphinMainWindow::linkDroppedItems()
 {
-    // KDE4-TODO
-    //KConfig* config = KGlobal::config();
-    //config->setGroup("General");
-    //config->writeEntry("First Run", false);
+    KIO::Job* job = KIO::link(m_droppedUrls, m_dropDestination);
+    addPendingUndoJob(job, DolphinCommand::Link, m_droppedUrls, m_dropDestination);
+}
 
+void DolphinMainWindow::closeEvent(QCloseEvent* event)
+{
     DolphinSettings& settings = DolphinSettings::instance();
     GeneralSettings* generalSettings = settings.generalSettings();
     generalSettings->setFirstRun(false);
 
     settings.save();
 
+    // TODO: I assume there will be a generic way in KDE 4 to store the docks
+    // of the main window. In the meantime they are stored manually:
+    QString filename = KStandardDirs::locateLocal("data", KGlobal::instance()->instanceName());
+    filename.append("/panels_layout");
+    QFile file(filename);
+    if (file.open(QIODevice::WriteOnly)) {
+        QByteArray data = saveState();
+        file.write(data);
+        file.close();
+    }
+
     KMainWindow::closeEvent(event);
 }
 
@@ -380,7 +375,7 @@ void DolphinMainWindow::createFolder()
 
 
     if (baseUrl.isLocalFile() && QFileInfo(baseUrl.path(KUrl::AddTrailingSlash) + name).exists()) {
-        name = KIO::RenameDlg::suggestName(baseUrl, i18n("New Folder"));
+        name = KIO::RenameDialog::suggestName(baseUrl, i18n("New Folder"));
     }
 
     bool ok = false;
@@ -442,7 +437,7 @@ void DolphinMainWindow::createFile()
     clearStatusBar();
 
     // TODO: const Entry& entry = m_createFileTemplates[QString(sender->name())];
-    // should be enough. Anyway: the implemantation of [] does a linear search internally too.
+    // should be enough. Anyway: the implementation of [] does a linear search internally too.
     KSortableList<CreateFileEntry, QString>::ConstIterator it = m_createFileTemplates.begin();
     KSortableList<CreateFileEntry, QString>::ConstIterator end = m_createFileTemplates.end();
 
@@ -485,7 +480,7 @@ void DolphinMainWindow::createFile()
     const bool fileExists = viewUrl.isLocalFile() &&
                             QFileInfo(viewUrl.path(KUrl::AddTrailingSlash) + KIO::encodeFileName(name)).exists();
     if (fileExists) {
-        name = KIO::RenameDlg::suggestName(viewUrl, name);
+        name = KIO::RenameDialog::suggestName(viewUrl, name);
     }
 
     // let the user change the suggested file name
@@ -610,7 +605,7 @@ void DolphinMainWindow::slotDeleteFileFinished(KJob* job)
 
 void DolphinMainWindow::slotUndoAvailable(bool available)
 {
-    QAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo));
+    QAction* undoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Undo));
     if (undoAction != 0) {
         undoAction->setEnabled(available);
     }
@@ -618,7 +613,7 @@ void DolphinMainWindow::slotUndoAvailable(bool available)
 
 void DolphinMainWindow::slotUndoTextChanged(const QString& text)
 {
-    QAction* undoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Undo));
+    QAction* undoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Undo));
     if (undoAction != 0) {
         undoAction->setText(text);
     }
@@ -626,7 +621,7 @@ void DolphinMainWindow::slotUndoTextChanged(const QString& text)
 
 void DolphinMainWindow::slotRedoAvailable(bool available)
 {
-    QAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo));
+    QAction* redoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Redo));
     if (redoAction != 0) {
         redoAction->setEnabled(available);
     }
@@ -634,7 +629,7 @@ void DolphinMainWindow::slotRedoAvailable(bool available)
 
 void DolphinMainWindow::slotRedoTextChanged(const QString& text)
 {
-    QAction* redoAction = actionCollection()->action(KStdAction::stdName(KStdAction::Redo));
+    QAction* redoAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Redo));
     if (redoAction != 0) {
         redoAction->setText(text);
     }
@@ -696,7 +691,7 @@ void DolphinMainWindow::paste()
 
 void DolphinMainWindow::updatePasteAction()
 {
-    QAction* pasteAction = actionCollection()->action(KStdAction::stdName(KStdAction::Paste));
+    QAction* pasteAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Paste));
     if (pasteAction == 0) {
         return;
     }
@@ -837,6 +832,12 @@ void DolphinMainWindow::stopLoading()
 
 void DolphinMainWindow::togglePreview()
 {
+    clearStatusBar();
+
+    const KToggleAction* showPreviewAction =
+        static_cast<KToggleAction*>(actionCollection()->action("show_preview"));
+    const bool show = showPreviewAction->isChecked();
+    m_activeView->setShowPreview(show);
 }
 
 void DolphinMainWindow::toggleShowHiddenFiles()
@@ -1143,42 +1144,61 @@ void DolphinMainWindow::loadSettings()
     }
 
     updateViewActions();
+
+    // TODO: I assume there will be a generic way in KDE 4 to restore the docks
+    // of the main window. In the meantime they are restored manually (see also
+    // DolphinMainWindow::closeEvent() for more details):
+    QString filename = KStandardDirs::locateLocal("data", KGlobal::instance()->instanceName());
+    filename.append("/panels_layout");
+    QFile file(filename);
+    if (file.open(QIODevice::ReadOnly)) {
+        QByteArray data = file.readAll();
+        restoreState(data);
+        file.close();
+    }
 }
 
 void DolphinMainWindow::setupActions()
 {
     // setup 'File' menu
-    KAction *action = new KAction(KIcon("window_new"),  i18n( "New &Window" ), actionCollection(), "new_window" );
+    QAction *action = actionCollection()->addAction("new_window");
+    action->setIcon(KIcon("window_new"));
+    action->setText(i18n("New &Window"));
     connect(action, SIGNAL(triggered()), this, SLOT(openNewMainWindow()));
 
-    KAction* createFolder = new KAction(i18n("Folder..."), actionCollection(), "create_folder");
+    QAction* createFolder = actionCollection()->addAction("create_folder");
+    createFolder->setText(i18n("Folder..."));
     createFolder->setIcon(KIcon("folder"));
     createFolder->setShortcut(Qt::Key_N);
     connect(createFolder, SIGNAL(triggered()), this, SLOT(createFolder()));
 
-    KAction* rename = new KAction(i18n("Rename"), actionCollection(), "rename");
+    QAction* rename = actionCollection()->addAction("rename");
+    rename->setText(i18n("Rename"));
     rename->setShortcut(Qt::Key_F2);
     connect(rename, SIGNAL(triggered()), this, SLOT(rename()));
 
-    KAction* moveToTrash = new KAction(i18n("Move to Trash"), actionCollection(), "move_to_trash");
+    QAction* moveToTrash = actionCollection()->addAction("move_to_trash");
+    moveToTrash->setText(i18n("Move to Trash"));
     moveToTrash->setIcon(KIcon("edittrash"));
     moveToTrash->setShortcut(QKeySequence::Delete);
     connect(moveToTrash, SIGNAL(triggered()), this, SLOT(moveToTrash()));
 
-    KAction* deleteAction = new KAction(i18n("Delete"), actionCollection(), "delete");
+    QAction* deleteAction = actionCollection()->addAction("delete");
+    deleteAction->setText(i18n("Delete"));
     deleteAction->setShortcut(Qt::ALT | Qt::Key_Delete);
     deleteAction->setIcon(KIcon("editdelete"));
     connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItems()));
 
-    KAction* properties = new KAction(i18n("Propert&ies"), actionCollection(), "properties");
+    QAction* properties = actionCollection()->addAction("properties");
+    properties->setText(i18n("Propert&ies"));
     properties->setShortcut(Qt::Key_Alt | Qt::Key_Return);
     connect(properties, SIGNAL(triggered()), this, SLOT(properties()));
 
-    KStdAction::quit(this, SLOT(quit()), actionCollection());
+    KStandardAction::quit(this, SLOT(quit()), actionCollection());
 
     // setup 'Edit' menu
     UndoManager& undoManager = UndoManager::instance();
-    KStdAction::undo(this,
+    KStandardAction::undo(this,
                      SLOT(undo()),
                      actionCollection());
     connect(&undoManager, SIGNAL(undoAvailable(bool)),
@@ -1186,7 +1206,7 @@ void DolphinMainWindow::setupActions()
     connect(&undoManager, SIGNAL(undoTextChanged(const QString&)),
             this, SLOT(slotUndoTextChanged(const QString&)));
 
-    KStdAction::redo(this,
+    KStandardAction::redo(this,
                      SLOT(redo()),
                      actionCollection());
     connect(&undoManager, SIGNAL(redoAvailable(bool)),
@@ -1194,33 +1214,37 @@ void DolphinMainWindow::setupActions()
     connect(&undoManager, SIGNAL(redoTextChanged(const QString&)),
             this, SLOT(slotRedoTextChanged(const QString&)));
 
-    KStdAction::cut(this, SLOT(cut()), actionCollection());
-    KStdAction::copy(this, SLOT(copy()), actionCollection());
-    KStdAction::paste(this, SLOT(paste()), actionCollection());
+    KStandardAction::cut(this, SLOT(cut()), actionCollection());
+    KStandardAction::copy(this, SLOT(copy()), actionCollection());
+    KStandardAction::paste(this, SLOT(paste()), actionCollection());
 
-    KAction* selectAll = new KAction(i18n("Select All"), actionCollection(), "select_all");
+    QAction* selectAll = actionCollection()->addAction("select_all");
+    selectAll->setText(i18n("Select All"));
     selectAll->setShortcut(Qt::CTRL + Qt::Key_A);
     connect(selectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
 
-    KAction* invertSelection = new KAction(i18n("Invert Selection"), actionCollection(), "invert_selection");
+    QAction* invertSelection = actionCollection()->addAction("invert_selection");
+    invertSelection->setText(i18n("Invert Selection"));
     invertSelection->setShortcut(Qt::CTRL | Qt::SHIFT | Qt::Key_A);
     connect(invertSelection, SIGNAL(triggered()), this, SLOT(invertSelection()));
 
     // setup 'View' menu
-    KStdAction::zoomIn(this,
+    KStandardAction::zoomIn(this,
                        SLOT(zoomIn()),
                        actionCollection());
 
-    KStdAction::zoomOut(this,
+    KStandardAction::zoomOut(this,
                         SLOT(zoomOut()),
                         actionCollection());
 
-    KToggleAction* iconsView = new KToggleAction(i18n("Icons"), actionCollection(), "icons");
+    KToggleAction* iconsView = actionCollection()->add<KToggleAction>("icons");
+    iconsView->setText(i18n("Icons"));
     iconsView->setShortcut(Qt::CTRL | Qt::Key_1);
     iconsView->setIcon(KIcon("view_icon"));
     connect(iconsView, SIGNAL(triggered()), this, SLOT(setIconsView()));
 
-    KToggleAction* detailsView = new KToggleAction(i18n("Details"), actionCollection(), "details");
+    KToggleAction* detailsView = actionCollection()->add<KToggleAction>("details");
+    detailsView->setText(i18n("Details"));
     detailsView->setShortcut(Qt::CTRL | Qt::Key_2);
     detailsView->setIcon(KIcon("view_text"));
     connect(detailsView, SIGNAL(triggered()), this, SLOT(setDetailsView()));
@@ -1229,13 +1253,16 @@ void DolphinMainWindow::setupActions()
     viewModeGroup->addAction(iconsView);
     viewModeGroup->addAction(detailsView);
 
-    KToggleAction* sortByName = new KToggleAction(i18n("By Name"), actionCollection(), "by_name");
+    KToggleAction* sortByName = actionCollection()->add<KToggleAction>("by_name");
+    sortByName->setText(i18n("By Name"));
     connect(sortByName, SIGNAL(triggered()), this, SLOT(sortByName()));
 
-    KToggleAction* sortBySize = new KToggleAction(i18n("By Size"), actionCollection(), "by_size");
+    KToggleAction* sortBySize = actionCollection()->add<KToggleAction>("by_size");
+    sortBySize->setText(i18n("By Size"));
     connect(sortBySize, SIGNAL(triggered()), this, SLOT(sortBySize()));
 
-    KToggleAction* sortByDate = new KToggleAction(i18n("By Date"), actionCollection(), "by_date");
+    KToggleAction* sortByDate = actionCollection()->add<KToggleAction>("by_date");
+    sortByDate->setText(i18n("By Date"));
     connect(sortByDate, SIGNAL(triggered()), this, SLOT(sortByDate()));
 
     QActionGroup* sortGroup = new QActionGroup(this);
@@ -1243,93 +1270,103 @@ void DolphinMainWindow::setupActions()
     sortGroup->addAction(sortBySize);
     sortGroup->addAction(sortByDate);
 
-    KToggleAction* sortDescending = new KToggleAction(i18n("Descending"), actionCollection(), "descending");
+    KToggleAction* sortDescending = actionCollection()->add<KToggleAction>("descending");
+    sortDescending->setText(i18n("Descending"));
     connect(sortDescending, SIGNAL(triggered()), this, SLOT(toggleSortOrder()));
 
-    KToggleAction* showPreview = new KToggleAction(i18n("Show Preview"), actionCollection(), "show_preview");
+    KToggleAction* showPreview = actionCollection()->add<KToggleAction>("show_preview");
+    showPreview->setText(i18n("Show Preview"));
     connect(showPreview, SIGNAL(triggered()), this, SLOT(togglePreview()));
 
-    KToggleAction* showHiddenFiles = new KToggleAction(i18n("Show Hidden Files"), actionCollection(), "show_hidden_files");
+    KToggleAction* showHiddenFiles = actionCollection()->add<KToggleAction>("show_hidden_files");
+    showHiddenFiles->setText(i18n("Show Hidden Files"));
     //showHiddenFiles->setShortcut(Qt::ALT | Qt::Key_      KDE4-TODO: what Qt-Key represents '.'?
     connect(showHiddenFiles, SIGNAL(triggered()), this, SLOT(toggleShowHiddenFiles()));
 
-    KToggleAction* split = new KToggleAction(i18n("Split View"), actionCollection(), "split_view");
+    KToggleAction* split = actionCollection()->add<KToggleAction>("split_view");
+    split->setText(i18n("Split View"));
     split->setShortcut(Qt::Key_F10);
     split->setIcon(KIcon("view_left_right"));
     connect(split, SIGNAL(triggered()), this, SLOT(toggleSplitView()));
 
-    KAction* reload = new KAction(actionCollection(), "reload");
+    QAction* reload = actionCollection()->addAction("reload");
     reload->setText(i18n("Reload"));
     reload->setShortcut(Qt::Key_F5);
     reload->setIcon(KIcon("reload"));
     connect(reload, SIGNAL(triggered()), this, SLOT(reloadView()));
 
-    KAction* stop = new KAction(i18n("Stop"), actionCollection(), "stop");
+    QAction* stop = actionCollection()->addAction("stop");
+    stop->setText(i18n("Stop"));
     stop->setIcon(KIcon("stop"));
     connect(stop, SIGNAL(triggered()), this, SLOT(stopLoading()));
 
-    KToggleAction* showFullLocation = new KToggleAction(i18n("Show Full Location"), actionCollection(), "editable_location");
+    KToggleAction* showFullLocation = actionCollection()->add<KToggleAction>("editable_location");
+    showFullLocation->setText(i18n("Show Full Location"));
     showFullLocation->setShortcut(Qt::CTRL | Qt::Key_L);
     connect(showFullLocation, SIGNAL(triggered()), this, SLOT(toggleEditLocation()));
 
-    KToggleAction* editLocation = new KToggleAction(i18n("Edit Location"), actionCollection(), "edit_location");
+    KToggleAction* editLocation = actionCollection()->add<KToggleAction>("edit_location");
+    editLocation->setText(i18n("Edit Location"));
     editLocation->setShortcut(Qt::Key_F6);
     connect(editLocation, SIGNAL(triggered()), this, SLOT(editLocation()));
 
-    KAction* adjustViewProps = new KAction(i18n("Adjust View Properties..."), actionCollection(), "view_properties");
+    QAction* adjustViewProps = actionCollection()->addAction("view_properties");
+    adjustViewProps->setText(i18n("Adjust View Properties..."));
     connect(adjustViewProps, SIGNAL(triggered()), this, SLOT(adjustViewProperties()));
 
     // setup 'Go' menu
-    KStdAction::back(this, SLOT(goBack()), actionCollection());
-    KStdAction::forward(this, SLOT(goForward()), actionCollection());
-    KStdAction::up(this, SLOT(goUp()), actionCollection());
-    KStdAction::home(this, SLOT(goHome()), actionCollection());
+    KStandardAction::back(this, SLOT(goBack()), actionCollection());
+    KStandardAction::forward(this, SLOT(goForward()), actionCollection());
+    KStandardAction::up(this, SLOT(goUp()), actionCollection());
+    KStandardAction::home(this, SLOT(goHome()), actionCollection());
 
     // setup 'Tools' menu
-    KAction* openTerminal = new KAction(i18n("Open Terminal"), actionCollection(), "open_terminal");
+    QAction* openTerminal = actionCollection()->addAction("open_terminal");
+    openTerminal->setText(i18n("Open Terminal"));
     openTerminal->setShortcut(Qt::Key_F4);
     openTerminal->setIcon(KIcon("konsole"));
     connect(openTerminal, SIGNAL(triggered()), this, SLOT(openTerminal()));
 
-    KAction* findFile = new KAction(i18n("Find File..."), actionCollection(), "find_file");
+    QAction* findFile = actionCollection()->addAction("find_file");
+    findFile->setText(i18n("Find File..."));
     findFile->setShortcut(Qt::Key_F);
     findFile->setIcon(KIcon("filefind"));
     connect(findFile, SIGNAL(triggered()), this, SLOT(findFile()));
 
-    KToggleAction* showFilterBar = new KToggleAction(i18n("Show Filter Bar"), actionCollection(), "show_filter_bar");
+    KToggleAction* showFilterBar = actionCollection()->add<KToggleAction>("show_filter_bar");
+    showFilterBar->setText(i18n("Show Filter Bar"));
     showFilterBar->setShortcut(Qt::Key_Slash);
     connect(showFilterBar, SIGNAL(triggered()), this, SLOT(showFilterBar()));
 
-    KAction* compareFiles = new KAction(i18n("Compare Files"), actionCollection(), "compare_files");
+    QAction* compareFiles = actionCollection()->addAction("compare_files");
+    compareFiles->setText(i18n("Compare Files"));
     compareFiles->setIcon(KIcon("kompare"));
     compareFiles->setEnabled(false);
     connect(compareFiles, SIGNAL(triggered()), this, SLOT(compareFiles()));
 
     // setup 'Settings' menu
-    KStdAction::preferences(this, SLOT(editSettings()), actionCollection());
+    KStandardAction::preferences(this, SLOT(editSettings()), actionCollection());
 }
 
 void DolphinMainWindow::setupDockWidgets()
 {
-    QDockWidget *shortcutsDock = new QDockWidget(i18n("Shortcuts"));
-
-    shortcutsDock->setObjectName("shortcutsDock");
+    QDockWidget* shortcutsDock = new QDockWidget(i18n("Bookmarks"));
+    shortcutsDock->setObjectName("bookmarksDock");
+    shortcutsDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
     shortcutsDock->setWidget(new BookmarksSidebarPage(this));
 
-    shortcutsDock->toggleViewAction()->setObjectName("show_shortcuts_pane");
-    shortcutsDock->toggleViewAction()->setText(i18n("Show Shortcuts Panel"));
-    actionCollection()->insert(shortcutsDock->toggleViewAction());
+    shortcutsDock->toggleViewAction()->setText(i18n("Show Bookmarks Panel"));
+    actionCollection()->addAction("show_bookmarks_panel", shortcutsDock->toggleViewAction());
 
     addDockWidget(Qt::LeftDockWidgetArea, shortcutsDock);
 
-    QDockWidget *infoDock = new QDockWidget(i18n("Information"));
-
+    QDockWidget* infoDock = new QDockWidget(i18n("Information"));
     infoDock->setObjectName("infoDock");
+    infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
     infoDock->setWidget(new InfoSidebarPage(this));
 
-    infoDock->toggleViewAction()->setObjectName("show_info_pane");
     infoDock->toggleViewAction()->setText(i18n("Show Information Panel"));
-    actionCollection()->insert(infoDock->toggleViewAction());
+    actionCollection()->addAction("show_info_panel", infoDock->toggleViewAction());
 
     addDockWidget(Qt::RightDockWidgetArea, infoDock);
 }
@@ -1488,12 +1525,12 @@ void DolphinMainWindow::updateEditActions()
 
 void DolphinMainWindow::updateViewActions()
 {
-    QAction* zoomInAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomIn));
+    QAction* zoomInAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::ZoomIn));
     if (zoomInAction != 0) {
         zoomInAction->setEnabled(m_activeView->isZoomInPossible());
     }
 
-    QAction* zoomOutAction = actionCollection()->action(KStdAction::stdName(KStdAction::ZoomOut));
+    QAction* zoomOutAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::ZoomOut));
     if (zoomOutAction != 0) {
         zoomOutAction->setEnabled(m_activeView->isZoomOutPossible());
     }
@@ -1535,35 +1572,11 @@ void DolphinMainWindow::updateViewActions()
 
 void DolphinMainWindow::updateGoActions()
 {
-    QAction* goUpAction = actionCollection()->action(KStdAction::stdName(KStdAction::Up));
+    QAction* goUpAction = actionCollection()->action(KStandardAction::stdName(KStandardAction::Up));
     const KUrl& currentUrl = m_activeView->url();
     goUpAction->setEnabled(currentUrl.upUrl() != currentUrl);
 }
 
-void DolphinMainWindow::updateViewProperties(const KUrl::List& urls)
-{
-    if (urls.isEmpty()) {
-        return;
-    }
-
-    // Updating the view properties might take up to several seconds
-    // when dragging several thousand Urls. Writing a KIO slave for this
-    // use case is not worth the effort, but at least the main widget
-    // must be disabled and a progress should be shown.
-    ProgressIndicator progressIndicator(this,
-                                        i18n("Updating view properties..."),
-                                        QString::null,
-                                        urls.count());
-
-    KUrl::List::ConstIterator end = urls.end();
-    for(KUrl::List::ConstIterator it = urls.begin(); it != end; ++it) {
-        progressIndicator.execOperation();
-
-        ViewProperties props(*it);
-        props.save();
-    }
-}
-
 void DolphinMainWindow::copyUrls(const KUrl::List& source, const KUrl& dest)
 {
     KIO::Job* job = KIO::copy(source, dest);