]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Move (broken) editMimeType action from konqueror to dolphinpart (and made it work...
authorDavid Faure <faure@kde.org>
Mon, 24 Dec 2007 11:50:08 +0000 (11:50 +0000)
committerDavid Faure <faure@kde.org>
Mon, 24 Dec 2007 11:50:08 +0000 (11:50 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=752422

src/dolphinpart.cpp
src/dolphinpart.h
src/dolphinpart.rc

index bd986dcf5ab6796bb87468f9da9858cf85946b51..da6faecc6f4ceb59d7563c6855c85510e9f5a4fe 100644 (file)
@@ -130,6 +130,10 @@ void DolphinPart::createActions()
     KAction* deleteAction = DolphinView::createDeleteAction(actionCollection());
     connect(deleteAction, SIGNAL(triggered()), m_view, SLOT(deleteSelectedItems()));
 
+    KAction *editMimeTypeAction = actionCollection()->addAction( "editMimeType" );
+    editMimeTypeAction->setText( i18n( "&Edit File Type..." ) );
+    connect(editMimeTypeAction, SIGNAL(triggered()), SLOT(slotEditMimeType()));
+
     // This action doesn't appear in the GUI, it's for the shortcut only.
     // KNewMenu takes care of the GUI stuff.
     KAction* newDirAction = actionCollection()->addAction( "create_dir" );
@@ -188,7 +192,7 @@ void DolphinPart::slotSelectionChanged(const KFileItemList& selection)
     }
 
     QStringList actions;
-    actions << "rename" << "move_to_trash" << "delete";
+    actions << "rename" << "move_to_trash" << "delete" << "editMimeType";
     foreach(const QString& actionName, actions) {
         QAction* action = actionCollection()->action(actionName);
         Q_ASSERT(action);
@@ -399,4 +403,12 @@ void DolphinPart::slotNewDir()
     KonqOperations::newDir(widget(), url());
 }
 
+void DolphinPart::slotEditMimeType()
+{
+    const KFileItemList items = m_view->selectedItems();
+    if (!items.isEmpty()) {
+        KonqOperations::editMimeType( items.first().mimetype(), m_view );
+    }
+}
+
 #include "dolphinpart.moc"
index 98e0f2f672704010bcec0aeb3863d819f2b735c6..23a5ea653e2bf13b307ed0d65305d653ff52c4c3 100644 (file)
@@ -125,6 +125,11 @@ private Q_SLOTS:
      */
     void slotGoTriggered(QAction* action);
 
+    /**
+     * Connected to the "editMimeType" action
+     */
+    void slotEditMimeType();
+
 private:
     void createActions();
     void createGoAction(const char* name, const char* iconName,
index 26002ceaf839beb18a7336dbf0f24290e9a72e46..325a3650fc263d95a5e922319b3f78f642c797af 100644 (file)
@@ -5,6 +5,7 @@
    <Action name="rename"/>
    <Action name="move_to_trash" />
    <Action name="delete"/>
+   <Action name="editMimeType"/>
    <Separator />
    <Action name="select_all" />
    <Action name="invert_selection" />