summaryrefslogtreecommitdiff
path: root/core/settings/launcher/menusettings.cpp
Side-by-side diff
Diffstat (limited to 'core/settings/launcher/menusettings.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/launcher/menusettings.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/settings/launcher/menusettings.cpp b/core/settings/launcher/menusettings.cpp
index 29ce841..d63b203 100644
--- a/core/settings/launcher/menusettings.cpp
+++ b/core/settings/launcher/menusettings.cpp
@@ -12,48 +12,49 @@ _;:, .> :=|. This file is free software; you can
.%`+i> _;_.
.i_,=:_. -<s. This file is distributed in the hope that
+ . -:. = it will be useful, but WITHOUT ANY WARRANTY;
: .. .:, . . . without even the implied warranty of
=_ + =;=|` MERCHANTABILITY or FITNESS FOR A
_.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.= = ; Public License for more details.
++= -. .` .:
: = ...= . :.=- You should have received a copy of the GNU
-. .:....=;==+<; General Public License along with this file;
-_. . . )=. = see the file COPYING. If not, write to the
-- :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "menusettings.h"
#include <qpe/config.h>
#include <qpe/qlibrary.h>
#include <qpe/qpeapplication.h>
#include <qpe/menuappletinterface.h>
#include <qpe/qcopenvelope_qws.h>
+#include <opie2/odebug.h>
#include <qdir.h>
#include <qlistview.h>
#include <qcheckbox.h>
#include <qheader.h>
#include <qlayout.h>
#include <qlabel.h>
#include <qwhatsthis.h>
#include <stdlib.h>
MenuSettings::MenuSettings ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
m_applets_changed = false;
QBoxLayout *lay = new QVBoxLayout ( this, 4, 4 );
QLabel *l = new QLabel ( tr( "Load applets in O-Menu:" ), this );
lay-> addWidget ( l );
m_list = new QListView ( this );
m_list-> addColumn ( "foobar" );
@@ -73,49 +74,51 @@ MenuSettings::MenuSettings ( QWidget *parent, const char *name )
connect ( m_list, SIGNAL( clicked(QListViewItem*)), this, SLOT( appletChanged()));
init ( );
}
void MenuSettings::init ( )
{
Config cfg ( "StartMenu" );
cfg. setGroup ( "Applets" );
QStringList exclude = cfg. readListEntry ( "ExcludeApplets", ',' );
QString path = QPEApplication::qpeDir ( ) + "plugins/applets";
#ifdef Q_OS_MACX
QStringList list = QDir ( path, "lib*.dylib" ). entryList ( );
#else
QStringList list = QDir ( path, "lib*.so" ). entryList ( );
#endif /* Q_OS_MACX */
for ( QStringList::Iterator it = list. begin ( ); it != list. end ( ); ++it ) {
QString name;
QPixmap icon;
MenuAppletInterface *iface = 0;
QLibrary *lib = new QLibrary ( path + "/" + *it );
- lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**) &iface );
+ QRESULT retVal = QS_OK;
+ if ((retVal = lib-> queryInterface ( IID_MenuApplet, (QUnknownInterface**)(&iface) )) != QS_OK )
+ owarn << "queryInterface failed with " << retVal << oendl;
if ( iface ) {
QString lang = getenv( "LANG" );
QTranslator *trans = new QTranslator ( qApp );
QString type = (*it). left ((*it). find ("."));
QString tfn = QPEApplication::qpeDir ( ) + "i18n/" + lang + "/" + type + ".qm";
if ( trans-> load ( tfn ))
qApp-> installTranslator ( trans );
else
delete trans;
name = iface-> name ( );
icon = iface-> icon ( ). pixmap ();
iface-> release ( );
lib-> unload ( );
QCheckListItem *item;
item = new QCheckListItem ( m_list, name, QCheckListItem::CheckBox );
if ( !icon. isNull ( ))
item-> setPixmap ( 0, icon );
item-> setOn ( exclude. find ( *it ) == exclude. end ( ));
m_applets [*it] = item;
} else {
delete lib;
}
}