Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KDE Base Apps
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Unmaintained
KDE Base Apps
Commits
d8d0e423
Commit
d8d0e423
authored
12 years ago
by
Dawit Alemayehu
Browse files
Options
Downloads
Patches
Plain Diff
Fixed regressions that prevented file manipulation from working properly.
BUG: 180579 FIXED-IN: 4.9.4
parent
14cb9e87
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
konq-plugins/fsview/fsview_part.cpp
+50
-16
50 additions, 16 deletions
konq-plugins/fsview/fsview_part.cpp
konq-plugins/fsview/fsview_part.h
+1
-0
1 addition, 0 deletions
konq-plugins/fsview/fsview_part.h
with
51 additions
and
16 deletions
konq-plugins/fsview/fsview_part.cpp
+
50
−
16
View file @
d8d0e423
...
...
@@ -40,6 +40,7 @@
#include
<kmessagebox.h>
#include
<kactionmenu.h>
#include
<kactioncollection.h>
#include
<kpropertiesdialog.h>
#include
<kio/jobuidelegate.h>
// from kdebase/libkonq...
#include
<konq_operations.h>
...
...
@@ -195,7 +196,7 @@ FSViewPart::FSViewPart(QWidget *parentWidget,
KAction
*
editMimeTypeAction
=
actionCollection
()
->
addAction
(
"editMimeType"
);
editMimeTypeAction
->
setText
(
i18nc
(
"@action:inmenu Edit"
,
"&Edit File Type..."
)
);
connect
(
editMimeTypeAction
,
SIGNAL
(
triggered
()),
SLOT
(
slotE
ditMimeType
()));
connect
(
editMimeTypeAction
,
SIGNAL
(
triggered
()),
_ext
,
SLOT
(
e
ditMimeType
()));
KAction
*
propertiesAction
=
actionCollection
()
->
addAction
(
"properties"
);
propertiesAction
->
setText
(
i18nc
(
"@action:inmenu File"
,
"Properties"
)
);
...
...
@@ -351,13 +352,13 @@ void FSViewPart::updateActions()
if
(
KProtocolManager
::
supportsMoving
(
u
)
)
canMove
++
;
}
// Standard KBrowserExtension actions.
emit
_ext
->
enableAction
(
"copy"
,
canCopy
>
0
);
emit
_ext
->
enableAction
(
"cut"
,
canMove
>
0
);
// Custom actions.
//setNonStandardActionEnabled("rename", canMove > 0 ); // FIXME
setNonStandardActionEnabled
(
"move_to_trash"
,
canDel
>
0
);
setNonStandardActionEnabled
(
"move_to_trash"
,
(
canDel
>
0
&&
canMove
>
0
)
);
setNonStandardActionEnabled
(
"delete"
,
canDel
>
0
);
setNonStandardActionEnabled
(
"editMimeType"
,
_view
->
selection
().
count
()
==
1
);
setNonStandardActionEnabled
(
"properties"
,
_view
->
selection
().
count
()
==
1
);
...
...
@@ -391,29 +392,62 @@ void FSViewPart::contextMenu(TreeMapItem* /*item*/,const QPoint& p)
canCopy
++
;
if
(
KProtocolManager
::
supportsDeleting
(
u
)
)
canDel
++
;
if
(
KProtocolManager
::
supportsMoving
(
u
)
)
canMove
++
;
if
(
KProtocolManager
::
supportsMoving
(
u
)
)
canMove
++
;
}
KParts
::
BrowserExtension
::
ActionGroupMap
actionGroups
;
QList
<
QAction
*>
editActions
;
if
(
canDel
>
0
)
{
editActions
.
append
(
actionCollection
()
->
action
(
"move_to_trash"
));
editActions
.
append
(
actionCollection
()
->
action
(
"delete"
));
KParts
::
BrowserExtension
::
ActionGroupMap
actionGroups
;
KParts
::
BrowserExtension
::
PopupFlags
flags
=
KParts
::
BrowserExtension
::
ShowUrlOperations
|
KParts
::
BrowserExtension
::
ShowProperties
;
bool
addTrash
=
(
canMove
>
0
);
bool
addDel
=
false
;
if
(
canDel
==
0
)
{
flags
|=
KParts
::
BrowserExtension
::
NoDeletion
;
}
else
{
if
(
!
url
().
isLocalFile
()
)
addDel
=
true
;
else
if
(
QApplication
::
keyboardModifiers
()
&
Qt
::
ShiftModifier
)
{
addTrash
=
false
;
addDel
=
true
;
}
else
{
KSharedConfig
::
Ptr
globalConfig
=
KSharedConfig
::
openConfig
(
"kdeglobals"
,
KConfig
::
IncludeGlobals
);
KConfigGroup
configGroup
(
globalConfig
,
"KDE"
);
addDel
=
configGroup
.
readEntry
(
"ShowDeleteCommand"
,
false
);
}
}
if
(
canMove
)
editActions
.
append
(
actionCollection
()
->
action
(
"rename"
));
if
(
addTrash
)
editActions
.
append
(
actionCollection
()
->
action
(
"move_to_trash"
));
if
(
addDel
)
editActions
.
append
(
actionCollection
()
->
action
(
"delete"
));
// FIXME: rename is currently unavailable. Requires popup renaming.
// if (canMove)
// editActions.append(actionCollection()->action("rename"));
actionGroups
.
insert
(
"editactions"
,
editActions
);
if
(
items
.
count
()
>
0
)
emit
_ext
->
popupMenu
(
_view
->
mapToGlobal
(
p
),
items
,
KParts
::
OpenUrlArguments
(),
KParts
::
BrowserArguments
(),
KParts
::
BrowserExtension
::
ShowUrlOperations
|
KParts
::
BrowserExtension
::
ShowProperties
,
actionGroups
);
KParts
::
OpenUrlArguments
(),
KParts
::
BrowserArguments
(),
flags
,
actionGroups
);
}
void
FSViewPart
::
slotProperties
()
{
KUrl
::
List
urlList
;
if
(
view
())
{
urlList
=
view
()
->
selectedUrls
();
}
if
(
!
urlList
.
isEmpty
())
{
KPropertiesDialog
::
showDialog
(
urlList
.
first
(),
view
());
}
}
// FSViewBrowserExtension
...
...
This diff is collapsed.
Click to expand it.
konq-plugins/fsview/fsview_part.h
+
1
−
0
View file @
d8d0e423
...
...
@@ -101,6 +101,7 @@ public slots:
void
slotShowDepthMenu
();
void
slotShowColorMenu
();
void
slotSettingsChanged
(
int
);
void
slotProperties
();
protected
:
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment