diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-15 21:18:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-15 21:18:46 +0000 |
commit | 3b07f92513f03772805943cf9ee77921f7c8aafe (patch) | |
tree | 40551727899bcf4d1f717058fb2f2ab2dbfc70b2 /kdesktop/kdiconview.cc | |
parent | 6eb49d190a25e04bc155976a73cb047c7d5473a3 (diff) | |
download | tdebase-3b07f92513f03772805943cf9ee77921f7c8aafe.tar.gz tdebase-3b07f92513f03772805943cf9ee77921f7c8aafe.zip |
Part 2/2 of prior commit
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1175772 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdesktop/kdiconview.cc')
-rw-r--r-- | kdesktop/kdiconview.cc | 67 |
1 files changed, 64 insertions, 3 deletions
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")) |