author | sandman <sandman> | 2002-10-02 22:06:33 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-02 22:06:33 (UTC) |
commit | b757807635fddb4824eabd87f72c96a0929c5cb1 (patch) (unidiff) | |
tree | 831e4870fe1562507540b386cbcbd1ea93ecb9a8 /core/launcher/systray.cpp | |
parent | 2682a282dc87074bdc61d241d5b2d76e8533982c (diff) | |
download | opie-b757807635fddb4824eabd87f72c96a0929c5cb1.zip opie-b757807635fddb4824eabd87f72c96a0929c5cb1.tar.gz opie-b757807635fddb4824eabd87f72c96a0929c5cb1.tar.bz2 |
- Qtopia 1.6 launcher merge (again - should be finished soon)
- Support for O-Menu applets (similiar to Taskbar applets)
-rw-r--r-- | core/launcher/systray.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index 697971d..406c662 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -81,49 +81,49 @@ void SysTray::addApplets() | |||
81 | Config cfg( "Taskbar" ); | 81 | Config cfg( "Taskbar" ); |
82 | cfg.setGroup( "Applets" ); | 82 | cfg.setGroup( "Applets" ); |
83 | 83 | ||
84 | // SafeMode causes too much problems, so we disable it for now -- | 84 | // SafeMode causes too much problems, so we disable it for now -- |
85 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 | 85 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 |
86 | 86 | ||
87 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); | 87 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); |
88 | if ( safe && !safety_tid ) | 88 | if ( safe && !safety_tid ) |
89 | return; | 89 | return; |
90 | cfg.writeEntry("SafeMode",TRUE); | 90 | cfg.writeEntry("SafeMode",TRUE); |
91 | cfg.write(); | 91 | cfg.write(); |
92 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 92 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
93 | 93 | ||
94 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 94 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
95 | QDir dir( path, "lib*.so" ); | 95 | QDir dir( path, "lib*.so" ); |
96 | QStringList list = dir.entryList(); | 96 | QStringList list = dir.entryList(); |
97 | QStringList::Iterator it; | 97 | QStringList::Iterator it; |
98 | int napplets=0; | 98 | int napplets=0; |
99 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | 99 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; |
100 | for ( it = list.begin(); it != list.end(); ++it ) { | 100 | for ( it = list.begin(); it != list.end(); ++it ) { |
101 | if ( exclude.find( *it ) != exclude.end() ) | 101 | if ( exclude.find( *it ) != exclude.end() ) |
102 | continue; | 102 | continue; |
103 | TaskbarAppletInterface *iface = 0; | 103 | TaskbarAppletInterface *iface = 0; |
104 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 104 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
105 | if ( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) { | 105 | if (( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) && iface ) { |
106 | TaskbarApplet *applet = new TaskbarApplet; | 106 | TaskbarApplet *applet = new TaskbarApplet; |
107 | applets[napplets++] = applet; | 107 | applets[napplets++] = applet; |
108 | applet->library = lib; | 108 | applet->library = lib; |
109 | applet->iface = iface; | 109 | applet->iface = iface; |
110 | } else { | 110 | } else { |
111 | exclude += *it; | 111 | exclude += *it; |
112 | delete lib; | 112 | delete lib; |
113 | } | 113 | } |
114 | } | 114 | } |
115 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | 115 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); |
116 | qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); | 116 | qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); |
117 | while (napplets--) { | 117 | while (napplets--) { |
118 | TaskbarApplet *applet = applets[napplets]; | 118 | TaskbarApplet *applet = applets[napplets]; |
119 | applet->applet = applet->iface->applet( this ); | 119 | applet->applet = applet->iface->applet( this ); |
120 | appletList.append(*applet); | 120 | appletList.append(*applet); |
121 | QString lang = getenv( "LANG" ); | 121 | QString lang = getenv( "LANG" ); |
122 | QTranslator * trans = new QTranslator(qApp); | 122 | QTranslator * trans = new QTranslator(qApp); |
123 | QString type = (*it).left( (*it).find(".") ); | 123 | QString type = (*it).left( (*it).find(".") ); |
124 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 124 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
125 | if ( trans->load( tfn )) | 125 | if ( trans->load( tfn )) |
126 | qApp->installTranslator( trans ); | 126 | qApp->installTranslator( trans ); |
127 | else | 127 | else |
128 | delete trans; | 128 | delete trans; |
129 | } | 129 | } |