Branch: master

48635e63 2019-04-08 03:16:10 Michele Calgaro
Added trash size limit property page link to trash folder right click
popup menu and trash applet panel.
Added a new konqueror side bar button to directly display the contents
of the trash bin.
This relates to bug 1923.

Signed-off-by: Michele Calgaro <michele.calgaro@...>
A konqueror/sidebar/trees/init/trash.desktop
M konqueror/sidebar/.version
M konqueror/sidebar/trees/init/CMakeLists.txt
M konqueror/sidebar/trees/init/Makefile.am
M tdeioslave/trash/ktrashpropsdlgplugin.cpp
M tdeioslave/trash/ktrashpropsdlgplugin.desktop

konqueror/sidebar/.version

diff --git a/konqueror/sidebar/.version b/konqueror/sidebar/.version
index 9cb17c3..f16e714 100644
--- a/konqueror/sidebar/.version
+++ b/konqueror/sidebar/.version
@@ -1 +1 @@
-Version=3
+Version=4

konqueror/sidebar/trees/init/CMakeLists.txt

diff --git a/konqueror/sidebar/trees/init/CMakeLists.txt b/konqueror/sidebar/trees/init/CMakeLists.txt
index 02df2ab..bf32004 100644
--- a/konqueror/sidebar/trees/init/CMakeLists.txt
+++ b/konqueror/sidebar/trees/init/CMakeLists.txt
@@ -17,12 +17,12 @@
 
 install( FILES
     home.desktop root.desktop history.desktop bookmarks.desktop
-    services.desktop remote.desktop system.desktop
+    services.desktop remote.desktop system.desktop trash.desktop
   DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/entries )
 
 install( FILES
     home.desktop root.desktop history.desktop bookmarks.desktop
-    services.desktop remote.desktop
+    services.desktop remote.desktop trash.desktop
   DESTINATION ${DATA_INSTALL_DIR}/konqsidebartng/kicker_entries )
 
 install( FILES

konqueror/sidebar/trees/init/Makefile.am

diff --git a/konqueror/sidebar/trees/init/Makefile.am b/konqueror/sidebar/trees/init/Makefile.am
index 58c6186..85ba976 100644
--- a/konqueror/sidebar/trees/init/Makefile.am
+++ b/konqueror/sidebar/trees/init/Makefile.am
@@ -1,11 +1,11 @@
 SUBDIRS = remote services
 
 dataEntry_DATA = home.desktop root.desktop history.desktop bookmarks.desktop \
-                 services.desktop remote.desktop system.desktop
+                 services.desktop remote.desktop system.desktop trash.desktop
 dataEntrydir = $(kde_datadir)/konqsidebartng/entries
 
 dataKickerEntries_DATA = home.desktop root.desktop history.desktop bookmarks.desktop \
-                 services.desktop remote.desktop
+                 services.desktop remote.desktop trash.desktop
 dataKickerEntriesdir = $(kde_datadir)/konqsidebartng/kicker_entries
 
 

konqueror/sidebar/trees/init/trash.desktop

diff --git a/konqueror/sidebar/trees/init/trash.desktop b/konqueror/sidebar/trees/init/trash.desktop
new file mode 100644
index 0000000..1476381
--- /dev/null
+++ b/konqueror/sidebar/trees/init/trash.desktop
@@ -0,0 +1,15 @@
+[Desktop Entry]
+Type=Link
+URL=trash:/
+Icon=trashcan_empty
+Open=true
+X-TDE-TreeModule=Directory
+X-TDE-KonqSidebarModule=konqsidebar_tree
+
+Name=Trash Folder
+Name[cz]=Složka koše
+Name[it]=Cartella Cestino
+
+Comment=This folder displays the contents of your Trash Bin
+Comment[cz]=Tato složka zobrazuje obsah vašeho koše
+Comment[it]=Questa cartella visualizza il contenuto del tuo Cestino

tdeioslave/trash/ktrashpropsdlgplugin.cpp

diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.cpp b/tdeioslave/trash/ktrashpropsdlgplugin.cpp
index 87a70ae..1677c28 100644
--- a/tdeioslave/trash/ktrashpropsdlgplugin.cpp
+++ b/tdeioslave/trash/ktrashpropsdlgplugin.cpp
@@ -55,14 +55,17 @@
     return;
 
   KFileItem *item = dialog->items().first();
+  KURL itemUrl = item->url();
+	if (!(itemUrl.protocol() == "trash" && item->name() == "."))
+	{
+	  // Check for a desktop file in case the protocol is not "trash"
+		if (!KPropsDlgPlugin::isDesktopFile(item))
+			return;
 
-  if ( !KPropsDlgPlugin::isDesktopFile( item ) )
-    return;
-
-  KDesktopFile deskFile( item->url().path(), true /* readonly */ );
-
-  if ( deskFile.readURL() != "trash:/" )
-    return;
+		KDesktopFile deskFile( itemUrl.path(), true /* readonly */ );
+		if ( deskFile.readURL() != "trash:/" )
+			return;
+	}
 
   TDEGlobal::locale()->insertCatalogue( "tdeio_trash" );
 

tdeioslave/trash/ktrashpropsdlgplugin.desktop

diff --git a/tdeioslave/trash/ktrashpropsdlgplugin.desktop b/tdeioslave/trash/ktrashpropsdlgplugin.desktop
index 39782d6..76ed40d 100644
--- a/tdeioslave/trash/ktrashpropsdlgplugin.desktop
+++ b/tdeioslave/trash/ktrashpropsdlgplugin.desktop
@@ -1,7 +1,8 @@
 [Desktop Entry]
 Type=Service
-Name=Trash Properties Page
+Name=Trash Properties
 Name[bg]=Свойства на кошчето
+Name[cz]=Vlastnosti koše
 Name[it]=Proprietà del cestino
 X-TDE-Library=ktrashpropsdlgplugin
-X-TDE-ServiceTypes=KPropsDlg/Plugin,media/builtin-trash
+X-TDE-ServiceTypes=KPropsDlg/Plugin,media/builtin-trash,inode/directory