summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-01-31 17:29:47 (UTC)
committer harlekin <harlekin>2003-01-31 17:29:47 (UTC)
commit22e4e7263314b0ebcafedc2b1d67ecae69a5d10f (patch) (unidiff)
tree0538e1c7d4458348b2187d82e9fae73d780ca804
parent0d5ec3a2162111161fed2022851ebfbc4d6d0333 (diff)
downloadopie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.zip
opie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.tar.gz
opie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.tar.bz2
leaks less now, still one more leak to go
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/changelog5
-rw-r--r--core/pim/today/today.cpp7
2 files changed, 10 insertions, 2 deletions
diff --git a/core/pim/today/changelog b/core/pim/today/changelog
index ba3cdbc..ea618c8 100644
--- a/core/pim/today/changelog
+++ b/core/pim/today/changelog
@@ -1,48 +1,53 @@
10.6.1
2
3* datebook plugin now can now also show following days
4* fixed one mem leak
5
10.6 60.6
2 7
3* longer refresh intervals possible 8* longer refresh intervals possible
4* plugins can decide now if they want to take part in refresh cycles 9* plugins can decide now if they want to take part in refresh cycles
5 10
60.5.2 110.5.2
7 12
8* refresh settings 13* refresh settings
9* only launch datebook config when clicked on a date ( opie only ) 14* only launch datebook config when clicked on a date ( opie only )
10* less qcop trouble on sharps retail rom 15* less qcop trouble on sharps retail rom
11 16
120.5.1 170.5.1
13 18
14* icons scalable and clickable again 19* icons scalable and clickable again
15 20
160.5 210.5
17 22
18* now fully plugin based 23* now fully plugin based
19 24
200.3.4 250.3.4
21 26
22* "fill our business card now a clickable label" 27* "fill our business card now a clickable label"
23* Several bugfixes regarding todo section. 28* Several bugfixes regarding todo section.
24 29
250.3.3 300.3.3
26 31
27* Changed the logo so it better scales to bigger display and also 32* Changed the logo so it better scales to bigger display and also
28 made the "Today" string translatable. 33 made the "Today" string translatable.
29* some am/pm fixes 34* some am/pm fixes
30* clickable labels now in libopie 35* clickable labels now in libopie
31 36
320.3.2 370.3.2
33 38
34* Autostart is now more configurable. You can decide how long 39* Autostart is now more configurable. You can decide how long
35 the ipaq has to has been suspended, before autostart is triggered.(Opie 40 the ipaq has to has been suspended, before autostart is triggered.(Opie
36 only) 41 only)
37* am/pm time optinal (autodetect) 42* am/pm time optinal (autodetect)
38 43
390.3.1 440.3.1
40 45
41* fixed the wrong color of the buttons 46* fixed the wrong color of the buttons
42* better translation (thanks carsten and others) 47* better translation (thanks carsten and others)
43* fixes memory leaks 48* fixes memory leaks
44* bugfixes in calendar part, now location and note are working again. 49* bugfixes in calendar part, now location and note are working again.
45 50
460.3.0 510.3.0
47 52
48* today uses now tododb from libopie. So major changes in the todo part: 53* today uses now tododb from libopie. So major changes in the todo part:
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 76bd6de..91028c8 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -107,121 +107,124 @@ void Today::setOwnerField() {
107 Contact cont = Contact::readVCard( file )[0]; 107 Contact cont = Contact::readVCard( file )[0];
108 QString returnString = cont.fullName(); 108 QString returnString = cont.fullName();
109 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); 109 OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" );
110 } else { 110 } else {
111 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); 111 OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" );
112 } 112 }
113} 113}
114 114
115/** 115/**
116 * Set the owner field with a given QString, for example per qcop. 116 * Set the owner field with a given QString, for example per qcop.
117 */ 117 */
118void Today::setOwnerField( QString &message ) { 118void Today::setOwnerField( QString &message ) {
119 if ( !message.isEmpty() ) { 119 if ( !message.isEmpty() ) {
120 OwnerField->setText( "<b>" + message + "</b>" ); 120 OwnerField->setText( "<b>" + message + "</b>" );
121 } 121 }
122} 122}
123 123
124 124
125/** 125/**
126 * Init stuff needed for today. Reads the config file. 126 * Init stuff needed for today. Reads the config file.
127 */ 127 */
128void Today::init() { 128void Today::init() {
129 // read config 129 // read config
130 Config cfg( "today" ); 130 Config cfg( "today" );
131 131
132 cfg.setGroup( "Plugins" ); 132 cfg.setGroup( "Plugins" );
133 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); 133 m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' );
134 m_allApplets = cfg.readListEntry( "AllApplets", ',' ); 134 m_allApplets = cfg.readListEntry( "AllApplets", ',' );
135 135
136 cfg.setGroup( "General" ); 136 cfg.setGroup( "General" );
137 m_iconSize = cfg.readNumEntry( "IconSize", 18 ); 137 m_iconSize = cfg.readNumEntry( "IconSize", 18 );
138 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); 138 setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) );
139} 139}
140 140
141 141
142/** 142/**
143 * Load the plugins 143 * Load the plugins
144 */ 144 */
145void Today::loadPlugins() { 145void Today::loadPlugins() {
146 146
147 // extra list for plugins that exclude themself from periodic refresh 147 // extra list for plugins that exclude themself from periodic refresh
148 QMap<QString, TodayPlugin> pluginListRefreshExclude; 148 QMap<QString, TodayPlugin> pluginListRefreshExclude;
149 149
150 QValueList<TodayPlugin>::Iterator tit; 150 QValueList<TodayPlugin>::Iterator tit;
151 if ( !pluginList.isEmpty() ) { 151 if ( !pluginList.isEmpty() ) {
152 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { 152 for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) {
153 if ( (*tit).excludeRefresh ) { 153 if ( (*tit).excludeRefresh ) {
154 pluginListRefreshExclude.insert( (*tit).name , (*tit) ); 154 pluginListRefreshExclude.insert( (*tit).name , (*tit) );
155 qDebug( "Found an plugin that does not want refresh feature" ); 155 qDebug( "Found a plugin that does not want refresh feature" );
156 } else { 156 } else {
157 (*tit).guiBox->hide();
158 (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) );
157 (*tit).library->unload(); 159 (*tit).library->unload();
160 delete (*tit).guiBox;
158 delete (*tit).library; 161 delete (*tit).library;
159 } 162 }
160 } 163 }
161 pluginList.clear(); 164 pluginList.clear();
162 } 165 }
163 166
164 QString path = QPEApplication::qpeDir() + "/plugins/today"; 167 QString path = QPEApplication::qpeDir() + "/plugins/today";
165 QDir dir( path, "lib*.so" ); 168 QDir dir( path, "lib*.so" );
166 169
167 QStringList list = dir.entryList(); 170 QStringList list = dir.entryList();
168 QStringList::Iterator it; 171 QStringList::Iterator it;
169 172
170 QMap<QString, TodayPlugin> tempList; 173 QMap<QString, TodayPlugin> tempList;
171 174
172 for ( it = list.begin(); it != list.end(); ++it ) { 175 for ( it = list.begin(); it != list.end(); ++it ) {
173 //TodayPluginInterface *iface = 0; 176 //TodayPluginInterface *iface = 0;
174 QInterfacePtr<TodayPluginInterface> iface; 177 QInterfacePtr<TodayPluginInterface> iface;
175 QLibrary *lib = new QLibrary( path + "/" + *it ); 178 QLibrary *lib = new QLibrary( path + "/" + *it );
176 179
177 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); 180 qDebug( "querying: %s", QString( path + "/" + *it ).latin1() );
178 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { 181 if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) {
179 qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); 182 qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() );
180 qDebug( QString(*it) ); 183 qDebug( QString(*it) );
181 184
182 // If plugin is exludes from refresh, get it in the list again here. 185 // If plugin is exludes from refresh, get it in the list again here.
183 186
184 if ( pluginListRefreshExclude.contains( (*it) ) ) { 187 if ( pluginListRefreshExclude.contains( (*it) ) ) {
185 // if its not in allApplets list, add it to a layout 188 // if its not in allApplets list, add it to a layout
186 if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { 189 if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) {
187 layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); 190 layout->addWidget( pluginListRefreshExclude[(*it)].guiBox );
188 pluginList.append( pluginListRefreshExclude[(*it)] ); 191 pluginList.append( pluginListRefreshExclude[(*it)] );
189 } else { 192 } else {
190 tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); 193 tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] );
191 } 194 }
192 } else { 195 } else {
193 196
194 TodayPlugin plugin; 197 TodayPlugin plugin;
195 plugin.library = lib; 198 plugin.library = lib;
196 plugin.iface = iface; 199 plugin.iface = iface;
197 plugin.name = QString(*it); 200 plugin.name = QString(*it);
198 201
199 // find out if plugins should be shown 202 // find out if plugins should be shown
200 if ( m_excludeApplets.grep( *it ).isEmpty() ) { 203 if ( m_excludeApplets.grep( *it ).isEmpty() ) {
201 plugin.active = true; 204 plugin.active = true;
202 } else { 205 } else {
203 plugin.active = false; 206 plugin.active = false;
204 } 207 }
205 208
206 plugin.guiPart = plugin.iface->guiPart(); 209 plugin.guiPart = plugin.iface->guiPart();
207 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); 210 plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh();
208 211
209 // package the whole thing into a qwidget so it can be shown and hidden 212 // package the whole thing into a qwidget so it can be shown and hidden
210 plugin.guiBox = new QWidget( this ); 213 plugin.guiBox = new QWidget( this );
211 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); 214 QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox );
212 QPixmap plugPix; 215 QPixmap plugPix;
213 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); 216 plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 );
214 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); 217 OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox );
215 plugIcon->setPixmap( plugPix ); 218 plugIcon->setPixmap( plugPix );
216 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); 219 QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") );
217 plugIcon->setName( plugin.guiPart->appName() ); 220 plugIcon->setName( plugin.guiPart->appName() );
218 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); 221 connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) );
219 // a scrollview for each plugin 222 // a scrollview for each plugin
220 QScrollView* sv = new QScrollView( plugin.guiBox ); 223 QScrollView* sv = new QScrollView( plugin.guiBox );
221 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); 224 QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() );
222 // not sure if that is good .-) 225 // not sure if that is good .-)
223 sv->setMinimumHeight( 10 ); 226 sv->setMinimumHeight( 10 );
224 sv->setResizePolicy( QScrollView::AutoOneFit ); 227 sv->setResizePolicy( QScrollView::AutoOneFit );
225 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 228 sv->setHScrollBarMode( QScrollView::AlwaysOff );
226 sv->setFrameShape( QFrame::NoFrame ); 229 sv->setFrameShape( QFrame::NoFrame );
227 sv->addChild( plugWidget ); 230 sv->addChild( plugWidget );