author | harlekin <harlekin> | 2003-01-31 17:29:47 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-01-31 17:29:47 (UTC) |
commit | 22e4e7263314b0ebcafedc2b1d67ecae69a5d10f (patch) (side-by-side diff) | |
tree | 0538e1c7d4458348b2187d82e9fae73d780ca804 | |
parent | 0d5ec3a2162111161fed2022851ebfbc4d6d0333 (diff) | |
download | opie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.zip opie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.tar.gz opie-22e4e7263314b0ebcafedc2b1d67ecae69a5d10f.tar.bz2 |
leaks less now, still one more leak to go
-rw-r--r-- | core/pim/today/changelog | 5 | ||||
-rw-r--r-- | core/pim/today/today.cpp | 7 |
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,96 +1,101 @@ +0.6.1 + +* datebook plugin now can now also show following days +* fixed one mem leak + 0.6 * longer refresh intervals possible * plugins can decide now if they want to take part in refresh cycles 0.5.2 * refresh settings * only launch datebook config when clicked on a date ( opie only ) * less qcop trouble on sharps retail rom 0.5.1 * icons scalable and clickable again 0.5 * now fully plugin based 0.3.4 * "fill our business card now a clickable label" * Several bugfixes regarding todo section. 0.3.3 * Changed the logo so it better scales to bigger display and also made the "Today" string translatable. * some am/pm fixes * clickable labels now in libopie 0.3.2 * Autostart is now more configurable. You can decide how long the ipaq has to has been suspended, before autostart is triggered.(Opie only) * am/pm time optinal (autodetect) 0.3.1 * fixed the wrong color of the buttons * better translation (thanks carsten and others) * fixes memory leaks * bugfixes in calendar part, now location and note are working again. 0.3.0 * today uses now tododb from libopie. So major changes in the todo part: - overdue items on top - then sorted by date, then by priority * some cleanups * speed optimisations 0.2.9 * Many bugfixes. * Today now apparently sorts the dates _allways_ right, i would assume it to be a qt bug 0.2.8 * Appointments are now clickable (connection to datebook still missing) * autostart support (opie only) 0.2.7 * check if todolist.xml was changed before parsing it * check only every 30 sec for changes. * some visual stuff * as usual many little improvements .-) 0.2.6 * added scrollbars to dates and todo * all day detection * some smaller bugfixes 0.2.5 * some other minor fixes regarding autoupdate * fixed segfault with todolist > 7 entries * fixed the "ugly grey border around buttons" issue * fixed the "empty calendar field" "bug" * shown only later appointments as option 0.2.4 * added support for email * autoupdates after 1 min * QCopEnvelope instead of system() * starting to use qvbox in gui 0.2.3 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 @@ -59,217 +59,220 @@ Today::Today( QWidget* parent, const char* name, WFlags fl ) QObject::connect( (QObject*)OwnerField, SIGNAL( clicked() ), this, SLOT( editCard() ) ); #if defined(Q_WS_QWS) #if !defined(QT_NO_COP) QCopChannel *todayChannel = new QCopChannel( "QPE/Today" , this ); connect ( todayChannel, SIGNAL( received( const QCString &, const QByteArray &) ), this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); #endif #endif setOwnerField(); m_refreshTimer = new QTimer( this ); connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); m_refreshTimer->start( 15000 ); refresh(); showMaximized(); } /** * Qcop receive method. */ void Today::channelReceived( const QCString &msg, const QByteArray & data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "message(QString)" ) { QString message; stream >> message; setOwnerField( message ); } } void Today::setRefreshTimer( int interval ) { disconnect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); // 0 is "never" case if ( !interval == 0 ) { connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); m_refreshTimer->changeInterval( interval ); } } /** * Initialises the owner field with the default value, the username */ void Today::setOwnerField() { QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); if ( QFile::exists( file ) ) { Contact cont = Contact::readVCard( file )[0]; QString returnString = cont.fullName(); OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); } else { OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); } } /** * Set the owner field with a given QString, for example per qcop. */ void Today::setOwnerField( QString &message ) { if ( !message.isEmpty() ) { OwnerField->setText( "<b>" + message + "</b>" ); } } /** * Init stuff needed for today. Reads the config file. */ void Today::init() { // read config Config cfg( "today" ); cfg.setGroup( "Plugins" ); m_excludeApplets = cfg.readListEntry( "ExcludeApplets", ',' ); m_allApplets = cfg.readListEntry( "AllApplets", ',' ); cfg.setGroup( "General" ); m_iconSize = cfg.readNumEntry( "IconSize", 18 ); setRefreshTimer( cfg.readNumEntry( "checkinterval", 15000 ) ); } /** * Load the plugins */ void Today::loadPlugins() { // extra list for plugins that exclude themself from periodic refresh QMap<QString, TodayPlugin> pluginListRefreshExclude; QValueList<TodayPlugin>::Iterator tit; if ( !pluginList.isEmpty() ) { for ( tit = pluginList.begin(); tit != pluginList.end(); ++tit ) { if ( (*tit).excludeRefresh ) { pluginListRefreshExclude.insert( (*tit).name , (*tit) ); - qDebug( "Found an plugin that does not want refresh feature" ); + qDebug( "Found a plugin that does not want refresh feature" ); } else { + (*tit).guiBox->hide(); + (*tit).guiBox->reparent( 0, QPoint( 0, 0 ) ); (*tit).library->unload(); + delete (*tit).guiBox; delete (*tit).library; } } pluginList.clear(); } QString path = QPEApplication::qpeDir() + "/plugins/today"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); QStringList::Iterator it; QMap<QString, TodayPlugin> tempList; for ( it = list.begin(); it != list.end(); ++it ) { // TodayPluginInterface *iface = 0; QInterfacePtr<TodayPluginInterface> iface; QLibrary *lib = new QLibrary( path + "/" + *it ); qDebug( "querying: %s", QString( path + "/" + *it ).latin1() ); if ( lib->queryInterface( IID_TodayPluginInterface, (QUnknownInterface**)&iface ) == QS_OK ) { - qDebug( "loading: %s", QString( path + "/" + *it ).latin1() ); + qDebug( "accepted: %s", QString( path + "/" + *it ).latin1() ); qDebug( QString(*it) ); // If plugin is exludes from refresh, get it in the list again here. if ( pluginListRefreshExclude.contains( (*it) ) ) { // if its not in allApplets list, add it to a layout if ( !m_allApplets.contains( pluginListRefreshExclude[(*it)].name ) ) { layout->addWidget( pluginListRefreshExclude[(*it)].guiBox ); pluginList.append( pluginListRefreshExclude[(*it)] ); } else { tempList.insert( pluginListRefreshExclude[(*it)].name, pluginListRefreshExclude[(*it)] ); } } else { TodayPlugin plugin; plugin.library = lib; plugin.iface = iface; plugin.name = QString(*it); // find out if plugins should be shown if ( m_excludeApplets.grep( *it ).isEmpty() ) { plugin.active = true; } else { plugin.active = false; } plugin.guiPart = plugin.iface->guiPart(); plugin.excludeRefresh = plugin.guiPart->excludeFromRefresh(); // package the whole thing into a qwidget so it can be shown and hidden plugin.guiBox = new QWidget( this ); QHBoxLayout *boxLayout = new QHBoxLayout( plugin.guiBox ); QPixmap plugPix; plugPix.convertFromImage( Resource::loadImage( plugin.guiPart->pixmapNameWidget() ).smoothScale( m_iconSize, m_iconSize ), 0 ); OClickableLabel* plugIcon = new OClickableLabel( plugin.guiBox ); plugIcon->setPixmap( plugPix ); QWhatsThis::add( plugIcon, tr("Click here to launch the associated app") ); plugIcon->setName( plugin.guiPart->appName() ); connect( plugIcon, SIGNAL( clicked() ), this, SLOT( startApplication() ) ); // a scrollview for each plugin QScrollView* sv = new QScrollView( plugin.guiBox ); QWidget *plugWidget = plugin.guiPart->widget( sv->viewport() ); // not sure if that is good .-) sv->setMinimumHeight( 10 ); sv->setResizePolicy( QScrollView::AutoOneFit ); sv->setHScrollBarMode( QScrollView::AlwaysOff ); sv->setFrameShape( QFrame::NoFrame ); sv->addChild( plugWidget ); // make sure the icon is on the top alligned boxLayout->addWidget( plugIcon, 0, AlignTop ); boxLayout->addWidget( sv, 0, AlignTop ); boxLayout->setStretchFactor( plugIcon, 1 ); boxLayout->setStretchFactor( sv, 9 ); // "prebuffer" it in one more list, to get the sorting done tempList.insert( plugin.name, plugin ); // on first start the list is off course empty if ( m_allApplets.isEmpty() ) { layout->addWidget( plugin.guiBox ); pluginList.append( plugin ); } // if plugin is not yet in the list, add it to the layout too else if ( !m_allApplets.contains( plugin.name ) ) { layout->addWidget( plugin.guiBox ); pluginList.append( plugin ); } } } else { qDebug( "could not recognize %s", QString( path + "/" + *it ).latin1() ); delete lib; } } if ( !m_allApplets.isEmpty() ) { TodayPlugin tempPlugin; QStringList::Iterator stringit; for( stringit = m_allApplets.begin(); stringit != m_allApplets.end(); ++stringit ) { tempPlugin = ( tempList.find( *stringit ) ).data(); if ( !( (tempPlugin.name).isEmpty() ) ) { layout->addWidget( tempPlugin.guiBox ); pluginList.append( tempPlugin ); } } } } /** * Repaint method. Reread all fields. */ void Today::draw() { if ( pluginList.count() == 0 ) { QLabel *noPlugins = new QLabel( this ); |