author | alwin <alwin> | 2004-03-02 14:00:39 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 14:00:39 (UTC) |
commit | 12dd57c04b42d4517061ed847b1aa041dd8af841 (patch) (side-by-side diff) | |
tree | afbd18d5b439138256d27aecec7ef993d74a0bd7 | |
parent | ac3e7c0a1ccbb984f06917ebe6156b1681b7de7f (diff) | |
download | opie-12dd57c04b42d4517061ed847b1aa041dd8af841.zip opie-12dd57c04b42d4517061ed847b1aa041dd8af841.tar.gz opie-12dd57c04b42d4517061ed847b1aa041dd8af841.tar.bz2 |
fixed up todlist to work again. The segfault resulted due a real ugly code-style:
Never, realy never, use "using namespace <...>" inside a include file.
Ever use "Opie::<class>" or such inside include files. Think twice, before using
a "use namespace <...>" inside a c++ file. If you're using it just 3,4 times,
write "Opie::<class>::<variable>" or such. If you just simple write a using
namespace all the time it makes the idea of namespaces obsolete. Mostly: just
integrate your OWN namespace (in that case use namespace Todo;) - but try
to use all other namespaces the explicit way - so you will sure that the compiler
inherits the right methods.
ToDo: write this statement into the developer wiki
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.h | 8 | ||||
-rw-r--r-- | core/pim/todo/quickeditimpl.cpp | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a244e58..c2f422d 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -59,17 +59,17 @@ #include "mainwindow.h" OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> ) using namespace Todo; MainWindow::MainWindow( QWidget* parent, const char* name, WFlags ) - : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) + : Opie::OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) { if (!name) setName("todo window"); m_syncing = false; m_showing = false; m_counter = 0; m_tempManager = new TemplateManager(); diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index 6a7296b..b35a42b 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h @@ -44,27 +44,25 @@ class QPopupMenu; class QMenuBar; class QToolBar; class QAction; class Ir; class QVBox; class QLineEdit; -using namespace Opie; - namespace Todo { typedef TodoView View; class TemplateManager; class Editor; class TodoShow; class TemplateEditor; struct QuickEditBase; - class MainWindow : public OPimMainWindow { + class MainWindow : public Opie::OPimMainWindow { Q_OBJECT friend class TodoView; // avoid QObject here.... friend class TodoShow; // avoid QObject public: /* OApplicationFactory application Name */ static QString appName() { return QString::fromLatin1("todolist"); } MainWindow( QWidget *parent = 0, @@ -139,17 +137,17 @@ private slots: *m_completedAction, *m_showDeadLineAction, *m_deleteAllAction, *m_deleteCompleteAction, *m_duplicateAction, *m_showOverDueAction, *m_showQuickTaskAction, *m_effectiveAction; - OWidgetStack *m_stack; + Opie::OWidgetStack *m_stack; QPopupMenu* m_catMenu, *m_edit, *m_options, *m_template; bool m_syncing:1; bool m_deadline:1; bool m_completed:1; @@ -200,14 +198,14 @@ private slots: protected slots: void flush(); void reload(); int create(); bool remove( int uid ); void beam(int uid); void show( int uid ); void edit( int uid ); - void add( const OPimRecord& ); + void add( const Opie::OPimRecord& ); void doAlarm( const QDateTime& dt, int uid ); }; } #endif diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp index cd0684f..94ae97e 100644 --- a/core/pim/todo/quickeditimpl.cpp +++ b/core/pim/todo/quickeditimpl.cpp @@ -16,17 +16,17 @@ QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) // Load priority icons // TODO - probably should be done globally somewhere else, // see also tableview.cpp/h, taskeditoroverview.cpp/h priority1 = Resource::loadPixmap( "todo/priority1" ); priority3 = Resource::loadPixmap( "todo/priority3" ); priority5 = Resource::loadPixmap( "todo/priority5" ); - m_lbl = new OClickableLabel( this ); + m_lbl = new Opie::OClickableLabel( this ); m_lbl->setMinimumWidth( 15 ); m_lbl->setPixmap( priority3 ); connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); QWhatsThis::add( m_lbl, QWidget::tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); m_edit = new QLineEdit( this ); setStretchableWidget( m_edit ); QWhatsThis::add( m_edit, QWidget::tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |