-rw-r--r-- | library/applnk.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp index 44f3f58..a56da5d 100644 --- a/library/applnk.cpp +++ b/library/applnk.cpp | |||
@@ -372,7 +372,10 @@ AppLnk::AppLnk( const QString &file ) | |||
372 | mMimeTypeIcons = config.readListEntry( "MimeTypeIcons", ';' ); | 372 | mMimeTypeIcons = config.readListEntry( "MimeTypeIcons", ';' ); |
373 | mLinkFile = file; | 373 | mLinkFile = file; |
374 | mFile = config.readEntry("File", QString::null); | 374 | mFile = config.readEntry("File", QString::null); |
375 | if ( mFile[0] != '/' ) { | 375 | if ( !mExec. isEmpty ( )) { |
376 | mFile = QString::null; | ||
377 | } | ||
378 | else if ( mFile[0] != '/' ) { | ||
376 | int slash = file.findRev('/'); | 379 | int slash = file.findRev('/'); |
377 | if ( slash >= 0 ) { | 380 | if ( slash >= 0 ) { |
378 | mFile = file.left(slash) + '/' + mFile; | 381 | mFile = file.left(slash) + '/' + mFile; |
@@ -520,7 +523,7 @@ QString AppLnk::type() const | |||
520 | */ | 523 | */ |
521 | QString AppLnk::file() const | 524 | QString AppLnk::file() const |
522 | { | 525 | { |
523 | if ( mFile.isNull() ) { | 526 | if ( mExec.isEmpty ( ) && mFile.isNull() ) { |
524 | AppLnk* that = (AppLnk*)this; | 527 | AppLnk* that = (AppLnk*)this; |
525 | QString ext = MimeType(mType).extension(); | 528 | QString ext = MimeType(mType).extension(); |
526 | if ( !ext.isEmpty() ) | 529 | if ( !ext.isEmpty() ) |
@@ -529,6 +532,7 @@ QString AppLnk::file() const | |||
529 | that->mFile = | 532 | that->mFile = |
530 | mLinkFile.right(8)==".desktop" // 8 = strlen(".desktop") | 533 | mLinkFile.right(8)==".desktop" // 8 = strlen(".desktop") |
531 | ? mLinkFile.left(mLinkFile.length()-8) : mLinkFile; | 534 | ? mLinkFile.left(mLinkFile.length()-8) : mLinkFile; |
535 | qDebug("mFile now == %s", mFile.latin1()); | ||
532 | } else if ( mType.contains('/') ) { | 536 | } else if ( mType.contains('/') ) { |
533 | that->mFile = | 537 | that->mFile = |
534 | QString(getenv("HOME"))+"/Documents/"+mType+"/"+safeFileName(that->mName); | 538 | QString(getenv("HOME"))+"/Documents/"+mType+"/"+safeFileName(that->mName); |
@@ -697,6 +701,18 @@ void AppLnk::setExec( const QString& exec ) | |||
697 | mExec = exec; | 701 | mExec = exec; |
698 | } | 702 | } |
699 | 703 | ||
704 | #if 0 // this was inlined for better BC | ||
705 | /*! | ||
706 | Sets the Rotation property to \a rot. | ||
707 | |||
708 | \sa rotation() | ||
709 | */ | ||
710 | void AppLnk::setRotation ( const QString &rot ) | ||
711 | { | ||
712 | mRotation = rot; | ||
713 | } | ||
714 | #endif | ||
715 | |||
700 | /*! | 716 | /*! |
701 | Sets the Name property to \a docname. | 717 | Sets the Name property to \a docname. |
702 | 718 | ||
@@ -835,6 +851,10 @@ void AppLnk::storeLink() const | |||
835 | config.writeEntry("Name",mName); | 851 | config.writeEntry("Name",mName); |
836 | if ( !mIconFile.isNull() ) config.writeEntry("Icon",mIconFile); | 852 | if ( !mIconFile.isNull() ) config.writeEntry("Icon",mIconFile); |
837 | config.writeEntry("Type",type()); | 853 | config.writeEntry("Type",type()); |
854 | if(!rotation().isEmpty()) | ||
855 | config.writeEntry("Rotation",rotation()); | ||
856 | else | ||
857 | config.removeEntry("Rotation"); | ||
838 | if ( !mComment.isNull() ) config.writeEntry("Comment",mComment); | 858 | if ( !mComment.isNull() ) config.writeEntry("Comment",mComment); |
839 | QString f = file(); | 859 | QString f = file(); |
840 | int i = 0; | 860 | int i = 0; |