summaryrefslogtreecommitdiff
path: root/library/applnk.cpp
authorsandman <sandman>2002-10-06 03:26:59 (UTC)
committer sandman <sandman>2002-10-06 03:26:59 (UTC)
commita1ebad08d462e682554d39a9beabce125a374452 (patch) (side-by-side diff)
tree254d7ddc5b257b278172af4952b2bec27b5df3b5 /library/applnk.cpp
parent2c16c8767fa5c16c0eeebc7008202a68a61a5308 (diff)
downloadopie-a1ebad08d462e682554d39a9beabce125a374452.zip
opie-a1ebad08d462e682554d39a9beabce125a374452.tar.gz
opie-a1ebad08d462e682554d39a9beabce125a374452.tar.bz2
- support "Rotation" setting in .desktop applnk file
- changed properties dialog to make Rotation editable - fixed a long-standing QPE bug: launcher expects AppLnk::file() to return QString::null for *all real* applnks (as opposed to doclnks) -- but AppLnk itself initializes this field to the name of the dir, where the applnk is stored. This is why qcop "QPE/System" "linkChanged(QString)" xyz.desktop cleared a whole launcher tab I hope I didn't break anything with this change ;)
Diffstat (limited to 'library/applnk.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp24
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 )
mMimeTypeIcons = config.readListEntry( "MimeTypeIcons", ';' );
mLinkFile = file;
mFile = config.readEntry("File", QString::null);
- if ( mFile[0] != '/' ) {
+ if ( !mExec. isEmpty ( )) {
+ mFile = QString::null;
+ }
+ else if ( mFile[0] != '/' ) {
int slash = file.findRev('/');
if ( slash >= 0 ) {
mFile = file.left(slash) + '/' + mFile;
@@ -520,7 +523,7 @@ QString AppLnk::type() const
*/
QString AppLnk::file() const
{
- if ( mFile.isNull() ) {
+ if ( mExec.isEmpty ( ) && mFile.isNull() ) {
AppLnk* that = (AppLnk*)this;
QString ext = MimeType(mType).extension();
if ( !ext.isEmpty() )
@@ -529,6 +532,7 @@ QString AppLnk::file() const
that->mFile =
mLinkFile.right(8)==".desktop" // 8 = strlen(".desktop")
? mLinkFile.left(mLinkFile.length()-8) : mLinkFile;
+ qDebug("mFile now == %s", mFile.latin1());
} else if ( mType.contains('/') ) {
that->mFile =
QString(getenv("HOME"))+"/Documents/"+mType+"/"+safeFileName(that->mName);
@@ -697,6 +701,18 @@ void AppLnk::setExec( const QString& exec )
mExec = exec;
}
+#if 0 // this was inlined for better BC
+/*!
+ Sets the Rotation property to \a rot.
+
+ \sa rotation()
+*/
+void AppLnk::setRotation ( const QString &rot )
+{
+ mRotation = rot;
+}
+#endif
+
/*!
Sets the Name property to \a docname.
@@ -835,6 +851,10 @@ void AppLnk::storeLink() const
config.writeEntry("Name",mName);
if ( !mIconFile.isNull() ) config.writeEntry("Icon",mIconFile);
config.writeEntry("Type",type());
+ if(!rotation().isEmpty())
+ config.writeEntry("Rotation",rotation());
+ else
+ config.removeEntry("Rotation");
if ( !mComment.isNull() ) config.writeEntry("Comment",mComment);
QString f = file();
int i = 0;