From 44d69b04b5257592639d2a494c448202c86978c2 Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 20 Jun 2004 19:03:56 +0000 Subject: Use A higher prime number in AppLnk Somehow the Launcher triggers issues with libqpe and MimeType. Due the mix of calling MimeType::clear, MimeType type(doclnk.linkFile()), MimeType::clear the registration of Application was cleared and not reentered due the inner static variable in MimeType::init which was set. Now make sure that if we clear that we will reenter the Application in all cases! --- (limited to 'library/mimetype.cpp') diff --git a/library/mimetype.cpp b/library/mimetype.cpp index 23de70b..ec45794 100644 --- a/library/mimetype.cpp +++ b/library/mimetype.cpp @@ -111,6 +111,7 @@ public: MimeType::Private* MimeType::d=0; static QMap *typeFor = 0; static QMap *extFor = 0; +static bool appsUpdated = FALSE; MimeType::Private& MimeType::data() { @@ -271,6 +272,9 @@ void MimeType::clear() { delete d; d = 0; + delete typeFor; typeFor = 0; + delete extFor ; extFor = 0; + appsUpdated = FALSE; } void MimeType::loadExtensions() @@ -322,9 +326,8 @@ void MimeType::init( const QString& ext_or_id ) if ( i.isNull() ) i = "application/octet-stream"; } - static bool appsUpdated = FALSE; + if ( !appsUpdated ) { - appsUpdated = TRUE; updateApplications(); } } @@ -353,7 +356,8 @@ QString MimeType::appsFolderName() */ void MimeType::updateApplications() { - clear(); +// clear(); + appsUpdated = true; AppLnkSet apps( appsFolderName() ); updateApplications(&apps); } -- cgit v0.9.0.2