setGroup("KDE Desktop Entry") --> setDesktopGroup()

svn path=/trunk/kdebase/libkonq/; revision=20913
This commit is contained in:
Preston Brown 1999-05-06 05:03:16 +00:00
parent 2edaff060d
commit fab2f15cf2
6 changed files with 50 additions and 39 deletions

View file

@ -193,11 +193,11 @@ void KBookmarkManager::scanIntern( KBookmark *_bm, const char * _path )
if ( ok )
{
KSimpleConfig cfg( file, true );
cfg.setGroup( "KDE Desktop Entry" );
cfg.setDesktopGroup();
QString type = cfg.readEntry( "Type" );
// Is it really a bookmark file ?
if ( type == "Link" )
(void) new KBookmark( this, _bm, ep->d_name, cfg, "KDE Desktop Entry" );
(void) new KBookmark( this, _bm, ep->d_name, cfg, "Desktop Entry" );
} else {
// maybe its an IE Favourite..
KSimpleConfig cfg( file, true );
@ -238,9 +238,12 @@ KBookmark::KBookmark( KBookmarkManager *_bm, KBookmark *_parent, QString _text,
m_lstChildren.setAutoDelete( true );
m_text = KBookmark::decode( _text );
if ( m_text.length() > 8 && m_text.right( 8 ) == ".desktop" )
m_text.truncate( m_text.length() - 8 );
if ( m_text.length() > 7 && m_text.right( 7 ) == ".kdelnk" )
m_text.truncate( m_text.length() - 7 );
m_type = URL;
m_file = _parent->file();
@ -307,7 +310,7 @@ KBookmark::KBookmark( KBookmarkManager *_bm, KBookmark *_parent, QString _text,
m_file = _parent->file();
m_file += "/";
m_file += encode( _text );
// m_file += ".kdelnk"; // looks better to the user without extension
// m_file += ".desktop"; // looks better to the user without extension
FILE *f = fopen( m_file, "w" );
if ( f == 0L )
@ -317,7 +320,7 @@ KBookmark::KBookmark( KBookmarkManager *_bm, KBookmark *_parent, QString _text,
}
fprintf( f, "# KDE Config File\n" );
fprintf( f, "[KDE Desktop Entry]\n" );
fprintf( f, "[Desktop Entry]\n" );
fprintf( f, "URL=%s\n", m_url.data() );
fprintf( f, "Icon=%s\n", icon.data() );
fprintf( f, "MiniIcon=%s\n", icon.data() );

View file

@ -101,8 +101,10 @@ void KNewMenu::fillMenu()
for ( ++templ; templ != templatesList->end(); ++templ)
{
KSimpleConfig config(UserPaths::templatesPath() + *templ, true);
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString name = *templ;
if ( name.right(8) == ".desktop" )
name.truncate( name.length() - 8 );
if ( name.right(7) == ".kdelnk" )
name.truncate( name.length() - 7 );
if ( m_bUseOPMenu )
@ -182,7 +184,9 @@ void KNewMenu::slotNewFile( int _id )
return;
}
KSimpleConfig config(x, true);
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
if ( sName.right(8) == ".desktop" )
sName.truncate( sName.length() - 8 );
if ( sName.right(7) == ".kdelnk" )
sName.truncate( sName.length() - 7 );
sName = config.readEntry("Name", sName);
@ -239,7 +243,8 @@ void KNewMenu::slotNewFile( int _id )
// Kfm::setUpDest(&u2);
// --- Sven's check if global apps/mime end ---
if ( sFile.right(7) ==".kdelnk" )
if ( ( sFile.right(7) == ".kdelnk" ) ||
( sFile.right(8) == ".desktop" ) )
{
m_sDest.insert( job->id(), new QString( dest.url() ) );
connect(job, SIGNAL( finished( int ) ), this, SLOT( slotCopyFinished( int ) ) );
@ -253,7 +258,8 @@ void KNewMenu::slotNewFile( int _id )
void KNewMenu::slotCopyFinished( int id )
{
// Now open the properties dialog on the file, as it was a kdelnk
// Now open the properties dialog on the file, as it was a
// desktop entry
(void) new PropertiesDialog( m_sDest.find( id )->data() );
m_sDest.remove( id );
}

View file

@ -206,12 +206,12 @@ KonqPopupMenu::KonqPopupMenu( QStringList urls,
{
KServiceTypeProfile::OfferList offers = KServiceTypeProfile::offers( mime->name() );
QValueList<KDELnkMimeType::Service> builtin;
QValueList<KDELnkMimeType::Service> user;
if ( mime->name() == "application/x-kdelnk" )
QValueList<KDEDesktopMimeType::Service> builtin;
QValueList<KDEDesktopMimeType::Service> user;
if ( mime->name() == "application/x-desktop" )
{
builtin = KDELnkMimeType::builtinServices( url );
user = KDELnkMimeType::userDefinedServices( url );
builtin = KDEDesktopMimeType::builtinServices( url );
user = KDEDesktopMimeType::userDefinedServices( url );
}
if ( !offers.isEmpty() || !user.isEmpty() || !builtin.isEmpty() )
@ -231,7 +231,7 @@ KonqPopupMenu::KonqPopupMenu( QStringList urls,
m_mapPopup[ id ] = it->service();
}
QValueList<KDELnkMimeType::Service>::Iterator it2 = user.begin();
QValueList<KDEDesktopMimeType::Service>::Iterator it2 = user.begin();
for( ; it2 != user.end(); ++it2 )
{
if ( !it2->m_strIcon.isEmpty() )
@ -370,14 +370,14 @@ void KonqPopupMenu::slotPopup( int id )
return;
}
// Is it a service specific to kdelnk files ?
QMap<int,KDELnkMimeType::Service>::Iterator it2 = m_mapPopup2.find( id );
// Is it a service specific to desktop entry files ?
QMap<int,KDEDesktopMimeType::Service>::Iterator it2 = m_mapPopup2.find( id );
if ( it2 == m_mapPopup2.end() )
return;
QStringList::Iterator it3 = m_lstPopupURLs.begin();
for( ; it3 != m_lstPopupURLs.end(); ++it3 )
KDELnkMimeType::executeService( *it3, it2.data() );
KDEDesktopMimeType::executeService( *it3, it2.data() );
return;
}

View file

@ -69,7 +69,7 @@ protected:
QStringList m_lstPopupURLs;
mode_t m_popupMode;
QMap<int,const KService *> m_mapPopup;
QMap<int,KDELnkMimeType::Service> m_mapPopup2;
QMap<int,KDEDesktopMimeType::Service> m_mapPopup2;
};
#endif

View file

@ -783,7 +783,7 @@ ExecPropsPage::ExecPropsPage( PropertiesDialog *_props ) : PropsPage( _props )
KConfig config( _props->kurl().path() );
config.setDollarExpansion( false );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
execStr = config.readEntry( "Exec" );
iconStr = config.readEntry( "Icon" );
swallowExecStr = config.readEntry( "SwallowExec" );
@ -851,7 +851,7 @@ bool ExecPropsPage::supports( const KURL& _kurl, mode_t _mode )
return false;
KConfig config( t );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString type = config.readEntry( "Type" );
if ( type.isNull() )
@ -943,7 +943,7 @@ void ExecPropsPage::applyChanges()
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
config.writeEntry( "Exec", execEdit->text() );
config.writeEntry( "Icon", iconBox->icon() );
config.writeEntry( "SwallowExec", swallowExecEdit->text() );
@ -1000,7 +1000,7 @@ URLPropsPage::URLPropsPage( PropertiesDialog *_props ) : PropsPage( _props )
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
URLStr = config.readEntry( "URL" );
iconStr = config.readEntry( "Icon" );
@ -1052,7 +1052,7 @@ bool URLPropsPage::supports( const KURL& _kurl, mode_t _mode )
return false;
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString URL = config.readEntry( "URL" );
if ( URL.isNull() )
@ -1075,7 +1075,7 @@ void URLPropsPage::applyChanges()
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
config.writeEntry( "URL", URLEdit->text() );
config.writeEntry( "Icon", iconBox->icon() );
config.writeEntry( "MiniIcon", iconBox->icon() );
@ -1118,7 +1118,7 @@ DirPropsPage::DirPropsPage( PropertiesDialog *_props ) : PropsPage( _props )
f.close();
KConfig config( tmp );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
wallStr = config.readEntry( "BgImage" );
iconStr = config.readEntry( "Icon" );
}
@ -1201,7 +1201,7 @@ void DirPropsPage::applyChanges()
f.close();
KConfig config( tmp );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
int i = wallBox->currentItem();
if ( i != -1 )
@ -1462,7 +1462,7 @@ ApplicationPropsPage::ApplicationPropsPage( PropertiesDialog *_props ) : PropsPa
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
commentStr = config.readEntry( "Comment" );
binaryPatternStr = config.readEntry( "BinaryPattern" );
extensionsStr = config.readEntry( "MimeType" );
@ -1471,6 +1471,8 @@ ApplicationPropsPage::ApplicationPropsPage( PropertiesDialog *_props ) : PropsPa
if ( nameStr.isEmpty() )
{
nameStr = _props->kurl().filename();
if ( nameStr.right(8) == ".desktop" )
nameStr.truncate( nameStr.length() - 8 );
if ( nameStr.right(7) == ".kdelnk" )
nameStr.truncate( nameStr.length() - 7 );
//KURL::decodeURL( nameStr );
@ -1545,7 +1547,7 @@ bool ApplicationPropsPage::supports( const KURL& _kurl, mode_t _mode )
return false;
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString type = config.readEntry( "Type" );
if ( type.isNull() )
@ -1705,7 +1707,7 @@ void ApplicationPropsPage::applyChanges()
f.close(); // kalle
KConfig config( path ); // kalle
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
config.writeEntry( "Comment", commentEdit->text(), true, false, true );
QString tmp = binaryPatternEdit->text();
@ -1838,7 +1840,7 @@ BindingPropsPage::BindingPropsPage( PropertiesDialog *_props ) : PropsPage( _pro
f.close();
KConfig config( _props->kurl().path() );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString patternStr = config.readEntry( "Patterns" );
QString appStr = config.readEntry( "DefaultApp" );
QString iconStr = config.readEntry( "Icon" );
@ -1911,7 +1913,7 @@ bool BindingPropsPage::supports( const KURL& _kurl, mode_t _mode )
return false;
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString type = config.readEntry( "Type" );
if ( type.isNull() )
@ -2065,7 +2067,7 @@ void BindingPropsPage::applyChanges()
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString tmp = patternEdit->text();
if ( tmp.length() > 1 )
@ -2164,7 +2166,7 @@ DevicePropsPage::DevicePropsPage( PropertiesDialog *_props ) : PropsPage( _props
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
deviceStr = config.readEntry( "Dev" );
mountPointStr = config.readEntry( "MountPoint" );
readonlyStr = config.readEntry( "ReadOnly" );
@ -2214,7 +2216,7 @@ bool DevicePropsPage::supports( const KURL& _kurl, mode_t _mode )
return false;
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
QString type = config.readEntry( "Type" );
if ( type.isNull() )
@ -2238,7 +2240,7 @@ void DevicePropsPage::applyChanges()
f.close();
KConfig config( path );
config.setGroup( "KDE Desktop Entry" );
config.setDesktopGroup();
config.writeEntry( "Dev", device->text() );
config.writeEntry( "MountPoint", mountpoint->text() );

View file

@ -267,7 +267,7 @@ protected:
/**
* Used to edit the files containing
* [KDE Desktop Entry]
* [Desktop Entry]
* Type=Application
*
* Such files are used to represent a program in kpanel and kfm.
@ -312,7 +312,7 @@ protected:
/**
* Used to edit the files containing
* [KDE Desktop Entry]
* [Desktop Entry]
* URL=....
*
* Such files are used to represent a program in kpanel and kfm.
@ -386,7 +386,7 @@ protected:
/**
* Used to edit the files containing
* [KDE Desktop Entry]
* [Desktop Entry]
* Type=Application
*
* Such files are used to represent a program in kpanel and kfm.
@ -431,7 +431,7 @@ protected:
/**
* Used to edit the files containing
* [KDE Desktop Entry]
* [Desktop Entry]
* Type=MimeType
*/
class BindingPropsPage : public PropsPage