summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kcontrol/filetypes/typeslistitem.cpp12
-rw-r--r--kdesktop/kdesktop.kcfg2
-rw-r--r--kdesktop/kdiconview.cc67
-rw-r--r--kicker/kicker/core/containerarea.cpp29
-rw-r--r--kioslave/media/mimetypes/Makefile.am3
-rw-r--r--kioslave/media/mimetypes/mycomputer.desktop8
-rw-r--r--kioslave/media/mimetypes/mydocuments.desktop8
-rw-r--r--kioslave/media/mimetypes/mynetworkplaces.desktop8
-rw-r--r--kioslave/media/mimetypes/printers.desktop8
-rw-r--r--kioslave/media/mimetypes/trash.desktop9
-rw-r--r--kioslave/media/mimetypes/webbrowser.desktop8
-rw-r--r--konqueror/sidebar/trees/konq_sidebartree.cpp9
-rw-r--r--libkonq/konq_operations.cc8
-rw-r--r--libkonq/konq_popupmenu.cc16
14 files changed, 175 insertions, 20 deletions
diff --git a/kcontrol/filetypes/typeslistitem.cpp b/kcontrol/filetypes/typeslistitem.cpp
index 5bef9a5d6..8ff08d157 100644
--- a/kcontrol/filetypes/typeslistitem.cpp
+++ b/kcontrol/filetypes/typeslistitem.cpp
@@ -539,6 +539,18 @@ bool TypesListItem::isEssential() const
return true;
if ( n == "application/x-desktop" )
return true;
+ if ( n == "media/builtin-mydocuments" )
+ return true;
+ if ( n == "media/builtin-mycomputer" )
+ return true;
+ if ( n == "media/builtin-mynetworkplaces" )
+ return true;
+ if ( n == "media/builtin-printers" )
+ return true;
+ if ( n == "media/builtin-trash" )
+ return true;
+ if ( n == "media/builtin-webbrowser" )
+ return true;
return false;
}
diff --git a/kdesktop/kdesktop.kcfg b/kdesktop/kdesktop.kcfg
index 739e40e16..b0dd4f003 100644
--- a/kdesktop/kdesktop.kcfg
+++ b/kdesktop/kdesktop.kcfg
@@ -203,7 +203,7 @@
<!-- m_enableMedia=config->readBoolEntry("enabled",false); -->
</entry>
<entry key="exclude" type="String">
- <default>media/hdd_mounted,media/hdd_unmounted,media/floppy_unmounted,media/cdrom_unmounted,media/floppy5_unmounted</default>
+ <default>media/hdd_mounted,media/hdd_unmounted,media/floppy_unmounted,media/cdrom_unmounted,media/floppy5_unmounted,media/builtin-mydocuments,media/builtin-mycomputer,media/builtin-mynetworkplaces,media/builtin-printers,media/builtin-trash,media/builtin-webbrowser</default>
<label>Device Types to exclude</label>
<whatsthis>The device types which you do not want to see on the desktop.</whatsthis>
<!-- kdiconview.cc:261 -->
diff --git a/kdesktop/kdiconview.cc b/kdesktop/kdiconview.cc
index 5762458fd..75e8d10a7 100644
--- a/kdesktop/kdiconview.cc
+++ b/kdesktop/kdiconview.cc
@@ -485,7 +485,7 @@ void KDIconView::setAutoAlign( bool b )
// Auto line-up icons
if ( b ) {
- if (!KRootWm::self()->startup) lineupIcons(); else KRootWm::self()->startup = false;
+ if (!KRootWm::self()->startup) lineupIcons(); else KRootWm::self()->startup = false;
connect( this, TQT_SIGNAL( iconMoved() ),
this, TQT_SLOT( lineupIcons() ) );
}
@@ -759,6 +759,55 @@ bool KDIconView::deleteGlobalDesktopFiles()
continue; // Not a .desktop file
}
+ // Ignore these special files
+ // Name URL Type OnlyShowIn
+ // My Documents $HOME/Documents Link KDE;
+ // My Computer media:/ Link KDE;
+ // My Network Places remote:/ Link KDE;
+ // Printers [exec] kjobviewer --all --show %i %m Application KDE;
+ // Trash trash:/ Link KDE;
+ // Web Browser <dont care> Application KDE;
+
+ if ( isDesktopFile(fItem) ) {
+ KSimpleConfig cfg( fItem->url().path(), true );
+ cfg.setDesktopGroup();
+ if ( cfg.readEntry( "Type" ) == "Link" &&
+ cfg.readEntry( "URL" ) == "$HOME/Documents" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "My Documents" ) {
+ continue;
+ }
+ if ( cfg.readEntry( "Type" ) == "Link" &&
+ cfg.readEntry( "URL" ) == "media:/" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "My Computer" ) {
+ continue;
+ }
+ if ( cfg.readEntry( "Type" ) == "Link" &&
+ cfg.readEntry( "URL" ) == "remote:/" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "My Network Places" ) {
+ continue;
+ }
+ if ( cfg.readEntry( "Type" ) == "Application" &&
+ cfg.readEntry( "Exec" ) == "kjobviewer --all --show %i %m" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "Printers" ) {
+ continue;
+ }
+ if ( cfg.readEntry( "Type" ) == "Link" &&
+ cfg.readEntry( "URL" ) == "trash:/" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "Trash" ) {
+ continue;
+ }
+ if ( cfg.readEntry( "Type" ) == "Application" &&
+ cfg.readEntry( "OnlyShowIn" ) == "KDE;" &&
+ cfg.readEntry( "Name" ) == "Web Browser" ) {
+ continue;
+ }
+ }
+
KDesktopFile df(desktopPath + fItem->url().fileName());
df.writeEntry("Hidden", true);
df.sync();
@@ -868,7 +917,13 @@ bool KDIconView::isDesktopFile( KFileItem * _item ) const
return false;
// return true if desktop file
- return ( _item->mimetype() == TQString::fromLatin1("application/x-desktop") );
+ return ( (_item->mimetype() == TQString::fromLatin1("application/x-desktop"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-mydocuments"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-mycomputer"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-mynetworkplaces"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-printers"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-trash"))
+ || (_item->mimetype() == TQString::fromLatin1("media/builtin-webbrowser")) );
}
TQString KDIconView::stripDesktopExtension( const TQString & text )
@@ -1277,7 +1332,13 @@ void KDIconView::slotItemRenamed(TQIconViewItem* _item, const TQString &name)
KMimeType::Ptr type = KMimeType::findByURL( fileItem->item()->url() );
bool bDesktopFile = false;
- if (type->name() == "application/x-desktop")
+ if ( (type->name() == "application/x-desktop")
+ || (type->name() == "media/builtin-mydocuments")
+ || (type->name() == "media/builtin-mycomputer")
+ || (type->name() == "media/builtin-mynetworkplaces")
+ || (type->name() == "media/builtin-printers")
+ || (type->name() == "media/builtin-trash")
+ || (type->name() == "media/builtin-webbrowser") )
{
bDesktopFile = true;
if (!newName.endsWith(".desktop"))
diff --git a/kicker/kicker/core/containerarea.cpp b/kicker/kicker/core/containerarea.cpp
index 1bd80bc65..889c48ce8 100644
--- a/kicker/kicker/core/containerarea.cpp
+++ b/kicker/kicker/core/containerarea.cpp
@@ -93,9 +93,9 @@ ContainerArea::ContainerArea(KConfig* _c,
setBackgroundOrigin( WidgetOrigin );
m_contents = viewport();
-
+
m_layout = new ContainerAreaLayout(m_contents);
-
+
// Install an event filter to propagate layout hints coming from m_contents.
m_contents->installEventFilter(this);
@@ -404,14 +404,14 @@ void ContainerArea::removeAllContainers()
void ContainerArea::configure()
{
setBackground();
-
+
for (BaseContainer::Iterator it = m_containers.begin();
it != m_containers.end();
++it)
{
(*it)->configure();
}
-
+
resizeContents();
}
@@ -1277,12 +1277,12 @@ void ContainerArea::dropEvent(TQDropEvent *ev)
}
a = new ServiceMenuButtonContainer(relPath, m_opMenu, m_contents);
}
- else if (url.isLocalFile())
+ else if (url.isLocalFile())
{
TQFileInfo fi(url.path());
- if (fi.isDir())
+ if (fi.isDir())
{ // directory
- switch (PanelDirDropMenu().exec(mapToGlobal(ev->pos())))
+ switch (PanelDirDropMenu().exec(mapToGlobal(ev->pos())))
{
case PanelDirDropMenu::Browser:
a = new BrowserButtonContainer(url.path(), m_opMenu,
@@ -1294,7 +1294,14 @@ void ContainerArea::dropEvent(TQDropEvent *ev)
default: ;
}
}
- else if ( KMimeType::findByURL(url)->name() == "application/x-desktop" )
+ TQString foundMimeName = KMimeType::findByURL(url)->name();
+ else if ( (foundMimeName == "application/x-desktop")
+ || (foundMimeName == "media/builtin-mydocuments")
+ || (foundMimeName == "media/builtin-mycomputer")
+ || (foundMimeName == "media/builtin-mynetworkplaces")
+ || (foundMimeName == "media/builtin-printers")
+ || (foundMimeName == "media/builtin-trash")
+ || (foundMimeName == "media/builtin-webbrowser") )
{
// a local desktop file being dragged from an external program.
// Make a copy first.
@@ -1675,7 +1682,7 @@ void ContainerArea::setPosition(KPanelExtension::Position p)
resizeContents(width(), 0);
}
}
-
+
for (BaseContainer::ConstIterator it = m_containers.constBegin();
it != m_containers.constEnd();
++it)
@@ -1689,7 +1696,7 @@ void ContainerArea::setPosition(KPanelExtension::Position p)
}
m_layout->setEnabled(true);
-
+
setContentsPos(0, 0);
m_contents->move(0, 0);
setBackground();
@@ -1918,7 +1925,7 @@ int ContainerArea::heightForWidth(int w) const
DragIndicator::DragIndicator(TQWidget* parent, const char* name)
- : TQWidget(parent, name)
+ : TQWidget(parent, name)
{
setBackgroundOrigin(AncestorOrigin);
}
diff --git a/kioslave/media/mimetypes/Makefile.am b/kioslave/media/mimetypes/Makefile.am
index cdb66a1ac..7b821303b 100644
--- a/kioslave/media/mimetypes/Makefile.am
+++ b/kioslave/media/mimetypes/Makefile.am
@@ -26,7 +26,8 @@ mimetype_DATA = floppy_mounted.desktop floppy_unmounted.desktop \
blankdvd.desktop \
svcd.desktop \
vcd.desktop\
- gphoto2camera.desktop camera_mounted.desktop camera_unmounted.desktop
+ gphoto2camera.desktop camera_mounted.desktop camera_unmounted.desktop \
+ mydocuments.desktop mycomputer.desktop mynetworkplaces.desktop printers.desktop trash.desktop webbrowser.desktop
EXTRA_DIST = $(mimetype_DATA)
diff --git a/kioslave/media/mimetypes/mycomputer.desktop b/kioslave/media/mimetypes/mycomputer.desktop
new file mode 100644
index 000000000..a354f5033
--- /dev/null
+++ b/kioslave/media/mimetypes/mycomputer.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Icon=system
+Type=MimeType
+MimeType=media/builtin-mycomputer
+Comment=My Computer
+Patterns=My Computer
+
+X-KDE-AutoEmbed=false
diff --git a/kioslave/media/mimetypes/mydocuments.desktop b/kioslave/media/mimetypes/mydocuments.desktop
new file mode 100644
index 000000000..f9a8c261c
--- /dev/null
+++ b/kioslave/media/mimetypes/mydocuments.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Icon=folder_wordprocessing
+Type=MimeType
+MimeType=media/builtin-mydocuments
+Comment=My Documents
+Patterns=My Documents
+
+X-KDE-AutoEmbed=false
diff --git a/kioslave/media/mimetypes/mynetworkplaces.desktop b/kioslave/media/mimetypes/mynetworkplaces.desktop
new file mode 100644
index 000000000..3061dd160
--- /dev/null
+++ b/kioslave/media/mimetypes/mynetworkplaces.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Icon=network
+Type=MimeType
+MimeType=media/builtin-mynetworkplaces
+Comment=My Network Places
+Patterns=My Network Places
+
+X-KDE-AutoEmbed=false
diff --git a/kioslave/media/mimetypes/printers.desktop b/kioslave/media/mimetypes/printers.desktop
new file mode 100644
index 000000000..d780ff63b
--- /dev/null
+++ b/kioslave/media/mimetypes/printers.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Icon=kjobviewer
+Type=MimeType
+MimeType=media/builtin-printers
+Comment=Printers
+Patterns=Printers
+
+X-KDE-AutoEmbed=false
diff --git a/kioslave/media/mimetypes/trash.desktop b/kioslave/media/mimetypes/trash.desktop
new file mode 100644
index 000000000..53b523ebb
--- /dev/null
+++ b/kioslave/media/mimetypes/trash.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Icon=trashcan_full
+EmptyIcon=trashcan_empty
+Type=MimeType
+MimeType=media/builtin-trash
+Comment=Trash
+Patterns=Trash
+
+X-KDE-AutoEmbed=false
diff --git a/kioslave/media/mimetypes/webbrowser.desktop b/kioslave/media/mimetypes/webbrowser.desktop
new file mode 100644
index 000000000..0d495f0b6
--- /dev/null
+++ b/kioslave/media/mimetypes/webbrowser.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Icon=konqueror
+Type=MimeType
+MimeType=media/builtin-webbrowser
+Comment=Web Browser
+Patterns=Web Browser
+
+X-KDE-AutoEmbed=false
diff --git a/konqueror/sidebar/trees/konq_sidebartree.cpp b/konqueror/sidebar/trees/konq_sidebartree.cpp
index 191de6eeb..c1c98e07a 100644
--- a/konqueror/sidebar/trees/konq_sidebartree.cpp
+++ b/konqueror/sidebar/trees/konq_sidebartree.cpp
@@ -680,7 +680,14 @@ void KonqSidebarTree::scanDir( KonqSidebarTreeItem *parent, const TQString &path
TQString filePath = TQString( *eIt ).prepend( path );
KURL u;
u.setPath( filePath );
- if ( KMimeType::findByURL( u, 0, true )->name() == "application/x-desktop" )
+ TQString foundMimeName = KMimeType::findByURL( u, 0, true )->name();
+ if ( (foundMimeName == "application/x-desktop")
+ || (foundMimeName == "media/builtin-mydocuments")
+ || (foundMimeName == "media/builtin-mycomputer")
+ || (foundMimeName == "media/builtin-mynetworkplaces")
+ || (foundMimeName == "media/builtin-printers")
+ || (foundMimeName == "media/builtin-trash")
+ || (foundMimeName == "media/builtin-webbrowser") )
loadTopLevelItem( parent, filePath );
}
diff --git a/libkonq/konq_operations.cc b/libkonq/konq_operations.cc
index 6c7a2ba81..6a1ebcdb6 100644
--- a/libkonq/konq_operations.cc
+++ b/libkonq/konq_operations.cc
@@ -417,7 +417,13 @@ void KonqOperations::asyncDrop( const KFileItem * destItem )
delete this;
return;
}
- if ( destItem->mimetype() == "application/x-desktop")
+ if ( (destItem->mimetype() == "application/x-desktop")
+ || (destItem->mimetype() == "media/builtin-mydocuments")
+ || (destItem->mimetype() == "media/builtin-mycomputer")
+ || (destItem->mimetype() == "media/builtin-mynetworkplaces")
+ || (destItem->mimetype() == "media/builtin-printers")
+ || (destItem->mimetype() == "media/builtin-trash")
+ || (destItem->mimetype() == "media/builtin-webbrowser") )
{
// Local .desktop file. What type ?
KDesktopFile desktopFile( m_destURL.path() );
diff --git a/libkonq/konq_popupmenu.cc b/libkonq/konq_popupmenu.cc
index 4adfbc01d..044bda9d2 100644
--- a/libkonq/konq_popupmenu.cc
+++ b/libkonq/konq_popupmenu.cc
@@ -424,7 +424,13 @@ void KonqPopupMenu::setup(KonqPopupFlags kpf)
//kdDebug(1203) << "View path is " << url.url() << endl;
//kdDebug(1203) << "First popup path is " << firstPopupURL.url() << endl;
currentDir = firstPopupURL.equals( url, true /* ignore_trailing */ );
- if ( isLocal && m_sMimeType == "application/x-desktop" ) {
+ if ( isLocal && ((m_sMimeType == "application/x-desktop")
+ || (m_sMimeType == "media/builtin-mydocuments")
+ || (m_sMimeType == "media/builtin-mycomputer")
+ || (m_sMimeType == "media/builtin-mynetworkplaces")
+ || (m_sMimeType == "media/builtin-printers")
+ || (m_sMimeType == "media/builtin-trash")
+ || (m_sMimeType == "media/builtin-webbrowser")) ) {
KSimpleConfig cfg( firstPopupURL.path(), true );
cfg.setDesktopGroup();
isTrashLink = ( cfg.readEntry("Type") == "Link" && cfg.readEntry("URL") == "trash:/" );
@@ -629,7 +635,13 @@ void KonqPopupMenu::setup(KonqPopupFlags kpf)
}
// 1 - Look for builtin and user-defined services
- if ( m_sMimeType == "application/x-desktop" && isSingleLocal ) // .desktop file
+ if ( ((m_sMimeType == "application/x-desktop")
+ || (m_sMimeType == "media/builtin-mydocuments")
+ || (m_sMimeType == "media/builtin-mycomputer")
+ || (m_sMimeType == "media/builtin-mynetworkplaces")
+ || (m_sMimeType == "media/builtin-printers")
+ || (m_sMimeType == "media/builtin-trash")
+ || (m_sMimeType == "media/builtin-webbrowser")) && isSingleLocal ) // .desktop file
{
// get builtin services, like mount/unmount
s.builtin = KDEDesktopMimeType::builtinServices( urlForServiceMenu );