author | zecke <zecke> | 2004-08-14 15:43:08 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-14 15:43:08 (UTC) |
commit | 7657b6986a600ec1b3626c83e8f19036bf69e493 (patch) (side-by-side diff) | |
tree | d8196d985a24663e9777dcc811f54b0eaf1abc9b | |
parent | 3df06db9e6fd268c7d234be05b01a2303dc0f7ba (diff) | |
download | opie-7657b6986a600ec1b3626c83e8f19036bf69e493.zip opie-7657b6986a600ec1b3626c83e8f19036bf69e493.tar.gz opie-7657b6986a600ec1b3626c83e8f19036bf69e493.tar.bz2 |
Do not delete the parent in dtor, when the parent called you for
destruction
-rw-r--r-- | inputmethods/dasher/QtDasherPlugin.cc | 2 | ||||
-rw-r--r-- | inputmethods/dasher/QtDasherScreen.cc | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/inputmethods/dasher/QtDasherPlugin.cc b/inputmethods/dasher/QtDasherPlugin.cc index f491769..50d4539 100644 --- a/inputmethods/dasher/QtDasherPlugin.cc +++ b/inputmethods/dasher/QtDasherPlugin.cc @@ -6,65 +6,65 @@ #include <qlist.h> #include <qbitmap.h> #include <qlayout.h> #include <qvbox.h> #include <qdialog.h> #include <qscrollview.h> #include <qpopupmenu.h> #include <qhbuttongroup.h> #include <qpushbutton.h> #include <qmessagebox.h> #include <qwindowsystem_qws.h> QtDasherPlugin::QtDasherPlugin(QWidget* parent, const char* name, WFlags f) : QFrame(parent,name,f) { (new QHBoxLayout(this))->setAutoAdd(TRUE); interface = new CDasherInterface; interface->SetSystemLocation("/opt/QtPalmtop/share/dasher/"); interface->Unpause(0); interface->Start(); d = new QtDasherScreen(240,100,interface,this,this); interface->ChangeMaxBitRate(2.5); d->show(); utf8_codec = new QUtf8Codec; } QSize QtDasherPlugin::sizeHint() const { return QSize(240,100); } QtDasherPlugin::~QtDasherPlugin() { - delete d; + delete interface; } void QtDasherPlugin::resetState() { flushcount=0; interface->Start(); interface->Redraw(); } void QtDasherPlugin::unflush() { if (flushcount==0) return; for (; flushcount>0; flushcount--) { deletetext(); } } void QtDasherPlugin::output(int Symbol) { std::string label = interface->GetEditText(Symbol); QString unicodestring = utf8_codec->toUnicode(label.c_str()); for (int i=0; i<int(unicodestring.length()); i++) { emit key( unicodestring[i].unicode(), 0, 0, true, false ); emit key( unicodestring[i].unicode(), 0, 0, false, false ); } } void QtDasherPlugin::deletetext() { emit key( 0, Qt::Key_Backspace, 0, true, false); emit key( 0, Qt::Key_Backspace, 0, false, false); diff --git a/inputmethods/dasher/QtDasherScreen.cc b/inputmethods/dasher/QtDasherScreen.cc index 2179cfb..b8a554c 100644 --- a/inputmethods/dasher/QtDasherScreen.cc +++ b/inputmethods/dasher/QtDasherScreen.cc @@ -50,66 +50,64 @@ QtDasherScreen::QtDasherScreen (int _width, int _height, */ interface->ChangeScreen(this); paused=true; QTimer *tmr = new QTimer(this); connect (tmr, SIGNAL(timeout()), SLOT(timer())); tmr->start(200); } long QtDasherScreen::get_time() { long s_now; long ms_now; struct timeval tv; struct timezone tz; gettimeofday( &tv, &tz ); s_now = tv.tv_sec-1054487600; ms_now = tv.tv_usec / 1000; return( long(s_now*1000 + ms_now) ); } QtDasherScreen::~QtDasherScreen() { delete painter; - delete interface; - delete edit; } QColor QtDasherScreen::getColor(int Color, const Opts::ColorSchemes ColorScheme) const { switch (ColorScheme) { case Dasher::Opts::Nodes1: switch (Color) { case 0: return QColor (180, 245, 180); case 1: return QColor (160, 200, 160); case 2: return QColor (0, 255, 255); default: abort (); } case Dasher::Opts::Nodes2: switch (Color) { case 0: return QColor (255, 185, 255); case 1: return QColor (140, 200, 255); case 2: return QColor (255, 175, 175); default: abort (); } case Dasher::Opts::Special1: return QColor (240, 240, 240); case Dasher::Opts::Special2: return QColor (255, 255, 255); case Dasher::Opts::Groups: switch (Color) { case 0: return QColor (255, 255, 0); case 1: return QColor (255, 100, 100); case 2: return QColor (0, 255, 0); default: abort (); } case Dasher::Opts::Objects: return QColor (0, 0, 0); default: abort(); } } |