summaryrefslogtreecommitdiff
authorzecke <zecke>2003-02-11 17:26:51 (UTC)
committer zecke <zecke>2003-02-11 17:26:51 (UTC)
commit99ccdda218112cfb0f7371fa05d7a696b8da1c40 (patch) (side-by-side diff)
tree64d46b22de7acbccbc2ee73c406be7645ff693c3
parentdf37010a49dfa9624c9600e4ed838ec7aade1b31 (diff)
downloadopie-99ccdda218112cfb0f7371fa05d7a696b8da1c40.zip
opie-99ccdda218112cfb0f7371fa05d7a696b8da1c40.tar.gz
opie-99ccdda218112cfb0f7371fa05d7a696b8da1c40.tar.bz2
fix bug 0000591
AppLnk does not need to reload all labels but it needs to reload the names for the ids in mCat
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/applnk.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/applnk.cpp b/library/applnk.cpp
index 5763c62..35822dd 100644
--- a/library/applnk.cpp
+++ b/library/applnk.cpp
@@ -80,25 +80,29 @@ public:
mPixmaps.insert(0, pix );
mPixmaps.insert(1, pix);
}
QStringList mCatList; // always correct
QArray<int> mCat; // cached value; correct if not empty
QMap<int, QPixmap> mPixmaps;
void updateCatListFromArray()
{
Categories cat( 0 );
cat.load( categoryFileName() );
- mCatList = cat.labels("Document View",mCat);
+ // we need to update the names for the mCat... to mCatList
+ mCatList.clear();
+ for (uint i = 0; i < mCat.count(); i++ )
+ mCatList << cat.label("Document View", mCat[i] );
+
}
void setCatArrayDirty()
{
mCat.resize(0);
}
void ensureCatArray()
{
if ( mCat.count() > 0 || mCatList.count()==0 )
return;
@@ -397,24 +401,25 @@ AppLnk::AppLnk( const QString &file )
}
d->mCat[i] = id;
}
d->updateCatListFromArray();
}
}
}
mId = 0;
}
AppLnk& AppLnk::operator=(const AppLnk &copy)
{
+ if ( this == &copy ) return *this;
if ( mId )
qWarning("Deleting AppLnk that is in an AppLnkSet");
if ( d )
delete d;
mName = copy.mName;
/* remove for Qtopia 3.0 -zecke */
mPixmap = copy.mPixmap;
mBigPixmap = copy.mBigPixmap;
@@ -841,25 +846,25 @@ bool AppLnk::writeLink() const
\internal
*/
void AppLnk::storeLink() const
{
Config config( mLinkFile, Config::File );
config.setGroup("Desktop Entry");
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");
+ config.removeEntry("Rotation");
if ( !mComment.isNull() ) config.writeEntry("Comment",mComment);
QString f = file();
int i = 0;
while ( i < (int)f.length() && i < (int)mLinkFile.length() && f[i] == mLinkFile[i] )
i++;
while ( i && f[i] != '/' )
i--;
// simple case where in the same directory
if ( mLinkFile.find( '/', i + 1 ) < 0 )
f = f.mid(i+1);
// ### could do relative ie ../../otherDocs/file.doc
config.writeEntry("File",f);