mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: remove redudndant kdelnk checks
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
6459097c59
commit
d147517cd5
4 changed files with 4 additions and 15 deletions
|
@ -633,9 +633,6 @@ KService::Ptr KService::serviceByStorageId( const QString& _storageId )
|
|||
if (tmp.endsWith(QLatin1String(".desktop")))
|
||||
tmp.truncate(tmp.length()-8);
|
||||
|
||||
if (tmp.endsWith(QLatin1String(".kdelnk")))
|
||||
tmp.truncate(tmp.length()-7);
|
||||
|
||||
service = KService::serviceByDesktopName(tmp);
|
||||
|
||||
return service;
|
||||
|
|
|
@ -236,7 +236,6 @@ void KMimeTypeTest::testFindByPathUsingFileName_data()
|
|||
QTest::newRow("case-sensitive-only match") << "Core" << "application/octet-stream"; // #198477
|
||||
|
||||
QTest::newRow("desktop file") << "foo.desktop" << "application/x-desktop";
|
||||
QTest::newRow("old kdelnk file is x-desktop too") << "foo.kdelnk" << "application/x-desktop";
|
||||
QTest::newRow("double-extension file") << "foo.tar.bz2" << "application/x-bzip-compressed-tar";
|
||||
QTest::newRow("single-extension file") << "foo.bz2" << "application/x-bzip";
|
||||
QTest::newRow(".doc should assume msword") << "somefile.doc" << "application/msword"; // #204139
|
||||
|
|
|
@ -596,11 +596,8 @@ void KNewFileMenuPrivate::fillMenu()
|
|||
{
|
||||
KNewFileMenuSingleton::Entry& entry = *templ;
|
||||
if (entry.entryType != KNewFileMenuSingleton::Separator) {
|
||||
// There might be a .desktop for that one already, if it's a kdelnk
|
||||
// This assumes we read .desktop files before .kdelnk files ...
|
||||
|
||||
// In fact, we skip any second item that has the same text as another one.
|
||||
// Duplicates in a menu look bad in any case.
|
||||
// There might be a .desktop for that one already. In fact, we skip any second item
|
||||
// that has the same text as another one. Duplicates in a menu look bad in any case.
|
||||
|
||||
const bool bSkip = seenTexts.contains(entry.text);
|
||||
if (bSkip) {
|
||||
|
|
|
@ -140,11 +140,8 @@ static QString nameFromFileName(QString nameStr)
|
|||
{
|
||||
if ( nameStr.endsWith(QLatin1String(".desktop")) )
|
||||
nameStr.truncate( nameStr.length() - 8 );
|
||||
if ( nameStr.endsWith(QLatin1String(".kdelnk")) )
|
||||
nameStr.truncate( nameStr.length() - 7 );
|
||||
// Make it human-readable (%2F => '/', ...)
|
||||
nameStr = KIO::decodeFileName( nameStr );
|
||||
return nameStr;
|
||||
return KIO::decodeFileName( nameStr );
|
||||
}
|
||||
|
||||
mode_t KFilePermissionsPropsPlugin::fperm[3][4] = {
|
||||
|
@ -1282,8 +1279,7 @@ void KFilePropsPlugin::applyChanges()
|
|||
KUrl oldurl = properties->kurl();
|
||||
|
||||
QString newFileName = KIO::encodeFileName(n);
|
||||
if (d->bDesktopFile && !newFileName.endsWith(QLatin1String(".desktop")) &&
|
||||
!newFileName.endsWith(QLatin1String(".kdelnk")))
|
||||
if (d->bDesktopFile && !newFileName.endsWith(QLatin1String(".desktop")))
|
||||
newFileName += ".desktop";
|
||||
|
||||
// Tell properties. Warning, this changes the result of properties->kurl() !
|
||||
|
|
Loading…
Add table
Reference in a new issue