summaryrefslogtreecommitdiff
authorzecke <zecke>2004-09-12 20:28:36 (UTC)
committer zecke <zecke>2004-09-12 20:28:36 (UTC)
commit90aaa298cc69522e88e1f81ade7d5259131b1544 (patch) (side-by-side diff)
tree86bdb0a2bb94938754ba94f2ded9dc6ec5fb5207
parent00952f16786dcd069820e45df83a00b6c477893b (diff)
downloadopie-90aaa298cc69522e88e1f81ade7d5259131b1544.zip
opie-90aaa298cc69522e88e1f81ade7d5259131b1544.tar.gz
opie-90aaa298cc69522e88e1f81ade7d5259131b1544.tar.bz2
Follow the defined Ownership and have a maybe not needed
sanity check
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/plugins/addressbook/addressplugin.cpp6
-rw-r--r--core/pim/today/plugins/addressbook/addresspluginwidget.h2
-rw-r--r--core/pim/today/plugins/datebook/datebookevent.h1
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.cpp7
-rw-r--r--core/pim/today/plugins/datebook/datebookplugin.h4
-rw-r--r--core/pim/today/plugins/mail/mailplugin.cpp5
-rw-r--r--core/pim/today/plugins/mail/mailplugin.h7
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.cpp9
-rw-r--r--core/pim/today/plugins/todolist/todoplugin.h2
-rw-r--r--examples/todayplugin/exampleplugin.cpp10
-rw-r--r--examples/todayplugin/exampleplugin.h8
-rw-r--r--noncore/todayplugins/fortune/fortuneplugin.cpp2
-rw-r--r--noncore/todayplugins/fortune/fortuneplugin.h3
13 files changed, 22 insertions, 44 deletions
diff --git a/core/pim/today/plugins/addressbook/addressplugin.cpp b/core/pim/today/plugins/addressbook/addressplugin.cpp
index 5d5d34c..263a0c5 100644
--- a/core/pim/today/plugins/addressbook/addressplugin.cpp
+++ b/core/pim/today/plugins/addressbook/addressplugin.cpp
@@ -1,74 +1,76 @@
/*
* addressplugin.cpp
*
* copyright : (c) 2003 by Stefan Eilers
* email : eilers.stefan@epost.de
*
* This implementation was derived from the todolist plugin implementation
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "addressplugin.h"
#include "addresspluginconfig.h"
AddressBookPlugin::AddressBookPlugin():
m_abWidget( 0l )
{
}
AddressBookPlugin::~AddressBookPlugin() {
}
QString AddressBookPlugin::pluginName() const {
return QObject::tr( "AddressBook plugin" );
}
double AddressBookPlugin::versionNumber() const {
return 0.3;
}
QString AddressBookPlugin::pixmapNameWidget() const {
return "addressbook/AddressBook";
}
QWidget* AddressBookPlugin::widget( QWidget *wid ) {
m_abWidget = new AddressBookPluginWidget( wid, "AddressBook" );
return m_abWidget;
}
QString AddressBookPlugin::pixmapNameConfig() const {
return "addressbook/AddressBook";
}
TodayConfigWidget* AddressBookPlugin::configWidget( QWidget* wid ) {
return new AddressBookPluginConfig( wid , "AddressBook" );
}
QString AddressBookPlugin::appName() const {
return "addressbook";
}
bool AddressBookPlugin::excludeFromRefresh() const {
return false;
}
void AddressBookPlugin::refresh()
{
- m_abWidget->refresh( NULL );
+ if(m_abWidget)
+ m_abWidget->refresh( 0l );
}
void AddressBookPlugin::reinitialize()
{
- m_abWidget->reinitialize();
+ if(m_abWidget)
+ m_abWidget->reinitialize();
}
diff --git a/core/pim/today/plugins/addressbook/addresspluginwidget.h b/core/pim/today/plugins/addressbook/addresspluginwidget.h
index 25b3098..b42f252 100644
--- a/core/pim/today/plugins/addressbook/addresspluginwidget.h
+++ b/core/pim/today/plugins/addressbook/addresspluginwidget.h
@@ -1,65 +1,65 @@
/*
* addresspluginwidget.h
*
* copyright : (c) 2003 by Stefan Eilers
* email : eilers.stefan@epost.de
*
* This implementation was derived from the todolist plugin implementation
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef ADDRESSBOOK_PLUGIN_WIDGET_H
#define ADDRESSBOOK_PLUGIN_WIDGET_H
#include <opie2/ocontactaccess.h>
#include <opie2/oclickablelabel.h>
#include <qstring.h>
#include <qwidget.h>
#include <qlayout.h>
class AddressBookPluginWidget : public QWidget {
Q_OBJECT
public:
AddressBookPluginWidget( QWidget *parent, const char *name );
~AddressBookPluginWidget();
- void reinitialize();
public slots:
+ void reinitialize();
void refresh( const Opie::OPimContactAccess* db );
protected slots:
void startAddressBook();
private:
Opie::Ui::OClickableLabel* addressLabel;
QVBoxLayout* layoutTodo;
Opie::OPimContactAccess * m_contactdb;
Opie::OPimContactAccess::List m_list;
Opie::OPimContactAccess::List::Iterator m_it;
void readConfig();
void getAddress();
int m_maxLinesTask;
int m_maxCharClip;
int m_daysLookAhead;
int m_urgentDays;
QString m_entryColor;
QString m_headlineColor;
QString m_urgentColor;
bool m_showBirthdays;
bool m_showAnniversaries;
};
#endif
diff --git a/core/pim/today/plugins/datebook/datebookevent.h b/core/pim/today/plugins/datebook/datebookevent.h
index 973efe4..7a5843f 100644
--- a/core/pim/today/plugins/datebook/datebookevent.h
+++ b/core/pim/today/plugins/datebook/datebookevent.h
@@ -1,55 +1,54 @@
/*
* datebookplugin.h
*
* copyright : (c) 2002, 2003, 2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DATEBOOKEVENT_PLUGIN_H
#define DATEBOOKEVENT_PLUGIN_H
#include <opie2/oclickablelabel.h>
#include <qpe/datebookdb.h>
class DateBookEvent: public Opie::Ui::OClickableLabel {
-
Q_OBJECT
public:
DateBookEvent( const EffectiveEvent &ev,
QWidget* parent = 0,
bool show_location = 0,
bool show_notes = 0,
bool timeExtraLine = 0,
int maxCharClip = 0,
const char* name = 0,
WFlags fl = 0 );
~DateBookEvent();
signals:
void editEvent( const Event &e );
private slots:
void editEventSlot( const Event &e );
void editMe();
private:
QString ampmTime( QTime );
QString differDate( QDate date );
const EffectiveEvent event;
bool ampm;
};
#endif
diff --git a/core/pim/today/plugins/datebook/datebookplugin.cpp b/core/pim/today/plugins/datebook/datebookplugin.cpp
index f46806f..892a0ad 100644
--- a/core/pim/today/plugins/datebook/datebookplugin.cpp
+++ b/core/pim/today/plugins/datebook/datebookplugin.cpp
@@ -1,74 +1,71 @@
/*
* datebookplugin.cpp
*
* copyright : (c) 2002,2003, 2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "datebookplugin.h"
#include "datebookpluginconfig.h"
-DatebookPlugin::DatebookPlugin() {
+DatebookPlugin::DatebookPlugin() {
}
DatebookPlugin::~DatebookPlugin() {
- delete (DatebookPluginWidget*)m_widget;
}
QString DatebookPlugin::pluginName() const {
return QObject::tr( "Datebook plugin");
}
double DatebookPlugin::versionNumber() const {
return 1.0;
}
QString DatebookPlugin::pixmapNameWidget() const {
return "datebook/DateBook";
}
QWidget* DatebookPlugin::widget( QWidget* wid ) {
- if(!m_widget) {
- m_widget = new DatebookPluginWidget( wid, "Datebook" );
- }
+ m_widget = new DatebookPluginWidget( wid, "Datebook" );
return m_widget;
}
QString DatebookPlugin::pixmapNameConfig() const {
return "datebook/DateBook";
}
TodayConfigWidget* DatebookPlugin::configWidget( QWidget* wid ) {
return new DatebookPluginConfig( wid , "Datebook" );
}
QString DatebookPlugin::appName() const {
return "datebook";
}
bool DatebookPlugin::excludeFromRefresh() const {
return false;
}
void DatebookPlugin::refresh() {
if ( m_widget ) {
m_widget->refresh();
}
}
void DatebookPlugin::reinitialize() {
if ( m_widget ) {
m_widget->reinitialize();
}
}
diff --git a/core/pim/today/plugins/datebook/datebookplugin.h b/core/pim/today/plugins/datebook/datebookplugin.h
index 631d6a3..990c413 100644
--- a/core/pim/today/plugins/datebook/datebookplugin.h
+++ b/core/pim/today/plugins/datebook/datebookplugin.h
@@ -1,49 +1,47 @@
/*
* datebookplugin.h
*
* copyright : (c) 2002,2003 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DATEBOOK_PLUGIN_H
#define DATEBOOK_PLUGIN_H
#include "datebookpluginwidget.h"
#include <opie2/oclickablelabel.h>
#include <opie2/todayplugininterface.h>
-#include <qguardedptr.h>
-
class DatebookPlugin : public TodayPluginObject {
public:
DatebookPlugin();
~DatebookPlugin();
QString pluginName() const;
double versionNumber() const;
QString pixmapNameWidget() const;
QWidget* widget( QWidget *);
QString pixmapNameConfig() const;
TodayConfigWidget* configWidget( QWidget *);
QString appName() const;
bool excludeFromRefresh() const;
void refresh();
void reinitialize();
private:
- QGuardedPtr<DatebookPluginWidget> m_widget;
+ DatebookPluginWidget *m_widget;
};
#endif
diff --git a/core/pim/today/plugins/mail/mailplugin.cpp b/core/pim/today/plugins/mail/mailplugin.cpp
index b30d2a2..f590ebb 100644
--- a/core/pim/today/plugins/mail/mailplugin.cpp
+++ b/core/pim/today/plugins/mail/mailplugin.cpp
@@ -1,72 +1,69 @@
/*
* mailplugin.cpp
*
* copyright : (c) 2002,2003,2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "mailplugin.h"
MailPlugin::MailPlugin() {
m_widget = 0l;
}
MailPlugin::~MailPlugin() {
- delete (MailPluginWidget*)m_widget;
}
QString MailPlugin::pluginName() const {
return QObject::tr( "Mail plugin" );
}
double MailPlugin::versionNumber() const {
return 0.6;
}
QString MailPlugin::pixmapNameWidget() const {
return "opiemail/desktopicon";
}
QWidget* MailPlugin::widget( QWidget * wid ) {
- if(!m_widget) {
- m_widget = new MailPluginWidget( wid, "Datebook" );
- }
+ m_widget = new MailPluginWidget( wid, "Datebook" );
return m_widget;
}
QString MailPlugin::pixmapNameConfig() const {
return 0l;
}
TodayConfigWidget* MailPlugin::configWidget( QWidget* ) {
return 0l;
}
QString MailPlugin::appName() const {
return "opiemail";
}
bool MailPlugin::excludeFromRefresh() const {
return false;
}
void MailPlugin::refresh() {
if ( m_widget ) {
m_widget->refresh();
}
}
void MailPlugin::reinitialize() {
}
diff --git a/core/pim/today/plugins/mail/mailplugin.h b/core/pim/today/plugins/mail/mailplugin.h
index 1edffef..1e694bc 100644
--- a/core/pim/today/plugins/mail/mailplugin.h
+++ b/core/pim/today/plugins/mail/mailplugin.h
@@ -1,53 +1,48 @@
/*
* mailplugin.h
*
* copyright : (c) 2002,2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef MAIL_PLUGIN_H
#define MAIL_PLUGIN_H
#include "mailpluginwidget.h"
#include <opie2/todayplugininterface.h>
#include <opie2/todayconfigwidget.h>
-#include <qwidget.h>
-#include <qguardedptr.h>
-
-
-
class MailPlugin : public TodayPluginObject {
public:
MailPlugin();
~MailPlugin();
QString pluginName() const;
double versionNumber() const;
QString pixmapNameWidget() const;
QWidget* widget(QWidget *);
QString pixmapNameConfig() const;
TodayConfigWidget* configWidget(QWidget *);
QString appName() const;
bool excludeFromRefresh() const;
void refresh();
void reinitialize();
private:
- QGuardedPtr<MailPluginWidget> m_widget;
+ MailPluginWidget* m_widget;
};
#endif
diff --git a/core/pim/today/plugins/todolist/todoplugin.cpp b/core/pim/today/plugins/todolist/todoplugin.cpp
index 5783814..6cfcbe0 100644
--- a/core/pim/today/plugins/todolist/todoplugin.cpp
+++ b/core/pim/today/plugins/todolist/todoplugin.cpp
@@ -1,73 +1,72 @@
/*
* todoplugin.cpp
*
* copyright : (c) 2002,2003, 2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "todoplugin.h"
#include "todopluginconfig.h"
-TodolistPlugin::TodolistPlugin() {
+TodolistPlugin::TodolistPlugin()
+ : m_widget(0l)
+{
}
TodolistPlugin::~TodolistPlugin() {
- delete (TodolistPluginWidget*)m_widget;
}
QString TodolistPlugin::pluginName() const {
return QObject::tr( "Todolist plugin" );
}
double TodolistPlugin::versionNumber() const {
return 0.9;
}
QString TodolistPlugin::pixmapNameWidget() const {
return "todo/TodoList";
}
QWidget* TodolistPlugin::widget( QWidget *wid ) {
- if(!m_widget) {
- m_widget = new TodolistPluginWidget( wid, "Todolist" );
- }
+ m_widget = new TodolistPluginWidget( wid, "Todolist" );
return m_widget;
}
QString TodolistPlugin::pixmapNameConfig() const {
return "todo/TodoList";
}
TodayConfigWidget* TodolistPlugin::configWidget( QWidget* wid ) {
return new TodolistPluginConfig( wid , "Todolist" );
}
QString TodolistPlugin::appName() const {
return "todolist";
}
bool TodolistPlugin::excludeFromRefresh() const {
return false;
}
void TodolistPlugin::refresh() {
if ( m_widget ) {
m_widget->refresh();
}
}
void TodolistPlugin::reinitialize() {
if ( m_widget ) {
m_widget->reinitialize();
}
}
diff --git a/core/pim/today/plugins/todolist/todoplugin.h b/core/pim/today/plugins/todolist/todoplugin.h
index 976dbf7..6add53e 100644
--- a/core/pim/today/plugins/todolist/todoplugin.h
+++ b/core/pim/today/plugins/todolist/todoplugin.h
@@ -1,52 +1,52 @@
/*
* todoplugin.h
*
* copyright : (c) 2002,2003, 2004 by Maximilian Reiß
* email : harlekin@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef TODOLIST_PLUGIN_H
#define TODOLIST_PLUGIN_H
#include "todopluginwidget.h"
#include <opie2/oclickablelabel.h>
#include <opie2/todayplugininterface.h>
#include <qstring.h>
#include <qguardedptr.h>
#include <qwidget.h>
class TodolistPlugin : public TodayPluginObject {
public:
TodolistPlugin();
~TodolistPlugin();
QString pluginName() const;
double versionNumber() const;
QString pixmapNameWidget() const;
QWidget* widget(QWidget *);
QString pixmapNameConfig() const;
TodayConfigWidget* configWidget(QWidget *);
QString appName() const;
bool excludeFromRefresh() const;
void refresh();
void reinitialize();
private:
- QGuardedPtr<TodolistPluginWidget> m_widget;
+ TodolistPluginWidget* m_widget;
};
#endif
diff --git a/examples/todayplugin/exampleplugin.cpp b/examples/todayplugin/exampleplugin.cpp
index 94a5836..41bbfe2 100644
--- a/examples/todayplugin/exampleplugin.cpp
+++ b/examples/todayplugin/exampleplugin.cpp
@@ -1,65 +1,63 @@
/*
* exampleplugin.cpp
*
* email : harlekin@handhelds.org
*
*/
#include "exampleplugin.h"
-ExamplePlugin::ExamplePlugin() {
- m_widget = 0l;
+ExamplePlugin::ExamplePlugin()
+ : m_widget(0l)
+{
}
ExamplePlugin::~ExamplePlugin() {
- delete (ExamplePluginWidget*)m_widget;
}
QString ExamplePlugin::pluginName() const {
return QObject::tr( "Example plugin" );
}
double ExamplePlugin::versionNumber() const {
return 0.1;
}
// this sets the image that will be shown on the left side of the plugin
QString ExamplePlugin::pixmapNameWidget() const {
return QString::fromLatin1("Tux");
}
QWidget* ExamplePlugin::widget( QWidget * wid ) {
- if(!m_widget) {
- m_widget = new ExamplePluginWidget( wid, "Example" );
- }
+ m_widget = new ExamplePluginWidget( wid, "Example" );
return m_widget;
}
// that would be the icon of the config widget in todays config view
QString ExamplePlugin::pixmapNameConfig() const {
return 0l;
}
// No config widget yet, look at the datebook plugin for an example of that
TodayConfigWidget* ExamplePlugin::configWidget( QWidget* /*parent*/ ) {
return 0l;
}
// add the binary name of the app to launch here
QString ExamplePlugin::appName() const {
return QString::null;
}
// if the plugin should be excluded form the refresh cycles that can be set in the today app
bool ExamplePlugin::excludeFromRefresh() const {
return false;
}
void ExamplePlugin::refresh() {
if ( m_widget ) {
m_widget->refresh();
}
}
void ExamplePlugin::reinitialize() {
}
diff --git a/examples/todayplugin/exampleplugin.h b/examples/todayplugin/exampleplugin.h
index 94f5b37..90d3485 100644
--- a/examples/todayplugin/exampleplugin.h
+++ b/examples/todayplugin/exampleplugin.h
@@ -1,42 +1,38 @@
/*
* exampleplugin.h
*
* email : harlekin@handhelds.org
*
*/
#ifndef EXAMPLE_PLUGIN_H
#define EXAMPLE_PLUGIN_H
-#include <qwidget.h>
-#include <qguardedptr.h>
-
#include <opie2/todayplugininterface.h>
#include <opie2/todayconfigwidget.h>
#include "examplepluginwidget.h"
// implementation of the today plugin interface
class ExamplePlugin : public TodayPluginObject {
public:
ExamplePlugin();
~ExamplePlugin();
QString pluginName() const;
double versionNumber() const;
QString pixmapNameWidget() const;
QWidget* widget(QWidget *);
QString pixmapNameConfig() const;
TodayConfigWidget* configWidget(QWidget *);
QString appName() const;
bool excludeFromRefresh() const;
void refresh();
void reinitialize();
-
- private:
- QGuardedPtr<ExamplePluginWidget> m_widget;
+private:
+ ExamplePluginWidget *m_widget;
};
#endif
diff --git a/noncore/todayplugins/fortune/fortuneplugin.cpp b/noncore/todayplugins/fortune/fortuneplugin.cpp
index 69d2c45..4461219 100644
--- a/noncore/todayplugins/fortune/fortuneplugin.cpp
+++ b/noncore/todayplugins/fortune/fortuneplugin.cpp
@@ -1,71 +1,71 @@
/*
* fortuneplugin.cpp
*
* copyright : (c) 2002 by Chris Larson
* email : kergoth@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "fortuneplugin.h"
#include "fortunepluginwidget.h"
FortunePlugin::FortunePlugin()
{
}
FortunePlugin::~FortunePlugin()
{
}
QString FortunePlugin::pluginName() const
{
return QObject::tr( "Fortune plugin" );
}
double FortunePlugin::versionNumber() const
{
return 0.1;
}
QString FortunePlugin::pixmapNameWidget() const
{
return "Fortune";
}
QWidget* FortunePlugin::widget( QWidget *wid )
{
return new FortunePluginWidget( wid, "Fortune" );
}
QString FortunePlugin::pixmapNameConfig() const
{
return "Fortune";
}
TodayConfigWidget* FortunePlugin::configWidget( QWidget* /*wid*/ )
{
// return new FortunePluginConfig( wid , "Fortune" );
- return NULL;
+ return 0l;
}
QString FortunePlugin::appName() const
{
return "fortune";
}
bool FortunePlugin::excludeFromRefresh() const
{
return false;
}
diff --git a/noncore/todayplugins/fortune/fortuneplugin.h b/noncore/todayplugins/fortune/fortuneplugin.h
index 9b590ad..91bd981 100644
--- a/noncore/todayplugins/fortune/fortuneplugin.h
+++ b/noncore/todayplugins/fortune/fortuneplugin.h
@@ -1,43 +1,40 @@
/*
* fortuneplugin.h
*
* copyright : (c) 2002 by Chris Larson
* email : kergoth@handhelds.org
*
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef FORTUNE_PLUGIN_H
#define FORTUNE_PLUGIN_H
#include <opie2/oclickablelabel.h>
#include <opie2/todayplugininterface.h>
-#include <qstring.h>
-#include <qwidget.h>
-
class FortunePlugin : public TodayPluginObject
{
public:
FortunePlugin();
~FortunePlugin();
QString pluginName() const;
double versionNumber() const;
QString pixmapNameWidget() const;
QWidget* widget( QWidget * );
QString pixmapNameConfig() const;
TodayConfigWidget* configWidget( QWidget * );
QString appName() const;
bool excludeFromRefresh() const;
};
#endif